- num_to_bytes(key64, 6, keyBlock);\r
- key64 = 0;\r
- if (!mfCheckKeys(statelists[0].blockNo, statelists[0].keyType, false, 1, keyBlock, &key64)) {\r
- num_to_bytes(key64, 6, resultKey);\r
- break;\r
- }\r
+ num_to_bytes(key64, 6, keyBlock + i * 6);\r
+ }\r
+\r
+ if (!mfCheckKeys(statelists[0].blockNo, statelists[0].keyType, false, numOfCandidates, keyBlock, &key64)) { \r
+ free(statelists[0].head.slhead);\r
+ free(statelists[1].head.slhead);\r
+ num_to_bytes(key64, 6, resultKey);\r
+\r
+ PrintAndLog("UID: %08x target block:%3u key type: %c -- Found key [%012"llx"]",\r
+ uid,\r
+ (uint16_t)resp.arg[2] & 0xff,\r
+ (resp.arg[2] >> 8) ? 'B' : 'A',\r
+ key64\r
+ );\r
+ return -5;\r