diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 0b4321d79..ab1fc57c9 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -839,7 +839,7 @@ void RAMFUNC SniffIso14443a(uint8_t param) { // Setup and start DMA. if (FpgaSetupSscDma((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) { - if (g_dbglevel > 1) Dbprintf("FpgaSetupSscDma failed. Exiting"); + if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscDma failed. Exiting"); return; } @@ -2803,11 +2803,11 @@ uint16_t ReaderReceive(uint8_t *receivedAnswer, uint16_t answer_maxlen, uint8_t if (GetIso14443aAnswerFromTag(receivedAnswer, answer_maxlen, par, 0) == false) { return 0; } + LogTrace(receivedAnswer, Demod.len, Demod.startTime * 16 - DELAY_AIR2ARM_AS_READER, Demod.endTime * 16 - DELAY_AIR2ARM_AS_READER, par, false); return Demod.len; } - // This function misstreats the ISO 14443a anticollision procedure. // by fooling the reader there is a collision and forceing the reader to // increase the uid bytes. The might be an overflow, DoS will occur. diff --git a/client/src/wiegand_formats.c b/client/src/wiegand_formats.c index cfe4d4599..d43ab3f40 100644 --- a/client/src/wiegand_formats.c +++ b/client/src/wiegand_formats.c @@ -1688,7 +1688,7 @@ bool HIDTryUnpack(wiegand_message_t *packed) { ); } - if(found_cnt > 0){ + if (found_cnt > 0) { if (packed->Length && ((found_cnt - found_invalid_par) == 0)) { // if length > 0 and no valid parity matches PrintAndLogEx(FAILED, "Parity tests failed"); } @@ -1718,23 +1718,23 @@ bool decode_wiegand(uint32_t top, uint32_t mid, uint32_t bot, int n) { if (n > 0) { wiegand_message_t packed = initialize_message_object(top, mid, bot, n); res = HIDTryUnpack(&packed); - } else if(n < 0) { + } else if (n < 0) { PrintAndLogEx(INFO, "Brute forcing all possible lengths..."); - int scan_end = (-n)*4; - int scan_start = scan_end-3; + int scan_end = (-n) * 4; + int scan_start = scan_end - 3; wiegand_message_t packed = initialize_message_object(top, mid, bot, scan_end); - + // find the first bit set in the first nibble - for(int i = 0; i < 4; i++) { + for (int i = 0; i < 4; i++) { if (get_bit_by_position(&packed, i) == 1) { - scan_start = scan_end-i; + scan_start = scan_end - i; break; } } PrintAndLogEx(INFO, "Scanning from bit %d to %d...", scan_start, scan_end); - for(int i = scan_start; i <= scan_end; i++) { + for (int i = scan_start; i <= scan_end; i++) { packed.Length = i; res |= HIDTryUnpack(&packed); }