-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAutomaticFix.py
35 lines (29 loc) · 1.03 KB
/
AutomaticFix.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
__author__ = 'elichai2'
import FixPrivateKey
import argparse
import sys
def main():
parser = argparse.ArgumentParser(description="Tries a lot of automatic fix's, swapping letters,"
" checking length, changing up to 5 letters"
". supports WIF private key only")
parser.add_argument('privkey', type=str,
help='The WIF privkey')
args = parser.parse_args()
# check the length
privkey = FixPrivateKey.check_length(privkey)
# check if right
privkey = args.privkey
if FixPrivateKey.check(privkey):
print privkey
sys.exit(0)
# check if letters swapped
result = FixPrivateKey.swap_letters(privkey)
if result is not None:
print result
sys.exit(0)
# try changing 1 to 5 letters
for i in range(1, 5):
result = FixPrivateKey.check_length(privkey, i)
if result != '\nCouldn\'t find any result':
print result
break