From bef2afcccf3d182409d98484d24a9c086d181893 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 3 Jul 2026 09:04:05 -0700 Subject: [PATCH] Added version numbers to ginfo output. Also, fixed version detection for short version response and updated magic card notes. --- client/src/cmdhfmf.c | 12 ++++++------ doc/magic_cards_notes.md | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index bbe36d391..c2c1954be 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -8830,7 +8830,7 @@ static int CmdHF14AGen4Info(const char *cmd) { uint8_t uid_len = resp[1]; res = mfG4GetFactoryTest(pwd, resp, &resplen, false); - if (res == PM3_SUCCESS && resplen > 2) { + if (res == PM3_SUCCESS && resplen >= 2) { PrintAndLogEx(INFO, ""); PrintAndLogEx(INFO, _CYAN_("Factory test")); @@ -8839,19 +8839,19 @@ static int CmdHF14AGen4Info(const char *cmd) { } if (memcmp(resp + resplen - 2, "\x66\x66", 2) == 0) { - PrintAndLogEx(INFO, "Card type... Generic"); + PrintAndLogEx(INFO, "Card type... Generic (%02X%02X)", resp[resplen - 2], resp[resplen - 1]); } else if (memcmp(resp + resplen - 2, "\x02\xAA", 2) == 0) { - PrintAndLogEx(INFO, "Card type... " _RED_("Limited functionality")); + PrintAndLogEx(INFO, "Card type... " _RED_("Limited functionality (%02X%02X)"), resp[resplen - 2], resp[resplen - 1]); } else if (memcmp(resp + resplen - 2, "\x03\xA0", 2) == 0) { - PrintAndLogEx(INFO, "Card type... Old card version"); + PrintAndLogEx(INFO, "Card type... Old card version (%02X%02X)", resp[resplen - 2], resp[resplen - 1]); } else if (memcmp(resp + resplen - 2, "\x06\xA0", 2) == 0) { - PrintAndLogEx(INFO, "Card type... " _GREEN_("New card version")); + PrintAndLogEx(INFO, "Card type... " _GREEN_("New card version (%02X%02X)"), resp[resplen - 2], resp[resplen - 1]); } else { - PrintAndLogEx(INFO, "Card type... " _RED_("unknown %02X%02X"), resp[resplen - 2], resp[resplen - 1]); + PrintAndLogEx(INFO, "Card type... " _RED_("unknown (%02X%02X)"), resp[resplen - 2], resp[resplen - 1]); } } diff --git a/doc/magic_cards_notes.md b/doc/magic_cards_notes.md index cbc4818b9..6c7daaf6f 100644 --- a/doc/magic_cards_notes.md +++ b/doc/magic_cards_notes.md @@ -2837,6 +2837,8 @@ The CF..CC command is commonly considered to be a way of determining UMC version - 6666 "Card type generic" - 02AA "Card type limited functionality" +**NOTE**: Some versions (eg, 6666) return just the version + crc (4-bytes) others (eg, 06A0) return a zero padded version + crc (7-bytes). + ### Proxmark3 commands ^[Top](#top) ^^[Gen4](#g4top)