From 58b8330aa13782329f418c3d1e12850556f6bb17 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 9 Nov 2026 14:43:42 +0700 Subject: [PATCH] trace extract: check the DESFire ISO/AES reply length before skipping it Same order as the native branch. No change in output, the reply is a tag frame the next pass ignores anyway. Co-Authored-By: Claude Opus 5.5 --- client/src/cmdtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index c53461c1f..d2a82ca58 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -475,11 +475,11 @@ static uint16_t extractChallenges(uint16_t tracepos, uint16_t traceLen, uint8_t break; } - tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr); uint8_t cpos = mfdes_chall_pos(next_hdr->frame, long_jmp); if (next_hdr->data_len < cpos + 8 + 2) { break; } + tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr); // wrapped replies end with SW 91 AF before the CRC uint8_t sw_len = (long_jmp == 1) ? 0 : 2; @@ -511,11 +511,11 @@ static uint16_t extractChallenges(uint16_t tracepos, uint16_t traceLen, uint8_t break; } - tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr); uint8_t cpos = mfdes_chall_pos(next_hdr->frame, long_jmp); if (next_hdr->data_len < cpos + 16 + 2) { break; } + tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr); PrintAndLogEx(INFO, "AES 1499999999 %s " NOLF, sprint_hex_inrow(next_hdr->frame + cpos, 16));