From 3a9087d2a13002cb805c081a82ad61f9d24b65ef Mon Sep 17 00:00:00 2001 From: mwalker33 Date: Sun, 22 Sep 2019 15:27:00 +1000 Subject: [PATCH] Update cmdlfem4x.c em 4x05_dump did not output data --- client/cmdlfem4x.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index e7b1c2b06..80a10e06e 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -1213,19 +1213,27 @@ static int CmdEM4x05Dump(const char *Cmd) { usePwd = true; int success = PM3_SUCCESS; + int status; uint32_t word = 0; - PrintAndLogEx(NORMAL, "Addr | data | ascii"); - PrintAndLogEx(NORMAL, "-----+--------+------"); + PrintAndLogEx(NORMAL, "Addr | data | info"); + PrintAndLogEx(NORMAL, "-----+----------+-------"); for (; addr < 16; addr++) { if (addr == 2) { if (usePwd) { - PrintAndLogEx(NORMAL, " %02u | %08X", addr, pwd, word); + PrintAndLogEx(NORMAL, " %02u | %08X |", addr, pwd, word); } else { - PrintAndLogEx(NORMAL, " 02 | " _RED_("cannot read")); + PrintAndLogEx(NORMAL, " 02 | | " _RED_("cannot read")); } } else { - success &= EM4x05ReadWord_ext(addr, pwd, usePwd, &word); + // success &= EM4x05ReadWord_ext(addr, pwd, usePwd, &word); + status = EM4x05ReadWord_ext(addr, pwd, usePwd, &word); // Get status for single read + success &= status; // Update status to match previous return + + if (status == PM3_SUCCESS) + PrintAndLogEx(NORMAL, " %02d | %08X | %s", addr, word, (addr > 13) ? "Lock" : ""); + else + PrintAndLogEx(NORMAL, " %02d | " _RED_("Fail"), addr); } }