From f885a22d5975d743c210483830475cabec890b8e Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 9 Nov 2026 14:23:25 +0700 Subject: [PATCH] trace extract: print the full AES auth challenges The MFDES AES auth branch printed 8 of the 16 RndB bytes and 16 of the 32 reader bytes, and accepted a 9 byte tag reply. Co-Authored-By: Claude Opus 5.5 --- client/src/cmdtrace.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index 7395feae1..b90291544 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -493,19 +493,20 @@ static uint16_t extractChallenges(uint16_t tracepos, uint16_t traceLen, uint8_t } tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr); - if (next_hdr->data_len < 9) { + // PCB + 16 byte RndB + CRC + if (next_hdr->data_len < 19) { break; } - PrintAndLogEx(INFO, "AES 1499999999 %s " NOLF, sprint_hex_inrow(next_hdr->frame + 1, 8)); + PrintAndLogEx(INFO, "AES 1499999999 %s " NOLF, sprint_hex_inrow(next_hdr->frame + 1, 16)); next_hdr = get_record(tracepos, traceLen, trace); if (next_hdr != NULL) { tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr); } - if ((next_hdr != NULL) && (next_hdr->data_len >= pos + long_jmp + 16) && (next_hdr->frame[pos] == MFDES_ADDITIONAL_FRAME)) { - PrintAndLogEx(NORMAL, "%s", sprint_hex_inrow(next_hdr->frame + pos + long_jmp, 16)); + if ((next_hdr != NULL) && (next_hdr->data_len >= pos + long_jmp + 32) && (next_hdr->frame[pos] == MFDES_ADDITIONAL_FRAME)) { + PrintAndLogEx(NORMAL, "%s", sprint_hex_inrow(next_hdr->frame + pos + long_jmp, 32)); } else { PrintAndLogEx(NORMAL, ""); }