From: pwpiwi Date: Tue, 24 Sep 2019 17:34:05 +0000 (+0200) Subject: Merge branch 'master' into fix_iclass_sim X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/1963cc9fe0ab7d6ddd04c5f8b4f27af836e98335?hp=--cc Merge branch 'master' into fix_iclass_sim --- 1963cc9fe0ab7d6ddd04c5f8b4f27af836e98335 diff --cc client/loclass/elite_crack.c index 21a67f54,cfadcfbc..8fda0fbd --- a/client/loclass/elite_crack.c +++ b/client/loclass/elite_crack.c @@@ -391,10 -392,10 +392,10 @@@ int bruteforceItem(dumpdata item, uint1 //Diversify diversifyKey(item.csn, key_sel_p, div_key); //Calc mac - doMAC(item.cc_nr, div_key,calculated_MAC); + doMAC(item.cc_nr, div_key, calculated_MAC); if (memcmp(calculated_MAC, item.mac, 4) == 0) { - for (int i =0 ; i < numbytes_to_recover; i++) + for (int i = 0; i < numbytes_to_recover; i++) prnlog("=> %d: 0x%02x", bytes_to_recover[i], 0xFF & keytable[bytes_to_recover[i]]); found = true; break; @@@ -411,15 -413,16 +412,15 @@@ errors++; //Before we exit, reset the 'BEING_CRACKED' to zero for (int i = 0; i < numbytes_to_recover; i++) { - keytable[bytes_to_recover[i]] &= 0xFF; - keytable[bytes_to_recover[i]] |= CRACK_FAILED; + keytable[bytes_to_recover[i]] &= ~BEING_CRACKED; } } else { - for (int i = 0 ;i < numbytes_to_recover; i++) { - keytable[bytes_to_recover[i]] &= 0xFF; - keytable[bytes_to_recover[i]] |= CRACKED; + for (int i = 0; i < numbytes_to_recover; i++) { + keytable[bytes_to_recover[i]] &= ~BEING_CRACKED; + keytable[bytes_to_recover[i]] |= CRACKED; } - } + return errors; }