diff --git a/Extract keys.bat b/Extract keys.bat index 59c7c31..1047cee 100644 --- a/Extract keys.bat +++ b/Extract keys.bat @@ -1,11 +1,15 @@ @echo off -python walletaid.py +walletaid.py +IF ERRORLEVEL 1 ( + CLS + python walletaid.py +) IF ERRORLEVEL 1 ( CLS "C:\python27\python.exe" walletaid.py ) -if ERRORLEVEL 1 ( +IF ERRORLEVEL 1 ( CLS ECHO Check Python install ) -@pause +@pause \ No newline at end of file diff --git a/walletaid.py b/walletaid.py index 422dff6..e5647bb 100644 --- a/walletaid.py +++ b/walletaid.py @@ -7,10 +7,19 @@ is borrowed from pywallet. import hashlib import binascii +from os import path from ConfigParser import SafeConfigParser -#Opens config.ini and gets settings +#Opens config.ini and gets settings, checks if wallet.dat is in folder config = SafeConfigParser() + +if not path.exists("config.ini"): + print "The config.ini file was not found" + exit(0) +if not path.exists("wallet.dat"): + print "The wallet.dat file is not in folder or has different name" + exit(0) + config.read("config.ini") pubprefix = config.get("settings", "pubkeyprefix") privprefix = config.get("settings", "privkeyprefix") @@ -115,10 +124,6 @@ def hashtowif(b): def address(c): pubkey = str(g * c) pubkey = ("0" * (64 - pubkey.index(" "))) + pubkey - #if pubkey[63] == " ": - # pubkey = "0" + pubkey - #if pubkey[62] == " ": - # pubkey = "00" + pubkey if compressed: if int(pubkey[-1], base=16) % 2 == 0: pref = "02"