MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / writekeyeth

Function writekeyeth

keyhunt.cpp:6023–6051  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6021}
6022
6023void writekeyeth(Int *key) {
6024 Point publickey;
6025 FILE *keys;
6026 char *hextemp,address[43],hash[20];
6027 hextemp = key->GetBase16();
6028 publickey = secp->ComputePublicKey(key);
6029 generate_binaddress_eth(publickey,(unsigned char*)hash);
6030 address[0] = '0';
6031 address[1] = 'x';
6032 tohex_dst(hash,20,address+2);
6033
6034#if defined(_WIN64) && !defined(__CYGWIN__)
6035 WaitForSingleObject(write_keys, INFINITE);
6036#else
6037 pthread_mutex_lock(&write_keys);
6038#endif
6039 keys = fopen("KEYFOUNDKEYFOUND.txt","a+");
6040 if(keys != NULL) {
6041 fprintf(keys,"Private Key: %s\naddress: %s\n",hextemp,address);
6042 fclose(keys);
6043 }
6044 printf("\n Hit!!!! Private Key: %s\naddress: %s\n",hextemp,address);
6045#if defined(_WIN64) && !defined(__CYGWIN__)
6046 ReleaseMutex(write_keys);
6047#else
6048 pthread_mutex_unlock(&write_keys);
6049#endif
6050 free(hextemp);
6051}
6052
6053bool isBase58(char c) {
6054 // Define the base58 set

Callers 1

thread_processFunction · 0.70

Calls 4

tohex_dstFunction · 0.85
generate_binaddress_ethFunction · 0.70
GetBase16Method · 0.45
ComputePublicKeyMethod · 0.45

Tested by

no test coverage detected