From 0d3327d2e02754d88b80659d421e39b2f97b5b0b Mon Sep 17 00:00:00 2001 From: Eloff Date: Tue, 10 Sep 2019 22:07:50 +0300 Subject: [PATCH] BugFix: incorrect NTAG/EV1 increment counter value --- Firmware/ChameleonMini/Application/MifareUltralight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ChameleonMini/Application/MifareUltralight.c b/Firmware/ChameleonMini/Application/MifareUltralight.c index cedfd49..ceef287 100644 --- a/Firmware/ChameleonMini/Application/MifareUltralight.c +++ b/Firmware/ChameleonMini/Application/MifareUltralight.c @@ -386,7 +386,7 @@ static uint16_t AppProcess(uint8_t* const Buffer, uint16_t ByteCount) case CMD_INCREMENT_CNT: { uint8_t CounterId = Buffer[1]; - uint32_t Addend = (Buffer[0]) | (Buffer[1] << 8) | ((uint32_t)Buffer[2] << 16); + uint32_t Addend = ((uint32_t)Buffer[2]) | ((uint32_t)Buffer[3] << 8) | ((uint32_t)Buffer[4] << 16); uint32_t Counter = 0; /* Validation */ if (CounterId > CNT_MAX) {