From 0c061d9cdef1171fd84f99f45f471f47ad3faba5 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Sat, 20 Sep 2025 23:21:31 +0200 Subject: [PATCH] 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 --- client/src/cmdhflegic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhflegic.c b/client/src/cmdhflegic.c index f47466761..aafe08c2f 100644 --- a/client/src/cmdhflegic.c +++ b/client/src/cmdhflegic.c @@ -300,9 +300,9 @@ static int decode_and_print_memory(uint16_t card_size, const uint8_t *input_buff // does this one work? (Answer: Only if KGH/BGH is used with BCD encoded card number! So maybe this will show just garbage...) if (wrp_len == 8) { PrintAndLogEx(SUCCESS, "Card ID: " _YELLOW_("%2X%02X%02X"), - data[i - 4] ^ crc, - data[i - 3] ^ crc, - data[i - 2] ^ crc + data[i - 4], + data[i - 3], + data[i - 2] ); } }