From b834fbf00dd91c4e9a8c40250297ecafc1efb1ef Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Wed, 4 Sep 2024 22:41:09 +0800 Subject: [PATCH] refactor: mifare info --- client/src/cmdhf14a.c | 4 ++-- client/src/cmdhfmf.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index 52c1b3b1e..b30996230 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -2610,8 +2610,8 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { PrintAndLogEx(SUCCESS, "Static nonce......... " _YELLOW_("yes")); } - if (res == NONCE_FAIL && verbose) { - PrintAndLogEx(SUCCESS, "Static nonce......... " _RED_("read failed")); + if (res == NONCE_FAIL) { + PrintAndLogEx(SUCCESS, "nonce................ " _RED_("read failed")); } if (res == NONCE_NORMAL) { diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index c46bf300d..1439a9145 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -9579,7 +9579,7 @@ static int CmdHF14AMfInfo(const char *Cmd) { } if (fKeyType != 0xFF) { - PrintAndLogEx(SUCCESS, "Block 0.......... %s", sprint_hex(blockdata, MFBLOCK_SIZE)); + PrintAndLogEx(SUCCESS, "Block 0.......... %s", sprint_hex_ascii(blockdata, MFBLOCK_SIZE)); } PrintAndLogEx(NORMAL, ""); @@ -9615,7 +9615,7 @@ static int CmdHF14AMfInfo(const char *Cmd) { PrintAndLogEx(SUCCESS, "NXP MF1ICS5004"); } else if (fKeyType == MF_KEY_BD08 || fKeyType == MF_KEY_BD08S || fKeyType == MF_KEY_BD32) { PrintAndLogEx(SUCCESS, _RED_("Unknown card with backdoor, please report details!")); - } + } else // other cards if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x46", 4) == 0) { PrintAndLogEx(SUCCESS, "NXP MF1ICS5005"); @@ -9627,6 +9627,8 @@ static int CmdHF14AMfInfo(const char *Cmd) { PrintAndLogEx(SUCCESS, "NXP MF1ICS5007"); } else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\xc0", 4) == 0) { PrintAndLogEx(SUCCESS, "NXP MF1ICS5035"); + } else { + PrintAndLogEx(SUCCESS, "unknown"); } if (e_sector[1].foundKey[MF_KEY_A] && (e_sector[1].Key[MF_KEY_A] == 0x2A2C13CC242A)) { @@ -9656,8 +9658,8 @@ static int CmdHF14AMfInfo(const char *Cmd) { PrintAndLogEx(SUCCESS, "Static nonce......... " _YELLOW_("yes")); } - if (res == NONCE_FAIL && verbose) { - PrintAndLogEx(SUCCESS, "Static nonce......... " _RED_("read failed")); + if (res == NONCE_FAIL) { + PrintAndLogEx(SUCCESS, "nonce................ " _RED_("read failed")); } if (res == NONCE_NORMAL) {