From e94ceecb790bc1de3ceafe1ed55453e7ad9527bc Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 6 Dec 2017 21:53:11 +0100 Subject: [PATCH] chg: 'hf mf mifare' - my darkside attack has been buggy last months. This reverts back to offical pm3. --- armsrc/iso14443a.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 572e70924..1e12b3f3a 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1832,7 +1832,6 @@ static int GetATQA(uint8_t *resp, uint8_t *resp_par) { return len; } - // performs iso14443a anticollision (optional) and card select procedure // fills the uid and cuid pointer unless NULL // fills the card info record unless NULL @@ -2427,7 +2426,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype ) { } // we didn't calibrate our clock yet, // iceman: has to be calibrated every time. - if (previous_nt && !nt_attacked) { + if (first_try && previous_nt && !nt_attacked) { int nt_distance = dist_nt(previous_nt, nt); @@ -2500,7 +2499,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype ) { if (received_nack) { catch_up_cycles = 8; // the PRNG is delayed by 8 cycles due to the NAC (4Bits = 0x05 encrypted) transfer - if (nt_diff == 0) + if (nt_diff == 0 && first_try) par_low = par[0] & 0xE0; // there is no need to check all parities for other nt_diff. Parity Bits for mf_nr_ar[0..2] won't change par_list[nt_diff] = SwapBits(par[0], 8);