style
This commit is contained in:
1 parent
347a4d5eff
commit
cf6ec077da
2 files changed
+10
-10
No files matched your search
+2
-2
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user