From 643a53c592b48feb16f67c3b3f6fe52d6a4e1fbb Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 5 Sep 2020 08:32:26 +0200 Subject: [PATCH] skip all zeros response that "hf mf sim" might answer.. (wrongly) --- armsrc/mifarecmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 0b5ab761c..ba1f6201a 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1970,6 +1970,10 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) { continue; } + if (memcmp(dataoutbuf, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16) == 0) { + continue; + } + if (blockNo < NumBlocksPerSector(sectorNo) - 1) { emlSetMem(dataoutbuf, FirstBlockOfSector(sectorNo) + blockNo, 1); } else { // sector trailer, keep the keys, set only the AC