chg: 'hf mf fchk' - better handling when no keys was found.

This commit is contained in:
iceman1001 2019-02-18 10:38:49 +01:00
parent 7e601e5285
commit cacba04959

View file

@ -1649,6 +1649,21 @@ out:
t1 = msclock() - t1;
PrintAndLogEx(SUCCESS, "Time in checkkeys (fast): %.1fs\n", (float)(t1/1000.0));
// check..
uint8_t found_keys = 0;
for (uint8_t i = 0; i < sectorsCnt; ++i) {
if ( e_sector[i].foundKey[0] )
found_keys++;
if ( e_sector[i].foundKey[1] )
found_keys++;
}
if ( found_keys == 0 ) {
PrintAndLogEx(WARNING, "No keys found");
} else {
printKeyTable( sectorsCnt, e_sector );
if (transferToEml) {
@ -1691,6 +1706,7 @@ out:
fclose(fkeys);
PrintAndLogEx(NORMAL, "Found keys have been dumped to %s --> 0xffffffffffff has been inserted for unknown keys.", fptr);
}
}
free(keyBlock);
free(e_sector);