//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;
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;
}