| 6021 | } |
| 6022 | |
| 6023 | void 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 | |
| 6053 | bool isBase58(char c) { |
| 6054 | // Define the base58 set |
no test coverage detected