Skip to content

Commit cf6ec07

Browse files
committed
style
1 parent 347a4d5 commit cf6ec07

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

armsrc/iso14443a.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ void RAMFUNC SniffIso14443a(uint8_t param) {
839839

840840
// Setup and start DMA.
841841
if (FpgaSetupSscDma((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) {
842-
if (g_dbglevel > 1) Dbprintf("FpgaSetupSscDma failed. Exiting");
842+
if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscDma failed. Exiting");
843843
return;
844844
}
845845

@@ -2803,11 +2803,11 @@ uint16_t ReaderReceive(uint8_t *receivedAnswer, uint16_t answer_maxlen, uint8_t
28032803
if (GetIso14443aAnswerFromTag(receivedAnswer, answer_maxlen, par, 0) == false) {
28042804
return 0;
28052805
}
2806+
28062807
LogTrace(receivedAnswer, Demod.len, Demod.startTime * 16 - DELAY_AIR2ARM_AS_READER, Demod.endTime * 16 - DELAY_AIR2ARM_AS_READER, par, false);
28072808
return Demod.len;
28082809
}
28092810

2810-
28112811
// This function misstreats the ISO 14443a anticollision procedure.
28122812
// by fooling the reader there is a collision and forceing the reader to
28132813
// increase the uid bytes. The might be an overflow, DoS will occur.

client/src/wiegand_formats.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ bool HIDTryUnpack(wiegand_message_t *packed) {
16881688
);
16891689
}
16901690

1691-
if(found_cnt > 0){
1691+
if (found_cnt > 0) {
16921692
if (packed->Length && ((found_cnt - found_invalid_par) == 0)) { // if length > 0 and no valid parity matches
16931693
PrintAndLogEx(FAILED, "Parity tests failed");
16941694
}
@@ -1718,23 +1718,23 @@ bool decode_wiegand(uint32_t top, uint32_t mid, uint32_t bot, int n) {
17181718
if (n > 0) {
17191719
wiegand_message_t packed = initialize_message_object(top, mid, bot, n);
17201720
res = HIDTryUnpack(&packed);
1721-
} else if(n < 0) {
1721+
} else if (n < 0) {
17221722
PrintAndLogEx(INFO, "Brute forcing all possible lengths...");
1723-
int scan_end = (-n)*4;
1724-
int scan_start = scan_end-3;
1723+
int scan_end = (-n) * 4;
1724+
int scan_start = scan_end - 3;
17251725

17261726
wiegand_message_t packed = initialize_message_object(top, mid, bot, scan_end);
1727-
1727+
17281728
// find the first bit set in the first nibble
1729-
for(int i = 0; i < 4; i++) {
1729+
for (int i = 0; i < 4; i++) {
17301730
if (get_bit_by_position(&packed, i) == 1) {
1731-
scan_start = scan_end-i;
1731+
scan_start = scan_end - i;
17321732
break;
17331733
}
17341734
}
17351735

17361736
PrintAndLogEx(INFO, "Scanning from bit %d to %d...", scan_start, scan_end);
1737-
for(int i = scan_start; i <= scan_end; i++) {
1737+
for (int i = scan_start; i <= scan_end; i++) {
17381738
packed.Length = i;
17391739
res |= HIDTryUnpack(&packed);
17401740
}

0 commit comments

Comments
 (0)