-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathpyromid.py
127 lines (102 loc) · 4.99 KB
/
pyromid.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
#
# ███╗ ███╗███╗ ███╗██████╗ ██████╗ ███████╗ █████╗ ██████╗ ██████╗ ███╗ ███╗
# ████╗ ████║████╗ ████║██╔══██╗██╔══██╗╚══███╔╝██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║
# ██╔████╔██║██╔████╔██║██║ ██║██████╔╝ ███╔╝ ███████║ ██║ ██║ ██║██╔████╔██║
# ██║╚██╔╝██║██║╚██╔╝██║██║ ██║██╔══██╗ ███╔╝ ██╔══██║ ██║ ██║ ██║██║╚██╔╝██║
# ██║ ╚═╝ ██║██║ ╚═╝ ██║██████╔╝██║ ██║███████╗██║ ██║██╗╚██████╗╚██████╔╝██║ ╚═╝ ██║
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
#
# Programmer and Owner https://Mmdrza.Com
# Github : github.com/Pymmdrza
# Telegram Channel : Cryptoixer.t.me
# -------------------------------------
# ============= INSTAL ================
# pip install --upgrade cryptofuzz colorthon blessed
# =====================================
import os
import sys
import time
from cryptofuzz import Convertor, Generator
from colorthon import Colors as Fore
from blessed import Terminal
import concurrent.futures as cf
from xTerm import Table
conv = Convertor()
gen = Generator()
term = Terminal()
z = 0
w = 0
richAddress = set()
RICH_FILE = "Bits.txt"
FOUND_FILE = "found.txt"
MNEMONIC_SIZE = 12 # Can be set to 24 if needed
def get_time():
"""Get the current time formatted."""
tt = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
return f"[{Fore.GREY}{tt}{Fore.RESET}] "
def get_title(message_text: str):
"""Set the terminal title."""
sys.stdout.write(f"\x1b]2;{message_text}\x07")
sys.stdout.flush()
def get_address_pairs(mnemonic_str: str):
"""Get compressed and uncompressed addresses from a mnemonic string."""
caddr = conv.mne_to_addr(mnemonic_str, True)
uaddr = conv.mne_to_addr(mnemonic_str, False)
return caddr, uaddr
def data_export():
"""Generate and export data."""
mnemonic = gen.generate_mnemonic(MNEMONIC_SIZE)
compressed_addr, uncompressed_addr = get_address_pairs(mnemonic)
return compressed_addr, uncompressed_addr, mnemonic
def handle_data(data, richAddress):
global z, w
z += 1
"""Handle the processing and logging of data."""
compressed_addr, uncompressed_addr, mnemonic = data
if compressed_addr in richAddress:
w += 1
log_data(f"Address: {compressed_addr}\nMnemonic: {mnemonic}\n")
elif uncompressed_addr in richAddress:
w += 1
log_data(f"Address: {uncompressed_addr}\nMnemonic: {mnemonic}\n")
# -- Output --
track_prefix = f"{get_time()}[ Generate:{Fore.RED}{z}{Fore.RESET} Found:{Fore.GREEN}{w}{Fore.RESET} ] "
track_suffix = f"{Fore.GREEN}{compressed_addr}{Fore.RESET}"
termWidth = term.width
sp = " " * (termWidth - (len(track_prefix) + len(track_suffix)) - 20)
print(
track_prefix, track_suffix, sp, f"{Fore.YELLOW}{uncompressed_addr}{Fore.RESET}"
)
print(f"{track_prefix}{Fore.GREY}{mnemonic}{Fore.RESET}")
get_title(f"Total: {z} | Found: {w}")
def read_addresses_from_file(file_path=RICH_FILE):
"""Read addresses from a file."""
with open(file_path, "r") as file:
return set(line.strip() for line in file.readlines())
def log_data(log_string, file_path=FOUND_FILE):
"""Log data to a file."""
with open(file_path, "a") as file:
file.write(f"{log_string}\n")
def worker_thread():
"""Set up the Pool Processes and handle the data."""
coreTotal = 4
print(f"Core Total: {coreTotal}")
print(f"Read File: {RICH_FILE}")
richAddresses = read_addresses_from_file()
print(f"Found File: {FOUND_FILE}")
print(f"Total Import Address : {len(richAddresses)}")
with cf.ProcessPoolExecutor(max_workers=coreTotal) as executor:
while True:
futures = {executor.submit(data_export): i for i in range(coreTotal)}
for future in cf.as_completed(futures):
try:
data = future.result()
handle_data(data, richAddresses)
except Exception as exc:
print(exc)
if __name__ == "__main__":
try:
worker_thread()
except KeyboardInterrupt:
print("Process interrupted by user. ... Exiting ...")
exit()