mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-10 17:49:32 +08:00
fix: mfDarkside hangs
This commit is contained in:
parent
5e9533a792
commit
740ab6bb33
2 changed files with 4 additions and 4 deletions
|
@ -3433,8 +3433,8 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
|
||||||
|
|
||||||
sync_cycles = (sync_cycles - nt_distance) / elapsed_prng_sequences;
|
sync_cycles = (sync_cycles - nt_distance) / elapsed_prng_sequences;
|
||||||
|
|
||||||
// no negative sync_cycles
|
// no negative sync_cycles, and too small sync_cycles will result in continuous misses
|
||||||
if (sync_cycles <= 0) sync_cycles += PRNG_SEQUENCE_LENGTH;
|
if (sync_cycles <= 10) sync_cycles += PRNG_SEQUENCE_LENGTH;
|
||||||
|
|
||||||
// reset sync_cycles
|
// reset sync_cycles
|
||||||
if (sync_cycles > PRNG_SEQUENCE_LENGTH * 2) {
|
if (sync_cycles > PRNG_SEQUENCE_LENGTH * 2) {
|
||||||
|
@ -3445,11 +3445,9 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
|
||||||
if (g_dbglevel >= DBG_EXTENDED)
|
if (g_dbglevel >= DBG_EXTENDED)
|
||||||
Dbprintf("calibrating in cycle %d. nt_distance=%d, elapsed_prng_sequences=%d, new sync_cycles: %d\n", i, nt_distance, elapsed_prng_sequences, sync_cycles);
|
Dbprintf("calibrating in cycle %d. nt_distance=%d, elapsed_prng_sequences=%d, new sync_cycles: %d\n", i, nt_distance, elapsed_prng_sequences, sync_cycles);
|
||||||
|
|
||||||
LED_B_OFF();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LED_B_OFF();
|
|
||||||
|
|
||||||
if ((nt != nt_attacked) && nt_attacked) { // we somehow lost sync. Try to catch up again...
|
if ((nt != nt_attacked) && nt_attacked) { // we somehow lost sync. Try to catch up again...
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ int mfDarkside(uint8_t blockno, uint8_t key_type, uint64_t *key) {
|
||||||
while (true) {
|
while (true) {
|
||||||
PrintAndLogEx(NORMAL, "." NOLF);
|
PrintAndLogEx(NORMAL, "." NOLF);
|
||||||
|
|
||||||
|
if (IsCommunicationThreadDead()) return PM3_EIO;
|
||||||
|
|
||||||
//TODO: Not really stopping the command in time.
|
//TODO: Not really stopping the command in time.
|
||||||
if (kbd_enter_pressed()) {
|
if (kbd_enter_pressed()) {
|
||||||
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
|
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
|
||||||
|
|
Loading…
Reference in a new issue