From fea5d882788eb26c84a5572021cfc63eb36342dd Mon Sep 17 00:00:00 2001 From: Iceman Date: Tue, 20 Aug 2019 14:53:52 +0200 Subject: [PATCH] add: detect unfused / write once magic tags, from https://github.com/nfc-tools/libnfc/pull/554 --- armsrc/mifarecmd.c | 7 +++++++ client/mifare/mifarehost.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 5e9de52dd..985a787ca 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1955,6 +1955,8 @@ void MifareCIdent() { #define GEN_1A 1 #define GEN_1B 2 #define GEN_2 4 +#define GEN_UNFUSED 5 + // variables uint8_t isGen = 0; uint8_t rec[1] = {0x00}; @@ -1990,6 +1992,11 @@ TEST2: int res = iso14443a_select_card(uid, NULL, &cuid, true, 0, true); if (res == 2) { + if (cuid == 0xAA55C396 ) { + isGen = GEN_UNFUSED; + goto OUT; + } + ReaderTransmit(rats, sizeof(rats), NULL); res = ReaderReceive(buf, par); if (memcmp(buf, "\x09\x78\x00\x91\x02\xDA\xBC\x19\x10\xF0\x05", 11) == 0) { diff --git a/client/mifare/mifarehost.c b/client/mifare/mifarehost.c index f7c7ce4f2..d22073d02 100644 --- a/client/mifare/mifarehost.c +++ b/client/mifare/mifarehost.c @@ -1041,6 +1041,9 @@ void detect_classic_magic(void) { case 4: PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 2 / CUID): " _GREEN_("YES")); break; + case 5: + PrintAndLogEx(SUCCESS, "Answers to magic commands (Write Once / FUID): " _GREEN_("YES")); + break; default: PrintAndLogEx(INFO, "Answers to magic commands: " _YELLOW_("NO")); break;