mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-21 15:56:21 +08:00
fix logic
This commit is contained in:
parent
023ae4c7f1
commit
4195c9d901
|
@ -5367,7 +5367,7 @@ static int CmdHF14AMfMAD(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MAD detection
|
// MAD detection
|
||||||
if (HasMADKey(dump)) {
|
if (HasMADKey(dump) == false) {
|
||||||
PrintAndLogEx(FAILED, "No MAD key was detected in the dump file");
|
PrintAndLogEx(FAILED, "No MAD key was detected in the dump file");
|
||||||
free(dump);
|
free(dump);
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
|
|
@ -402,5 +402,5 @@ bool HasMADKey(uint8_t *d) {
|
||||||
if (d == NULL)
|
if (d == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (memcmp(d + (3 * MFBLOCK_SIZE), g_mifare_mad_key, 6) != 0);
|
return (memcmp(d + (3 * MFBLOCK_SIZE), g_mifare_mad_key, sizeof(g_mifare_mad_key)) == 0);
|
||||||
}
|
}
|
Loading…
Reference in a new issue