Skip to content

Commit 0c061d9

Browse files
authored
Fix data being xored twice
When printing the BCD encoded Card ID, data is being XOR'd twice: once with a for-loop, and a second time for printing, cancelling the operation and displaying garbage Signed-off-by: Jean-Michel Picod <[email protected]>
1 parent 45fe423 commit 0c061d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/src/cmdhflegic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ static int decode_and_print_memory(uint16_t card_size, const uint8_t *input_buff
300300
// does this one work? (Answer: Only if KGH/BGH is used with BCD encoded card number! So maybe this will show just garbage...)
301301
if (wrp_len == 8) {
302302
PrintAndLogEx(SUCCESS, "Card ID: " _YELLOW_("%2X%02X%02X"),
303-
data[i - 4] ^ crc,
304-
data[i - 3] ^ crc,
305-
data[i - 2] ^ crc
303+
data[i - 4],
304+
data[i - 3],
305+
data[i - 2]
306306
);
307307
}
308308
}

0 commit comments

Comments
 (0)