From 7ceac11308a1f1f8a957e83a07ec1378f1c21786 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 7 Dec 2018 20:11:40 +0100 Subject: [PATCH] chg: Added some more Mifare sector trailer decoding (@Fl0-0) --- client/cmdhfmf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 8653a8994..d46344451 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -624,6 +624,15 @@ int CmdHF14AMfRdSc(const char *Cmd) { PrintAndLogEx(NORMAL, "data : %s", sprint_hex(data + i * 16, 16)); } PrintAndLogEx(NORMAL, "trailer: %s", sprint_hex(data + (sectorNo<32?3:15) * 16, 16)); + + PrintAndLogEx(NORMAL, "Trailer decoded:"); + int bln = mfFirstBlockOfSector(sectorNo); + int blinc = (mfNumBlocksPerSector(sectorNo) > 4) ? 5 : 1; + for (i = 0; i < 4; i++) { + PrintAndLogEx(NORMAL, "Access block %d%s: %s", bln, ((blinc > 1) && (i < 3) ? "+" : "") , mfGetAccessConditionsDesc(i, &(data + (sectorNo<32?3:15) * 16)[6])); + bln += blinc; + } + PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&(data + (sectorNo<32?3:15) * 16)[9], 1)); } } else { PrintAndLogEx(WARNING, "Command execute timeout");