From 70f11c40979883f0079f16c5ed1989f8252ec2f4 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 7 Oct 2020 13:01:24 +0200 Subject: [PATCH] em4x05 dump text --- client/src/cmdlfem4x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/cmdlfem4x.c b/client/src/cmdlfem4x.c index 272a53b97..9d8d87491 100644 --- a/client/src/cmdlfem4x.c +++ b/client/src/cmdlfem4x.c @@ -976,10 +976,10 @@ static int CmdEM4x05Dump(const char *Cmd) { if (usePwd) { data[addr] = BSWAP_32(pwd); num_to_bytes(pwd, 4, bytes); - PrintAndLogEx(NORMAL, " %02u | %08X | %s | %c | password", addr, pwd, sprint_ascii(bytes, 4), ((lock_bits >> addr) & 1) ? 'x' : ' '); + PrintAndLogEx(NORMAL, " %02u | %08X | %s | %s | Password", addr, pwd, sprint_ascii(bytes, 4), ((lock_bits >> addr) & 1) ? _RED_("x") : " "); } else { data[addr] = 0x00; // Unknown password, but not used to set to zeros - PrintAndLogEx(NORMAL, " 02 | | | | " _RED_("cannot read")); + PrintAndLogEx(NORMAL, " 02 | | | | %-10s " _RED_("cannot read"), "Password"); } } else { // success &= EM4x05ReadWord_ext(addr, pwd, usePwd, &word); @@ -987,11 +987,12 @@ static int CmdEM4x05Dump(const char *Cmd) { if (status != PM3_SUCCESS) success = PM3_ESOFT; // If any error ensure fail is set so not to save invalid data data[addr] = BSWAP_32(word); + const char *info[] = {"Info/User", "UID", "", "User", "Config", "User", "User", "User", "User", "User", "User", "User", "User", "User", "User"}; if (status == PM3_SUCCESS) { num_to_bytes(word, 4, bytes); - PrintAndLogEx(NORMAL, " %02d | %08X | %s | %c |", addr, word, sprint_ascii(bytes, 4), ((lock_bits >> addr) & 1) ? 'x' : ' '); + PrintAndLogEx(NORMAL, " %02d | %08X | %s | %s | %s", addr, word, sprint_ascii(bytes, 4), ((lock_bits >> addr) & 1) ? _RED_("x") : " ", info[addr]); } else - PrintAndLogEx(NORMAL, " %02d | | | | " _RED_("Fail"), addr); + PrintAndLogEx(NORMAL, " %02d | | | | %-10s " _RED_("cannot read"), addr, info[addr]); } } // Print blocks 14 and 15