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

Function searchbinary

keyhunt_legacy.cpp:2329–2353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2327}
2328
2329int searchbinary(struct address_value *buffer,char *data,int64_t array_length) {
2330 int64_t half,min,max,current;
2331 int r = 0,rcmp;
2332 min = 0;
2333 current = 0;
2334 max = array_length;
2335 half = array_length;
2336 while(!r && half >= 1) {
2337 half = (max - min)/2;
2338 rcmp = memcmp(data,buffer[current+half].value,20);
2339 if(rcmp == 0) {
2340 r = 1; //Found!!
2341 }
2342 else {
2343 if(rcmp < 0) { //data < temp_read
2344 max = (max-half);
2345 }
2346 else { // data > temp_read
2347 min = (min+half);
2348 }
2349 current = min;
2350 }
2351 }
2352 return r;
2353}
2354
2355#if defined(_WIN64) && !defined(__CYGWIN__)
2356DWORD WINAPI thread_process_minikeys(LPVOID vargp) {

Callers 3

thread_process_minikeysFunction · 0.70
thread_processFunction · 0.70
thread_pub2rmdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected