From 5122e1289d584bb7deb9dc46b3febeabe9c1b6a5 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Fri, 22 Feb 2019 18:24:22 +0200 Subject: [PATCH] info-byte --- client/mifare/mad.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/mifare/mad.c b/client/mifare/mad.c index 2b6033588..421b4844f 100644 --- a/client/mifare/mad.c +++ b/client/mifare/mad.c @@ -161,6 +161,17 @@ int MAD1DecodeAndPrint(uint8_t *sector, bool verbose, bool *haveMAD2) { if (verbose) PrintAndLogEx(NORMAL, "CRC8-MAD OK."); + // info byte + uint8_t InfoByte = sector[16 + 1] & 0x3f; + if (InfoByte) { + PrintAndLogEx(NORMAL, "Card publisher sector: 0x%02x", InfoByte); + } else { + if (verbose) + PrintAndLogEx(NORMAL, "Card publisher sector not present."); + } + if (InfoByte == 0x10 || InfoByte >= 0x28) + PrintAndLogEx(WARNING, "Info byte error"); + for(int i = 1; i < 16; i++) { uint16_t AID = madGetAID(sector, 1, i); PrintAndLogEx(NORMAL, "%02d [%04X] %s", i, AID, GetAIDDescription(AID));