Всем привет! Я прям новичок-новичок! Нашёл скрипт питона и по гайду Ютуба перевёл его в exe файл используя pyinstaller Дело в том, что скрипт через консоль запускается и прекрасно работает отображая прогресс в самой консоли. После перевода его в exe файл вот что пишет в консоли: FileNotFoundError: [Errno 2] No such file or directory:
Я создал папку bitcoin и в ней текстовик english.txt и после запуска консоль просто улетела. В ней максимально быстро выводился текст до надписи memory error, после этого у меня крашнулись все открытые приложения на пк и выскочила вот такая ошибка: Ошибка при запуске приложения 0xc00000fd
Через скрипт всё работает как надо, никаких папок и текстовиков создавать не надо!
Вот как выглядит сам код:
import os, binascii, hashlib, base58, ecdsa
import colorama
from colorama import Fore, Back, Style
colorama.init()
from bitcoin import *
import random
import urllib.request
import multiprocessing
import secrets
import multiprocessing as mp
from time import time, sleep
import blocksmith
import requests
def ripemd160(x):
d = hashlib.new('ripemd160')
d.update(x)
return d
def hexPrvToWif(hexPrv, compressed):
suffix = ""
if compressed:
suffix = "01"
fullkey = '80' + hexPrv + suffix
sha256a = hashlib.sha256(binascii.unhexlify(fullkey)).hexdigest()
sha256b = hashlib.sha256(binascii.unhexlify(sha256a)).hexdigest()
return base58.b58encode(binascii.unhexlify(fullkey+sha256b[:8])).decode()
def wifToPrvHex(wif) :
byte_str = binascii.hexlify(base58.b58decode(wif))
byte_str_drop_last_4bytes = byte_str[0:-8]
byte_str_drop_first_byte = byte_str_drop_last_4bytes[2:].decode()
return byte_str_drop_first_byte if len(byte_str_drop_first_byte) == 64 else byte_str_drop_first_byte[:-2]
def prvToPub(hexPrv, compressed):
sk = ecdsa.SigningKey.from_string(binascii.unhexlify(hexPrv.encode()), curve=ecdsa.SECP256k1)
vk = sk.get_verifying_key()
if compressed:
from ecdsa.util import number_to_string
order = vk.pubkey.order
x_str = binascii.hexlify(number_to_string(vk.pubkey.point.x(), order))
sign = '02' if vk.pubkey.point.y() % 2 == 0 else '03'
return (sign.encode() + x_str).decode()
return '04' + binascii.hexlify(vk.to_string()).decode()
def p2pkh_address(pub): # starts with 1
hash160 = ripemd160(hashlib.sha256(binascii.unhexlify(pub)).digest()).digest()
publ_addr_a = b"\x00" + hash160
checksum = hashlib.sha256(hashlib.sha256(publ_addr_a).digest()).digest()[:4]
return base58.b58encode(publ_addr_a + checksum).decode()
def p2sh_address(pub): # starts with 3
hash160 = ripemd160(hashlib.sha256(binascii.unhexlify(pub)).digest()).digest()
publ_addr_a = b'\x00\x14' + hash160 # bytes.fromhex("0014")
script = ripemd160(hashlib.sha256(publ_addr_a).digest()).digest()
return base58.b58encode_check(b"\x05" + script).decode()
low = 0x0000000000000000000000000000000000000000000000000000000000000000
high = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140
def main():
while True:
ran = random.randrange(low,high,1)
myhex = "%064x" % ran
myhex = myhex[:64]
hexPrv = myhex
Upub = prvToPub(hexPrv, False)
Cpub = prvToPub(hexPrv, True)
response1 = requests.get('https://blockchain.info/q/getreceivedbyaddress/'+p2pkh_address(Cpub))
balance1 = 0
balance1 = response1.json()/100000000
response2 = requests.get('https://blockchain.info/q/getreceivedbyaddress/'+p2pkh_address(Upub))
balance2 = 0
balance2 = response2.json()/100000000
response3 = requests.get('https://blockchain.info/q/getreceivedbyaddress/'+p2sh_address(Cpub))
balance3 = 0
balance3 = response3.json()/100000000
if (balance1 > 0):
print(Fore.BLUE + "KEY!","COMPRESSED BTC:",p2pkh_address(Cpub),hexPrv + "\n\n" + "BTC:",balance1)
s1 = hexPrv
s2 = p2pkh_address(Cpub)
s3 = str(balance1)
f=open("FOUND BTC.txt","a")
f.write("COMPRESSED BTC: " + s2 + "\n" + "hex: " + s1 + "\n\n" + "BTC:" + s3 + "\n\n")
f.close()
pass
if (balance2 > 0):
print(Fore.BLUE + "KEY!","UNCOMPRESSED BTC:",p2pkh_address(Upub),hexPrv + "\n\n" + "BTC:",balance2)
s1 = hexPrv
s2 = p2pkh_address(Upub)
s3 = str(balance2)
f=open("FOUND BTC.txt","a")
f.write("UNCOMPRESSED BTC: " + s2 + "\n" + "hex: " + s1 + "\n\n" + "BTC:" + s3 + "\n\n")
f.close()
pass
if (balance3 > 0):
print(Fore.YELLOW + "KEY!","P2SH:",p2sh_address(Cpub),hexPrv + "\n\n" + "BTC:",balance3)
s1 = hexPrv
s2 = p2sh_address(Cpub)
s3 = str(balance3)
f=open("FOUND BTC.txt","a")
f.write("P2SH: " + s2 + "\n" + "hex: " + s1 + "\n\n" + "BTC:" + s3 + "\n\n")
f.close()
pass
print("=========================== [ BITCOIN ADDRESS ] ===========================")
print(Fore.GREEN +"COMPRESSED:",p2pkh_address(Cpub) + "\n" + "UNCOMPRESSED:",p2pkh_address(Upub) + "\n" + "P2SH:",p2sh_address(Cpub))
print("======================= [ BITCOIN PRIVATE KEYS ] =======================")
print("hex:",hexPrv)
print("Compressed Private Key : ", hexPrvToWif(hexPrv, True))
print("Uncompressed Private Key: ", hexPrvToWif(hexPrv, False))
print("======================= [ BITCOIN BALANCE CHECK ] =======================")
print(Fore.RED +"COMPRESSED BTC:"+ str(balance1))
print(Fore.RED +"UNCOMPRESSED BTC:"+ str(balance2))
print(Fore.RED +"P2SH:"+ str(balance3))
#if __name__ == '__main__':
# thread = int(7)
# for cpu in range(thread):
# multiprocessing.Process(target = main).start()
if __name__ == '__main__':
procs = list()
start = time()
for i in range(1, 15):
proc = mp.Process(target=main)
procs.append(proc)
proc.start()
for proc in procs:
proc.join()