forked from jackjack-jj/fillet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fillet.py
executable file
·57 lines (36 loc) · 1.3 KB
/
fillet.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
import hashlib
import StringIO
import os
from subprocess import *
def filetowallet(path, number):
filin = open(path, 'r')
filec = filin.read()
filin.close()
return hashlib.sha256(filec + "%d"%number).digest().encode('hex')
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser(usage="%prog [options]", version="%prog 1.0")
parser.add_option("--file", dest="file",
help="file")
parser.add_option("--keynumber", dest="keynumber",
help="keynumber, (default=1)", default="1")
parser.add_option("--size", dest="size",
help="wallet size, (default=10)", default="10")
parser.add_option("-p", "--pwpath", dest="pwpath",
help="hex2wifaddr.py directory")
(options, args) = parser.parse_args()
if options.file is None:
print "You must provide a file"
exit(0)
if not os.path.isfile(options.file):
print '%s doesn\'t exist'%(options.file)
exit(0)
for i in range(int(options.size)):
kn = int(options.keynumber) + i
seckey = filetowallet(options.file, kn)
print options.file + ", key #" + "%d"%kn + ": " + seckey
if options.pwpath is not None:
a=Popen(options.pwpath + "hex2wifaddr.py " + seckey, shell=True, bufsize=-1, stdout=PIPE).stdout
print(a.read())
a.close()