forked from JPMorisGit/Hunt-to-Mnemonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuncP.py
823 lines (785 loc) · 53.1 KB
/
funcP.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Noname400
"""
from consts import *
def normalize_text(seed):
# normalize
seed = unicodedata.normalize('NFKD', seed)
# lower
seed = seed.lower()
# remove accents
seed = u''.join([c for c in seed if not unicodedata.combining(c)])
# normalize whitespaces
seed = u' '.join(seed.split())
# remove whitespaces between CJK
seed = u''.join([seed[i] for i in range(len(seed)) if not (seed[i] in string.whitespace)])
return seed
def mnemonic_to_seed32(mnemonic, passphrase=''):
PBKDF2_ROUNDS = 2048
mnemonic = normalize_text(mnemonic)
passphrase = normalize_text(passphrase)
return pbkdf2.PBKDF2(mnemonic, 'electrum' + passphrase, iterations = PBKDF2_ROUNDS, macmodule = hmac, digestmodule = hashlib.sha512).read(16)
def gen_seed(text):
tmp = []
if text == '': return secrets.token_hex(16)
else:
tmp.append(mnemonic_to_seed32(mnemonic=text))
tmp.append(bitcoin.sha256(text)[32:])
tmp.append(bitcoin.dbl_sha256(text)[32:])
return tmp
def mn_encode( message ):
n = 1626
assert len(message) % 8 == 0
out = []
for i in range(len(message)//8):
word = message[8*i:8*i+8]
x = int(word, 16)
w1 = (x%n)
w2 = ((x//n) + w1)%n
w3 = ((x//n//n) + w2)%n
out += [ inf.elec_list[w1], inf.elec_list[w2], inf.elec_list[w3] ]
return out
def mn_decode( wlist ):
n = 1626
out = ''
for i in range(len(wlist)//3):
word1, word2, word3 = wlist[3*i:3*i+3]
w1 = inf.elec_list.index(word1)
w2 = (inf.elec_list.index(word2))%n
w3 = (inf.elec_list.index(word3))%n
x = w1 +n*((w2-w1)%n) +n*n*((w3-w2)%n)
out += '%08x'%x
return out
def generate_private_key():
ecdsaPrivateKey = ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1)
ec = ecdsaPrivateKey.to_string().hex()
ec_i = int(ec,16)
return ec_i
def send_telegram(text: str):
try:
requests.get('https://api.telegram.org/bot{}/sendMessage'.format(telegram.token), params=dict(
chat_id=telegram.channel_id,
text=text))
sleep(20)
except:
print(f'{red}[E] Error send telegram.')
logger_err.error(f'[E] Error send telegram.')
if inf.telegram_err > 3 :
inf.telegram == False
return
else:
inf.telegram_err += 1
sleep(10)
return send_telegram(text)
def convert_int(num:int):
dict_suffix = {0:'Key', 1:'KKeys', 2:'MKeys', 3:'GKeys', 4:'TKeys', 5:'PKeys', 6:'EKeys'}
num *= 1.0
idx = 0
for ii in range(len(dict_suffix)-1):
if int(num/1000) > 0:
idx += 1
num /= 1000
return ('%.2f '%num), dict_suffix[idx]
def reverse_string(s):
return s[::-1]
def bw(text, backspace, fc):
f1 = []
f2 = []
co = 0
list_text = text.split()
for i in range(24):
res_text = ' '.join([str(item) for item in list_text])
if backspace: no_bs = res_text.replace(' ', '')
text_rev = reverse_string(res_text)
f1.append(bitcoin.sha256(res_text))
if backspace: f1.append(bitcoin.sha256(no_bs))
f1.append(bitcoin.sha256(text_rev))
f1.append(bitcoin.dbl_sha256(res_text))
if backspace: f1.append(bitcoin.dbl_sha256(no_bs))
f1.append(bitcoin.dbl_sha256(text_rev))
random.shuffle(list_text)
for res in f1:
f2.append(secp256k1_lib.privatekey_to_h160(1, True, int(res,16)))
f2.append(secp256k1_lib.privatekey_to_h160(0, True, int(res,16)))
f2.append( secp256k1_lib.privatekey_to_h160(0, False, int(res,16)))
for res in f2:
if inf.debug > 0:
addr_c = secp256k1_lib.hash_to_address(0, False, res)
addr_uc = secp256k1_lib.hash_to_address(0, False, res)
addr_cs = secp256k1_lib.hash_to_address(1, False, res)
addr_cbc = secp256k1_lib.hash_to_address(2, False, res)
print(f'[D][BRAIN] PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
logger_dbg.debug(f'[D][BRAIN] PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if res in inf.bf_btc:
addr_c = secp256k1_lib.hash_to_address(0, False, res)
addr_cbc = secp256k1_lib.hash_to_address(2, False, res)
if inf.debug > 0:
print(f'[D][F][BRAIN] PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
logger_dbg.debug(f'[D][F][BRAIN] PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.debug < 1:
if inf.balance:
tx1, b1 = get_balance(addr_c,'BTC')
tx2, b2 = get_balance(addr_uc,'BTC')
tx3, b3 = get_balance(addr_cs,'BTC')
tx4, b4 = get_balance(addr_cbc,'BTC')
if (tx1 > 0) or (tx4 > 0):
print(f'\n[F][BRAIN] Found transaction! PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c}:{b1} | {addr_uc}:{b2} | {addr_cs}:{b3} | {addr_cbc}:{b4} | {text}')
logger_found.info(f'[F][BRAIN] Found transaction! PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c}:{b1} | {addr_uc}:{b2} | {addr_cs}:{b3} | {addr_cbc}:{b4} | {text}')
if (b1 > 0) or (b4 > 0):
print(f'\n[F][BRAIN] Found address in balance! PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
logger_found.info(f'[F][BRAIN] Found address in balance! PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.mail:
send_email(f'[F][BRAIN PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.telegram:
send_telegram(f'[F][BRAIN PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
fc.increment(1)
else:
print(f'\n[F][BRAIN] Found address balance 0.0 PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
logger_found.info(f'[F][BRAIN] Found address balance 0.0 PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.mail:
send_email(f'[F][BRAIN] Found address balance 0.0 PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.telegram:
send_telegram(f'[F][BRAIN] Found address balance 0.0 PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
else:
print(f'\n[F][BRAIN] Found address PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
logger_found.info(f'[F][BRAIN] Found address PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.mail:
send_email(f'[F][BRAIN] Found address PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
if inf.telegram:
send_telegram(f'[F][BRAIN] Found address PVK:{f1[co]} | HASH160:{res.hex()} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc} | {text}')
fc.increment(1)
co += 4
return co
def get_balance(address,cyr):
sleep(11)
if cyr == 'ETH':
try:
response = requests.get(inf.ETH_bal_server[1] + '0x' + address)
return int(response.json()['result'])
except:
print('[E][ETH] NOT connect balance server')
logger_err.error('[E][ETH] NOT connect balance server')
return -1
else:
try:
if inf.bal_srv_count == 0:
response = requests.get(inf.bal_server[inf.bal_srv_count] + str(address))
return int(response.json()['n_tx']), float(response.json()['balance'])
elif inf.bal_srv_count == 1:
response = requests.get(inf.bal_server[inf.bal_srv_count] + str(address))
return int(response.json()['txApperances']), float(response.json()['balance'])
elif inf.bal_srv_count == 2:
response = requests.get(inf.bal_server[inf.bal_srv_count] + str(address))
return int(response.json()['data']['total_txs']), float(response.json()['data']['balance'])
elif inf.bal_srv_count == 3:
response = requests.get(inf.bal_server[inf.bal_srv_count] + str(address))
return int(response.json()['n_tx']), float(response.json()['final_balance'])
except:
logger_err.error('[E][BTC, 44, 32] NOT connect balance server')
print('[E][BTC, 44, 32] NOT connect balance server')
if inf.bal_err < 10:
inf.bal_err += 1
else:
if inf.bal_srv_count < 3:
inf.bal_srv_count += 1
else:
inf.bal_srv_count = 0
inf.bal_all_err += 1
if inf.bal_all_err == 40:
inf.balance = False
return -1
def load_BF(load):
try:
fp = open(load, 'rb')
except FileNotFoundError:
print(f'{red}[E] File: {load} not found.')
logger_err.error(f'[E] File: {load} not found.')
sys.exit()
else:
n_int = int(multiprocessing.current_process().name)
sleep(inf.delay*n_int)
return BloomFilter.load(fp)
def send_email(text):
subject = ''
current_date = datetime.datetime.now()
inf.dt_now = current_date.strftime('%m/%d/%y %H:%M:%S')
text = str(inf.dt_now) + ' | ' + text
subject = email.subject + ' description -> ' + email.desc
BODY:str = '\r\n'.join(('From: %s' % email.from_addr, 'To: %s' % email.to_addr, 'Subject: %s' % subject, '', text)).encode('utf-8')
try:
server = smtplib.SMTP(email.host,email.port)
except (smtplib.SMTPAuthenticationError) or (OSError,ConnectionRefusedError):
print(f'{red} \n[E] could not connect to the mail server')
logger_err.error('[E] could not connect to the mail server')
inf.mail_err += 1
if inf.mail_err >= 3:
inf.mail = False
except ConnectionRefusedError:
print(f'{red} \n[E] could not connect to the mail server')
logger_err.error('[E] could not connect to the mail server')
inf.mail_err += 1
if inf.mail_err >= 3:
inf.mail = False
else:
try:
server.login(email.from_addr, email.password)
except (smtplib.SMTPAuthenticationError) or (OSError,ConnectionRefusedError):
print(f'{red}\n[E] could not connect to the mail server')
logger_err.error('[E] could not connect to the mail server')
inf.mail_err += 1
if inf.mail_err >= 3:
inf.mail = False
else:
try:
server.sendmail(email.from_addr, email.to_addr, BODY)
except UnicodeError:
print(f'{red}\n[E] Error Encode UTF-8')
logger_err.error('[E] Error Encode UTF-8')
else:
server.quit()
def brnd(bip, fc):
def rbtc(group_size,Pv):
co = 0
for tmp in range(group_size):
#----------------------------------------------------------------
bip32_h160_cs = secp256k1_lib.pubkey_to_h160(1, True, Pv[tmp*65:tmp*65+65])
bip32_h160_c = secp256k1_lib.pubkey_to_h160(0, True, Pv[tmp*65:tmp*65+65])
bip32_h160_uc = secp256k1_lib.pubkey_to_h160(0, False, Pv[tmp*65:tmp*65+65])
if inf.debug > 0:
addr_c = secp256k1_lib.hash_to_address(0, False, bip32_h160_c)
addr_uc = secp256k1_lib.hash_to_address(0, False, bip32_h160_uc)
addr_cs = secp256k1_lib.hash_to_address(1, False, bip32_h160_cs)
addr_cbc = secp256k1_lib.hash_to_address(2, False, bip32_h160_c)
print(f'[D][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
print(f'[D][Mode RND BTC] {bip32_h160_uc.hex()} | {bip32_h160_c.hex()} | {bip32_h160_cs.hex()}')
logger_dbg.debug(f'[D][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_dbg.debug(f'[D][Mode RND BTC] {bip32_h160_uc.hex()} | {bip32_h160_c.hex()} | {bip32_h160_cs.hex()}')
if (bip32_h160_c.hex() in inf.bf_btc) or (bip32_h160_uc.hex() in inf.bf_btc) or (bip32_h160_cs.hex() in inf.bf_btc):
if inf.debug > 0:
if inf.telegram:
send_telegram(f'[D][F][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[D][F][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
print(f'[D][F][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[D][F][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_dbg.debug(f'[D][Mode RND BTC] {bip32_h160_uc.hex()} | {bip32_h160_c.hex()}, {bip32_h160_cs.hex()}')
if inf.debug < 1:
addr_c = secp256k1_lib.hash_to_address(0, False, bip32_h160_c)
addr_uc = secp256k1_lib.hash_to_address(0, False, bip32_h160_uc)
addr_cs = secp256k1_lib.hash_to_address(1, False, bip32_h160_cs)
addr_cbc = secp256k1_lib.hash_to_address(2, False, bip32_h160_c)
if inf.balance:
tx1, b1 = get_balance(addr_c,'BTC')
tx2, b2 = get_balance(addr_uc,'BTC')
tx3, b3 = get_balance(addr_cs,'BTC')
tx4, b4 = get_balance(addr_cbc,'BTC')
if (tx1 > 0) or (tx2 > 0) or (tx3 > 0) or (tx4 > 0):
print(f'\n[F][Mode RND BTC] Found transaction! (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode RND BTC] Found transaction! (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if (b1 > 0) or (b2 > 0) or (b3 > 0) or (b4 > 0):
print(f'\n[F][Mode RND BTC] Found address in balance! (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode RND BTC] Found address in balance! (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode RND BTC] (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
fc.increment(1)
else:
print(f'\n[F][Mode RND BTC] Found address balance 0.0 (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode RND BTC] Found address balance 0.0 (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode RND BTC] Found address balance 0.0 (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode RND BTC] Found address balance 0.0 (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
else:
print(f'\n[F][Mode RND BTC] Found address (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode RND BTC] Found address (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode RND BTC] Found address (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode RND BTC] Found address (PG:{tmp}) | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
fc.increment(1)
co += 4
return co
def reth(group_size,Pv):
co = 0
for t in range(group_size):
addr = secp256k1_lib.pubkey_to_ETH_address(Pv[t*65:t*65+65])
if inf.debug > 0:
print(f'[D][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_dbg.debug(f'[D][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if addr in inf.bf_eth:
if inf.debug > 0:
print(f'[D][F][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[D][F][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.debug < 1:
if inf.balance:
b1 = get_balance(addr,'ETH')
if (b1 > 0):
print(f'[F][Mode RND ETH] Found address in balance! (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[F][Mode RND ETH] Found address in balance! (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.telegram:
send_telegram(f'[F][Mode RND ETH] Found address in balance! (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.mail:
send_email(f'[F][Mode RND ETH] Found address in balance! (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
fc.increment(1)
else:
print(f'\n[F][Mode RND ETH] Found address balance 0.0: (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[F][Mode RND ETH] Found address balance 0.0 (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.telegram:
send_telegram(f'[F][Mode RND ETH] Found address balance 0.0 (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.mail:
send_email(f'[F][Mode RND ETH] Found address balance 0.0 (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
else:
print(f'\n[F][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[F][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.telegram:
send_telegram(f'[F][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.mail:
send_email(f'[F][Mode RND ETH] (PG:{t}) | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
fc.increment(1)
co += 1
return co
group_size = 10000
pvk_int = generate_private_key()
P = secp256k1_lib.scalar_multiplication(pvk_int)
current_pvk = pvk_int + 1
Pv = secp256k1_lib.point_sequential_increment(group_size, P)
if bip == 'btc':
res = rbtc(group_size,Pv)
return res
else:
res = reth(group_size,Pv)
return res
def b32(mnem, seed, fc):
co = 0
group_size = 100
bip32 = BIP32.from_seed(seed)
for path in inf.l32:
for num1 in range(1):
for t in inf.l32_:
for num2 in range(20):
for t1 in inf.l32_:
patchs = f"{path}{num1}{t}/{num2}{t1}"
pvk = bip32.get_privkey_from_path(patchs)
pvk_int = int(pvk.hex(),16)
pvk_int = pvk_int - 1
P = secp256k1_lib.scalar_multiplication(pvk_int)
current_pvk = pvk_int + 1
Pv = secp256k1_lib.point_sequential_increment(group_size, P)
for tmp in range(group_size):
#----------------------------------------------------------------
bip32_h160_cs = secp256k1_lib.pubkey_to_h160(1, True, Pv[tmp*65:tmp*65+65])
bip32_h160_c = secp256k1_lib.pubkey_to_h160(0, True, Pv[tmp*65:tmp*65+65])
bip32_h160_uc = secp256k1_lib.pubkey_to_h160(0, False, Pv[tmp*65:tmp*65+65])
if inf.debug > 0:
addr_c = secp256k1_lib.hash_to_address(0, False, bip32_h160_c)
addr_uc = secp256k1_lib.hash_to_address(0, False, bip32_h160_uc)
addr_cs = secp256k1_lib.hash_to_address(1, False, bip32_h160_cs)
addr_cbc = secp256k1_lib.hash_to_address(2, False, bip32_h160_c)
print(f'[D][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
print(f'[D][Mode 32] {bip32_h160_uc.hex()} | {bip32_h160_c.hex()} | {bip32_h160_cs.hex()}')
logger_dbg.debug(f'[D][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_dbg.debug(f'[D][Mode 32] {bip32_h160_uc.hex()} | {bip32_h160_c.hex()} | {bip32_h160_cs.hex()}')
if (bip32_h160_c.hex() in inf.bf_btc) or (bip32_h160_uc.hex() in inf.bf_btc) or (bip32_h160_cs.hex() in inf.bf_btc):
if inf.debug > 0:
if inf.telegram:
send_telegram(f'[D][F][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[D][F][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
print(f'[D][F][Mode 32] {patchs}(PG:{tmp}) | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[D][F][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_dbg.debug(f'[D][Mode 32] {bip32_h160_uc.hex()} | {bip32_h160_c.hex()}, {bip32_h160_cs.hex()}')
if inf.debug < 1:
addr_c = secp256k1_lib.hash_to_address(0, False, bip32_h160_c)
addr_uc = secp256k1_lib.hash_to_address(0, False, bip32_h160_uc)
addr_cs = secp256k1_lib.hash_to_address(1, False, bip32_h160_cs)
addr_cbc = secp256k1_lib.hash_to_address(2, False, bip32_h160_c)
if inf.balance:
tx1, b1 = get_balance(addr_c,'BTC')
tx2, b2 = get_balance(addr_uc,'BTC')
tx3, b3 = get_balance(addr_cs,'BTC')
tx4, b4 = get_balance(addr_cbc,'BTC')
if (tx1 > 0) or (tx2 > 0) or (tx3 > 0) or (tx4 > 0):
print(f'\n[F][Mode 32] Found transaction! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode 32] Found transaction! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if (b1 > 0) or (b2 > 0) or (b3 > 0) or (b4 > 0):
print(f'\n[F][Mode 32] Found address in balance! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode 32] Found address in balance! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode 32] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
fc.increment(1)
else:
print(f'\n[F][Mode 32] Found address balance 0.0 {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode 32] Found address balance 0.0 {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode 32] Found address balance 0.0 {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode 32] Found address balance 0.0 {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
else:
print(f'\n[F][Mode 32] Found address {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode 32] Found address {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode 32] Found address {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode 32] Found address {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
fc.increment(1)
co += 3
return co
def bETH(mnem, seed, fc):
co = 0
group_size = 150
w = BIP32.from_seed(seed)
for bi in range(2):
for p in inf.leth:
for nom2 in range(1):#accaunt
for nom3 in range(2):#in/out
for nom in range(20):
if bi == 0:
patchs = f"m/44'/{p}'/{nom2}'/{nom3}/{nom}"
elif bi == 1:
patchs = f"m/44'/{p}'/{nom3}'/{nom}"
pvk = w.get_privkey_from_path(patchs)
pvk_int = int(pvk.hex(),16)
pvk_int = pvk_int - 1
P = secp256k1_lib.scalar_multiplication(pvk_int)
current_pvk = pvk_int + 1
Pv = secp256k1_lib.point_sequential_increment(group_size, P)
for t in range(group_size):
addr = secp256k1_lib.pubkey_to_ETH_address(Pv[t*65:t*65+65])
if inf.debug > 0:
print(f'[D][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_dbg.debug(f'[D][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if addr in inf.bf_eth:
if inf.debug > 0:
print(f'[D][F][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[D][F][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.debug < 1:
if inf.balance:
b1 = get_balance(addr,'ETH')
if (b1 > 0):
print(f'[F][Mode ETH] Found address in balance! {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[F][Mode ETH] Found address in balance! {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.telegram:
send_telegram(f'[F][Mode ETH] Found address in balance! {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.mail:
send_email(f'[F][Mode ETH] Found address in balance! {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
fc.increment(1)
else:
print(f'\n[F][Mode ETH] Found address balance 0.0: {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[F][Mode ETH] Found address balance 0.0 {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.telegram:
send_telegram(f'[F][Mode ETH] Found address balance 0.0 {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.mail:
send_email(f'[F][Mode ETH] Found address balance 0.0 {patchs}(PG:{t}) {mnem} | {seed.hex()} || PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
else:
print(f'\n[F][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
logger_found.info(f'[F][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.telegram:
send_telegram(f'[F][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
if inf.mail:
send_email(f'[F][Mode ETH] {patchs}(PG:{t}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+t)[2:]} | addr:0x{addr}')
fc.increment(1)
co += 1
return co
def b44(mnem, seed, fc):
co = 0
group_size = 100
w = BIP32.from_seed(seed)
for p in inf.l44:
for nom2 in range(1):#accaunt
for nom3 in range(2):#in/out
for nom in range(20):
patchs = f"m/44'/{p}'/{nom2}'/{nom3}/{nom}"
pvk = w.get_privkey_from_path(patchs)
pvk_int = int(pvk.hex(),16)
pvk_int = pvk_int - 1
P = secp256k1_lib.scalar_multiplication(pvk_int)
current_pvk = pvk_int + 1
Pv = secp256k1_lib.point_sequential_increment(group_size, P)
for tmp in range(group_size):
bip44_h160_cs = secp256k1_lib.pubkey_to_h160(1, True, Pv[tmp*65:tmp*65+65])
bip44_h160_c = secp256k1_lib.pubkey_to_h160(0, True, Pv[tmp*65:tmp*65+65])
bip44_h160_uc = secp256k1_lib.pubkey_to_h160(0, False, Pv[tmp*65:tmp*65+65])
if inf.debug > 0 :
logger_dbg.debug(f'[D][P:{multiprocessing.current_process().name}] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
print(f'\n[D] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
if (bip44_h160_c.hex() in inf.bf_btc) or (bip44_h160_uc.hex() in inf.bf_btc) or (bip44_h160_cs.hex() in inf.bf_btc):
if inf.debug > 0:
logger_found.info(f'[D][F][P:{multiprocessing.current_process().name}] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
if inf.debug < 1:
print(f'\n[F][Mode 44 BTC] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
logger_found.info(f'[F][Mode 44 BTC] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
if inf.telegram:
send_telegram(f'[F][Mode 44 BTC] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
if inf.mail:
send_email(f'[F][Mode 44 BTC] {patchs} | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | HASH160:{bip44_h160_c.hex()} | HASH160:{bip44_h160_uc.hex()} | HASH160:{bip44_h160_cs.hex()}')
fc.increment(1)
co += 3
return co
def bBTC(mnem, seed, fc):
co = 0
group_size = 100
w = BIP32.from_seed(seed)
for bip_ in inf.lbtc:
for nom2 in range(1):
for nom3 in range(2):
for nom in range(20):
patchs = f"m/{bip_}'/0'/{nom2}'/{nom3}/{nom}"
pvk = w.get_privkey_from_path(patchs)
pvk_int = int(pvk.hex(),16)
pvk_int = pvk_int - 1
P = secp256k1_lib.scalar_multiplication(pvk_int)
current_pvk = pvk_int + 1
Pv = secp256k1_lib.point_sequential_increment(group_size, P)
for tmp in range(group_size):
bip44_h160_cs = secp256k1_lib.pubkey_to_h160(1, True, Pv[tmp*65:tmp*65+65])
bip44_h160_c = secp256k1_lib.pubkey_to_h160(0, True, Pv[tmp*65:tmp*65+65])
bip44_h160_uc = secp256k1_lib.pubkey_to_h160(0, False, Pv[tmp*65:tmp*65+65])
if inf.debug > 0:
#----------------------------------------------------------------
addr_c = secp256k1_lib.hash_to_address(0, False, bip44_h160_c)
addr_uc = secp256k1_lib.hash_to_address(0, False, bip44_h160_uc)
addr_cs = secp256k1_lib.hash_to_address(1, False, bip44_h160_cs)
addr_cbc = secp256k1_lib.hash_to_address(2, False, bip44_h160_c)
print(f'\n[D][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
print(f'[D][Mode BTC] {bip_,bip44_h160_c.hex()} | {bip44_h160_uc.hex()} | {bip_,bip44_h160_cs.hex()}')
logger_dbg.debug(f'[D][Mode BTC][P:{multiprocessing.current_process().name}] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_dbg.debug(f'[D][Mode BTC] {bip_,bip44_h160_c.hex()} | {bip44_h160_uc.hex()} | {bip_,bip44_h160_cs.hex()}')
if (bip44_h160_c.hex() in inf.bf_btc) or (bip44_h160_uc.hex() in inf.bf_btc) or (bip44_h160_cs.hex() in inf.bf_btc):
if inf.debug > 0:
if inf.telegram:
send_telegram(f'[D][F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[D][F][Mode BTC] {patchs}(PG:{tmp}) | | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
print(f'[D][F][Mode BTC][P:{multiprocessing.current_process().name}] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[D][F][Mode BTC][P:{multiprocessing.current_process().name}] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.debug < 1:
addr_c = secp256k1_lib.hash_to_address(0, False, bip44_h160_c)
addr_uc = secp256k1_lib.hash_to_address(0, False, bip44_h160_uc)
addr_cs = secp256k1_lib.hash_to_address(1, False, bip44_h160_cs)
addr_cbc = secp256k1_lib.hash_to_address(2, False, bip44_h160_c)
if inf.balance:
tx1, b1 = get_balance(addr_c,'BTC')
tx2, b2 = get_balance(addr_uc,'BTC')
tx3, b3 = get_balance(addr_cs,'BTC')
tx4, b4 = get_balance(addr_cbc,'BTC')
if (tx1 > 0) or (tx2 > 0) or (tx3 > 0) or (tx4 > 0):
print(f'[F][Mode BTC] Found transaction! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode BTC] Found transaction! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if (b1 > 0) or (b2 > 0) or (b3 > 0) or (b4 > 0):
print(f'\n[F][Mode BTC] Found balance! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode BTC] Found balance! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode BTC] Found balance! {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
fc.increment(1)
else:
print(f'\n[F False][Mode BTC] Found address balance 0.0 {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F False][Mode BTC] Found address balance 0.0 {patchs} | {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F False][Mode BTC] Found address balance 0.0 {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
else:
print(f'\n[F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
logger_found.info(f'[F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.telegram:
send_telegram(f'[F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
if inf.mail:
send_email(f'[F][Mode BTC] {patchs}(PG:{tmp}) | {mnem} | {seed.hex()} | PVK:{hex(current_pvk+tmp)[2:]} | {addr_c} | {addr_uc} | {addr_cs} | {addr_cbc}')
fc.increment(1)
co += 3
return co
def belec(fc):
co = 0
seed = gen_seed('')
mnemo = mn_encode(seed)
mpub = bitcoin.electrum_mpk(seed)
for i in range(2):
for ii in range(20):
pub = bitcoin.from_string_to_bytes(bitcoin.electrum_pubkey(mpub, ii, i))
gl = bitcoin.from_string_to_bytes('04'+ mpub)
res = secp256k1_lib.pubkey_to_h160(0,False,pub).hex()
res2 = secp256k1_lib.pubkey_to_h160(0,False,gl).hex()
if (res in inf.bf_btc) or (res2 in inf.bf_btc):
fc.increment(1)
#print(f'{mnemo} | {seed} | {res}')
logger_info.info('found.txt',f'{mnemo} | {seed} | {res} | {res2}')
if inf.balance:
tx1, b1 = get_balance(res)
tx2, b2 = get_balance(res2)
if (tx1 > 0):
print(f'\n[W] Found transaction! | {res}:{b1} | {res2}:{b2}')
print(f'\n[W] Found address | {res}:{b1} | {res2}:{b2}')
if (b1 > 0):
print(f'\n[W] Found address in balance | mnem:{mnemo} | {seed} | {res} | {res2}')
logger_info.info('found.txt',f'{mnemo} | {seed} | {res} | {res2}')
else:
if (b1 < 0):
print(f'\n[W] Found address | {mnemo} | {seed} | {res} | {res2}')
logger_info.info(f'log.txt',f'{mnemo} | {seed} | {res} | {res2}')
print('[W] Found address balance 0.0')
else:
print(f'\n[W] Found address | {mnemo} | {seed} | {res} | {res2}')
logger_info.info(f'found.txt',f'{mnemo} | {seed} | {res} | {res2}')
co +=2
return co
def nnmnem(mem):
def normalize_text(seed):
# normalize
seed = unicodedata.normalize('NFKD', seed)
# lower
seed = seed.lower()
# remove accents
seed = u''.join([c for c in seed if not unicodedata.combining(c)])
# normalize whitespaces
seed = u' '.join(seed.split())
# remove whitespaces between CJK
seed = u''.join([seed[i] for i in range(len(seed)) if not (seed[i] in string.whitespace)])
return seed
def mnemonic_to_seed32(mnemonic, passphrase=''):
PBKDF2_ROUNDS = 2048
mnemonic = normalize_text(mnemonic)
passphrase = normalize_text(passphrase)
return pbkdf2.PBKDF2(mnemonic, 'electrum' + passphrase, iterations = PBKDF2_ROUNDS, macmodule = hmac, digestmodule = hashlib.sha512).read(16)
def gen_seed(text):
if text == '': return bitcoin.random_electrum_seed()
else:
return mnemonic_to_seed32(mnemonic=text), bitcoin.sha256('text')[32:], bitcoin.dbl_sha256('text')[32:]
def mn_encode( message ):
n = 1626
assert len(message) % 8 == 0
out = []
for i in range(len(message)//8):
word = message[8*i:8*i+8]
x = int(word, 16)
w1 = (x%n)
w2 = ((x//n) + w1)%n
w3 = ((x//n//n) + w2)%n
out += [ inf.elec_list[w1], inf.elec_list[w2], inf.elec_list[w3] ]
return out
def mn_decode( wlist ):
out = ''
n = 1626
for i in range(len(wlist)//3):
word1, word2, word3 = wlist[3*i:3*i+3]
w1 = inf.elec_list.index(word1)
w2 = (inf.elec_list.index(word2))%n
w3 = (inf.elec_list.index(word3))%n
x = w1 +n*((w2-w1)%n) +n*n*((w3-w2)%n)
out += '%08x'%x
return out
if inf.bip == 'elec':
if inf.mode == 's':
mnemonic = ' '.join(secrets.choice(inf.elec_list) for i in range(12))
w1 = mnemonic.split()
seed = mn_decode(w1)
return mnemonic, seed
else:
seed = gen_seed('')
mnemonic = mn_encode(seed)
return mnemonic, seed
else:
if inf.mode == 'e':
mnemo:Mnemonic = Mnemonic(mem)
if inf.bit == 128: bit = 16
if inf.bit == 160: bit = 20
if inf.bit == 192: bit = 24
if inf.bit == 224: bit = 28
if inf.bit == 256: bit = 32
ran = secrets.token_hex(bit)
mnemonic = mnemo.to_mnemonic(bytes.fromhex(ran))
seed_bytes = mnemo.to_seed(mnemonic, passphrase='')
elif inf.mode =='g':
mnemonic = ''
mnemo:Mnemonic = Mnemonic(mem)
rw = randint(1,25)
mnemonic = ' '.join(choice(inf.game_list) for i in range(rw))
seed_bytes:bytes = mnemo.to_seed(mnemonic, passphrase='')
elif inf.mode =='c':
mnemonic = ''
mnemo:Mnemonic = Mnemonic(mem)
rw = inf.custom_words
mnemonic = ' '.join(choice(inf.custom_list) for i in range(rw))
seed_bytes:bytes = mnemo.to_seed(mnemonic, passphrase='')
else:
mnemo:Mnemonic = Mnemonic(mem)
mnemonic:str = mnemo.generate(strength=inf.bit)
seed_bytes:bytes = mnemo.to_seed(mnemonic, passphrase='')
if inf.debug==1:
mnemo = Mnemonic('english')
mnemonic = 'world evolve cry outer garden common differ jump few diet cliff lumber'
seed_bytes:bytes = mnemo.to_seed(mnemonic, passphrase='')
print(f'Debug Mnemonic : {mnemonic}')
print(f'Debug SEED : {seed_bytes.hex()}')
logger_dbg.debug(f'[D] Debug Mnemonic : {mnemonic}')
logger_dbg.debug(f'[D] Debug SEED : {seed_bytes.hex()}')
if inf.debug==2:
if inf.mode == 'e':
print(f'Entropy : {ran}')
print(f'Debug Mnemonic : {mnemonic}')
print(f'Debug SEED : {seed_bytes.hex()}')
logger_dbg.debug(f'[D] Debug Mnemonic : {mnemonic}')
logger_dbg.debug(f'[D] Debug SEED : {seed_bytes.hex()}')
if inf.mode == 'e' : return mnemonic, seed_bytes , ran
else: return mnemonic, seed_bytes
def test():
if inf.telegram:
try:
requests.get('https://api.telegram.org/bot{}/sendMessage'.format(telegram.token), params=dict(
chat_id=telegram.channel_id,
text=f'Сommunication check. HUNT-to-mnemonic ver.{inf.version}. run client {email.desc}'
))
except:
print(f'{red} check your internet connection, could not send message to telegram')
logger_err.error(f'check your internet connection, could not send message to telegram')
print('-'*70,end='\n')
print('DEPENDENCY TESTING:')
if platform.system().lower().startswith('win'):
dllfile = 'ice_secp256k1.dll'
if os.path.isfile(dllfile) == True:
pass
else:
print(f'{red} File {dllfile} not found')
logger_err.error(f'File {dllfile} not found')
elif platform.system().lower().startswith('lin'):
dllfile = 'ice_secp256k1.so'
if os.path.isfile(dllfile) == True:
pass
else:
print(f'{red} File {dllfile} not found')
logger_err.error(f'File {dllfile} not found')
else:
print(f'{red} * Unsupported Platform currently for ctypes dll method. Only [Windows and Linux] is working')
logger_err.error(f'* Unsupported Platform currently for ctypes dll method. Only [Windows and Linux] is working')
exit
mnemo:Mnemonic = Mnemonic('english')
mnemonic = 'world evolve cry outer garden common differ jump few diet cliff lumber'
seed_bytes:bytes = mnemo.to_seed(mnemonic, passphrase='')
if seed_bytes.hex() !='bd85556143de177ed9781ac3b24ba33d0bc4f8d6f34d9eaa1d9b8ab0ee3a7e84d42638b520043234bcedb4e869464b9f964e7e8dbf1588395f7a7782588ae664':
print(f'{red} ERROR: Generate mnemonic')
print(f'{red} Please reinstall https://github.com/trezor/python-mnemonic')
logger_err.error(f'ERROR: Generate mnemonic')
logger_err.error(f'Please reinstall https://github.com/trezor/python-mnemonic')
exit
bip32 = BIP32.from_seed(seed_bytes)
patchs = "m/0'/0'/0"
pvk = bip32.get_privkey_from_path(patchs)
pvk_int = int(pvk.hex(),16)
bip_hash_c = secp256k1_lib.privatekey_to_h160(0,True,pvk_int)
bip_hash_uc = secp256k1_lib.privatekey_to_h160(0,False,pvk_int)
addr_c = secp256k1_lib.hash_to_address(0,True,bip_hash_c)
addr_uc = secp256k1_lib.hash_to_address(0,False,bip_hash_uc)
if (addr_c != '1JiG9xbyAPNfX8p4M6qxE6PwyibnqARkuq') or (addr_uc != '1EHciAwg1thir7Gvj5cbrsyf3JQbxHmWMW'):
print(f'{red} ERROR: Convert address from mnemonic')
print(f'{red} Please recopy https://github.com/iceland2k14/secp256k1')
logger_err.error(f'ERROR: Convert address from mnemonic')
logger_err.error(f'Please recopy https://github.com/iceland2k14/secp256k1')
exit
return True