fix logic

This commit is contained in:
iceman1001 2022-06-02 20:44:37 +02:00
parent 023ae4c7f1
commit 4195c9d901
2 changed files with 2 additions and 2 deletions

View file

@ -5367,7 +5367,7 @@ static int CmdHF14AMfMAD(const char *Cmd) {
}
// MAD detection
if (HasMADKey(dump)) {
if (HasMADKey(dump) == false) {
PrintAndLogEx(FAILED, "No MAD key was detected in the dump file");
free(dump);
return PM3_ESOFT;

View file

@ -402,5 +402,5 @@ bool HasMADKey(uint8_t *d) {
if (d == NULL)
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);
}