From ff387762b488b1e61b386739d9dd6fbc9da8aab6 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 4 Sep 2026 10:16:34 +0200 Subject: [PATCH 1/2] text --- client/src/cmdhflist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhflist.c b/client/src/cmdhflist.c index 74461eecb..f2019fbc0 100644 --- a/client/src/cmdhflist.c +++ b/client/src/cmdhflist.c @@ -410,7 +410,7 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i break; case MIFARE_ULEV1_AUTH: if (cmdsize == 7) - snprintf(exp, size, "PWD-AUTH: " _GREEN_("0x%02X%02X%02X%02X"), cmd[1], cmd[2], cmd[3], cmd[4]); + snprintf(exp, size, "PWD-AUTH: " _GREEN_("%02X%02X%02X%02X"), cmd[1], cmd[2], cmd[3], cmd[4]); else snprintf(exp, size, "PWD-AUTH"); break; From d85550c6de737d189bea56f771bd6ab3baa0f8d8 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 4 Sep 2026 10:18:08 +0200 Subject: [PATCH 2/2] text --- client/src/cmdlfhitag.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/client/src/cmdlfhitag.c b/client/src/cmdlfhitag.c index 4a9e567cf..141676fa2 100644 --- a/client/src/cmdlfhitag.c +++ b/client/src/cmdlfhitag.c @@ -713,17 +713,17 @@ void annotateHitag2(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize, uint8_t page = hitag2_get_page(binstr); if (memcmp(binstr, HITAG2_BINSTR_READ_PAGE, 2) == 0) { - snprintf(exp, size, "READ PAGE (" _MAGENTA_("%u") ")", page); + snprintf(exp, size, "READ PAGE " _WHITE_("(") _MAGENTA_("%u") ")", page); break; } if (memcmp(binstr, HITAG2_BINSTR_READ_PAGE_INVERTED, 2) == 0) { - snprintf(exp, size, "READ PAGE INV (" _MAGENTA_("%u") ")", page); + snprintf(exp, size, "READ PAGE INV " _WHITE_("(") _MAGENTA_("%u") ")", page); break; } if (memcmp(binstr, HITAG2_BINSTR_WRITE_PAGE, 2) == 0) { - snprintf(exp, size, "WRITE PAGE (" _MAGENTA_("%u") ")", page); + snprintf(exp, size, "WRITE PAGE " _WHITE_("(") _MAGENTA_("%u") ")", page); break; } break; @@ -738,7 +738,7 @@ void annotateHitag2(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize, rev_msb_array(uid, 4); _ht2state.uid = MemLeToUint4byte(uid); } else { - snprintf(exp, size, "PWD: " _GREEN_("0x%02X%02X%02X%02X"), cmd[0], cmd[1], cmd[2], cmd[3]); + snprintf(exp, size, "PWD " _GREEN_("%02X%02X%02X%02X"), cmd[0], cmd[1], cmd[2], cmd[3]); _ht2state.state = STATE_AUTH; } break; @@ -764,9 +764,10 @@ void annotateHitag2(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize, case 64: { // crypto handshake if (_ht2state.state == STATE_START_AUTH) { + _ht2state.state = STATE_START_ENCRYPTED; - // need to be called with filename... + // dictionary attack if (ht2_check_cryptokeys(keys, keycount, cmd)) { _ht2state.cipher_state = ht2_hitag2_init( @@ -778,13 +779,13 @@ void annotateHitag2(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize, uint64_t key = REV64(_ht2state.key); key = BSWAP_48(key); - snprintf(exp, size, "Nr Ar " _WHITE_("( ") _GREEN_("%012" PRIx64) " )", key); + snprintf(exp, size, "NrAr " _WHITE_("( ") _GREEN_("%012" PRIx64) " )", key); } else { - snprintf(exp, size, "AUTH: Nr Ar"); + snprintf(exp, size, "AUTH NrAr"); } } else { - snprintf(exp, size, "AUTH: Nr Ar"); + snprintf(exp, size, "NrAr decrypted"); } break; } @@ -2213,7 +2214,8 @@ static int CmdLFHitag2Lookup(const char *Cmd) { static int CmdLFHitag2Crack2(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "lf hitag crack2", - "This command tries to recover 2048 bits of Hitag 2 crypto stream data.\n", + "This command tries to recover 2048 bits of Hitag 2 crypto stream data from card.\n" + "Put card on pm3 before running this command\n", "lf hitag crack2 --nrar 73AA5A62EAB8529C" ); @@ -2251,9 +2253,6 @@ static int CmdLFHitag2Crack2(const char *Cmd) { uint8_t attempt = 50; do { -// PrintAndLogEx(INPLACE, "Attack 2 running..."); -// fflush(stdout); - if (WaitForResponseTimeout(CMD_LF_HITAG2_CRACK_2, &resp, 1000) == false) { attempt--; continue;