diff --git a/client/cmdhflist.c b/client/cmdhflist.c index d0fcea8f5..d44ac635c 100644 --- a/client/cmdhflist.c +++ b/client/cmdhflist.c @@ -329,10 +329,6 @@ void annotateIclass(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) { parity ^= (cmd[0] >> i) & 1; } - if ( parity == ((cmd[0] >> 7) & 1) ) { - printf("Calc %d, cmd %02x, Par %d \n", parity, cmd[0], (cmd[0] >> 7) & 1); - } - switch (c) { case ICLASS_CMD_HALT: snprintf(exp, size, "HALT"); diff --git a/client/cmdtrace.c b/client/cmdtrace.c index ecb3fc158..401dac66e 100644 --- a/client/cmdtrace.c +++ b/client/cmdtrace.c @@ -294,6 +294,8 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr uint8_t parityBits = parityBytes[j >> 3]; if (protocol != LEGIC && protocol != ISO_14443B + && protocol != ISO_15693 + && protocol != ICLASS && protocol != ISO_7816_4 && protocol != PROTO_HITAG && protocol != THINFILM @@ -301,7 +303,17 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr && (oddparity8(frame[j]) != ((parityBits >> (7 - (j & 0x0007))) & 0x01))) { snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x! ", frame[j]); - } else { + } else if ( protocol == ICLASS && isResponse == true) { + uint8_t parity = 0; + for (int i=0; i<6; i++) { + parity ^= ((frame[0] >> i) & 1); + } + if ( parity == ((frame[0] >> 7) & 1)) { + snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x ", frame[j]); + } else { + snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x! ", frame[j]); + } + } else { snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x ", frame[j]); }