Merge pull request #243 from McEloff/hf_mf_chk_log

Does clear trace log only at first call 'hf mf chk', to save process history
This commit is contained in:
Philippe Teuwen 2019-07-13 18:27:44 +02:00 committed by GitHub
commit 99d33f9479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1959,6 +1959,8 @@ static int CmdHF14AMfChk(const char *Cmd) {
// fast push mode
conn.block_after_ACK = true;
// clear trace log by first check keys call only
bool clearLog = true;
// check keys.
for (trgKeyType = (keyType == 2) ? 0 : keyType; trgKeyType < 2; (keyType == 2) ? (++trgKeyType) : (trgKeyType = 2)) {
@ -1979,11 +1981,13 @@ static int CmdHF14AMfChk(const char *Cmd) {
uint16_t size = keycnt - c > max_keys ? max_keys : keycnt - c;
if (mfCheckKeys(b, trgKeyType, true, size, &keyBlock[6 * c], &key64) == PM3_SUCCESS) {
if (mfCheckKeys(b, trgKeyType, clearLog, size, &keyBlock[6 * c], &key64) == PM3_SUCCESS) {
e_sector[i].Key[trgKeyType] = key64;
e_sector[i].foundKey[trgKeyType] = true;
clearLog = false;
break;
}
clearLog = false;
}
b < 127 ? (b += 4) : (b += 16);
}