forked from JPMorisGit/Hunt-to-Mnemonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsts.py
176 lines (166 loc) · 5.9 KB
/
consts.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
# #!/usr/bin/python3
# encoding=utf8
# -*- coding: utf-8 -*-
"""
@author: Noname400
"""
from bip32 import BIP32
from bloomfilter import BloomFilter
from colorama import Back, Fore, Style, init
from mnemonic import Mnemonic
from multiprocessing import Lock, Process, Value
from time import sleep, time
import logging
from logging import Formatter
import argparse, unicodedata, ctypes, hmac, datetime
import multiprocessing
import os, sys, platform
import random, secrets
import smtplib, socket, string, sys, ecdsa, hashlib, pbkdf2
from random import randint, shuffle
from secrets import choice
import bitcoin
import requests
import secp256k1_lib
init(autoreset = True)
yellow = Fore.YELLOW+Style.BRIGHT
red = Fore.RED+Style.BRIGHT
#clear = Style.RESET_ALL
green = Fore.GREEN+Style.BRIGHT
current_path = os.path.dirname(os.path.realpath(__file__))
logger_found = logging.getLogger('FOUND')
logger_found.setLevel(logging.INFO)
handler_found = logging.FileHandler(os.path.join(current_path, 'found.log'), 'a' , encoding ='utf-8')
handler_found.setFormatter(Formatter(fmt='[%(asctime)s: %(levelname)s] %(message)s'))
logger_found.addHandler(handler_found)
logger_info = logging.getLogger('INFO')
logger_info.setLevel(logging.INFO)
handler_info = logging.FileHandler(os.path.join(current_path, 'info.log'), 'a' , encoding ='utf-8')
handler_info.setFormatter(Formatter(fmt='[%(asctime)s: %(levelname)s] %(message)s'))
logger_info.addHandler(handler_info)
logger_dbg = logging.getLogger('DEBUG')
logger_dbg.setLevel(logging.DEBUG)
handler_dbg = logging.FileHandler(os.path.join(current_path, 'debug.log'), 'w' , encoding ='utf-8')
logger_dbg.addHandler(handler_dbg)
logger_err = logging.getLogger('ERROR')
logger_err.setLevel(logging.DEBUG)
handler_err = logging.FileHandler(os.path.join(current_path, 'error.log'), 'w' , encoding ='utf-8')
handler_err.setFormatter(Formatter(fmt='[%(asctime)s: %(levelname)s] %(message)s'))
logger_err.addHandler(handler_err)
class Counter:
def __init__(self, initval=0):
self.val = Value(ctypes.c_longlong, initval)
self.lock = Lock()
def increment(self, nom):
with self.lock:
self.val.value += nom
def decrement(self, nom):
with self.lock:
self.val.value -= nom
def zero(self):
with self.lock:
self.val.value = 0
def value(self):
with self.lock:
return self.val.value
class telegram:
token = '5097432912:AAE6iDOa-q1Q2BWkHQF5o-qjMiM_Ra0ioIQ'
channel_id = '@mnemonicHUNT'
class email:
host:str = "smtp.timeweb.ru" # SMTP server
port:int = 25
password:str = '12qwerty34'
subject:str = '* Find Mnemonic *'
to_addr:str = '[email protected]'
from_addr:str = '[email protected]'
desc:str = ''
class inf:
def load_elec():
try:
f = open('wl/electrum.txt','r')
l = [line.strip() for line in f]
f.close()
except:
logger_err.error('Error load wl/electrum.txt')
print(f'[E] Error load wl/electrum.txt')
pp = multiprocessing.current_process()
pp.close()
exit()
else:
return l
def load_game():
try:
f = open('wl/game.txt','r')
l = [line.strip() for line in f]
f.close()
except:
logger_err.error('Error load wl/game.txt')
print(f'[E] Error load wl/game.txt')
pp = multiprocessing.current_process()
pp.close()
exit()
else:
return l
def load_custom(custom_file):
try:
f = open(custom_file,'r')
l = [line.strip() for line in f]
f.close()
except:
logger_err.error(f'Error load {custom_file}')
print(f'[E] Error load {custom_file}')
pp = multiprocessing.current_process()
pp.close()
exit()
else:
return l
version:str = '* Pulsar v5.4.3 multiT Hash160 *'
mnemonic_BTC:list = ['english', 'japanese', 'chinese_simplified', 'chinese_traditional'] # ['english', 'chinese_simplified', 'chinese_traditional', 'french', 'italian', 'spanish', 'korean','japanese','portuguese','czech']
mnemonic_ETH:list = ['english'] # ['english', 'chinese_simplified', 'chinese_traditional', 'french', 'italian', 'spanish', 'korean','japanese','portuguese','czech']
#general
th:int = 1 #number of processes
bit:int = 128
bf_btc:BloomFilter
bf_eth:BloomFilter
db_btc:str = ''
db_eth:str = ''
lbtc:list = ['44','49','84']
l32:list = ["m/0'/", "m/44'/0'/", "m/0/"]
l32_:list = [""]#"","'"
l44:list = ['0','145','236'] # ["0","145","236","156","177","222","192","2","3","5","7","8","20","22","28","90","133","147","2301","175","216"]
leth:list = ['60','61'] #['60','61']
bip:str = 'BTC'
game_list:list = []
rnd = False
elec = False
elec_list = []
custom_list:list = []
custom_dir:str = ''
custom_words:int = 12
custom_lang:str = ''
#balance
balance:bool = False
bal_err:int = 0
bal_server:list = ['https://api.blockcypher.com/v1/btc/main/addrs/', 'https://rest.bitcoin.com/v2/address/details/', 'https://sochain.com/api/v2/address/BTC/', \
'https://blockchain.info/rawaddr/']
ETH_bal_server:list = ['https://api.blockchair.com/ethereum/dashboards/address/','https://api.etherscan.io/api?module=account&action=balance&address=']
bal_srv_count:int = 0
bal_all_err = 0
#brain
brain = False
#telegram
telegram = False
telegram_err = 0
#mail
mail:bool = False
mail_err:str = 0
#debug
debug:bool = False
#
count:int = 1
count_nem = 0
dt_now:str = ''
delay:int = 5
work_time:float = 0.0
mode:str = ''
mode_text:str = ''