mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
chg 'hf iclass list' - fix parity checks
This commit is contained in:
parent
341703d9a7
commit
387dd82895
2 changed files with 13 additions and 5 deletions
|
@ -329,10 +329,6 @@ void annotateIclass(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
||||||
parity ^= (cmd[0] >> i) & 1;
|
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) {
|
switch (c) {
|
||||||
case ICLASS_CMD_HALT:
|
case ICLASS_CMD_HALT:
|
||||||
snprintf(exp, size, "HALT");
|
snprintf(exp, size, "HALT");
|
||||||
|
|
|
@ -294,6 +294,8 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
uint8_t parityBits = parityBytes[j >> 3];
|
uint8_t parityBits = parityBytes[j >> 3];
|
||||||
if (protocol != LEGIC
|
if (protocol != LEGIC
|
||||||
&& protocol != ISO_14443B
|
&& protocol != ISO_14443B
|
||||||
|
&& protocol != ISO_15693
|
||||||
|
&& protocol != ICLASS
|
||||||
&& protocol != ISO_7816_4
|
&& protocol != ISO_7816_4
|
||||||
&& protocol != PROTO_HITAG
|
&& protocol != PROTO_HITAG
|
||||||
&& protocol != THINFILM
|
&& protocol != THINFILM
|
||||||
|
@ -301,6 +303,16 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
&& (oddparity8(frame[j]) != ((parityBits >> (7 - (j & 0x0007))) & 0x01))) {
|
&& (oddparity8(frame[j]) != ((parityBits >> (7 - (j & 0x0007))) & 0x01))) {
|
||||||
|
|
||||||
snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x! ", frame[j]);
|
snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x! ", frame[j]);
|
||||||
|
} 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 {
|
} else {
|
||||||
snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x ", frame[j]);
|
snprintf(line[j / 18] + ((j % 18) * 4), 110, "%02x ", frame[j]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue