From 11e097c1bb66e8322dfc042d9d96a63af66f821f Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 7 Jul 2022 23:43:45 +0200 Subject: [PATCH] fixing hf search loop and lessing the debug statements --- armsrc/iso14443b.c | 8 ++++++-- client/src/cmdhfxerox.c | 13 ++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/armsrc/iso14443b.c b/armsrc/iso14443b.c index 0372189a5..760736a5a 100644 --- a/armsrc/iso14443b.c +++ b/armsrc/iso14443b.c @@ -1865,14 +1865,18 @@ int iso14443b_select_xrx_card(iso14b_card_select_t *card) { if (4 == slot) { FpgaDisableTracing(); - DbpString("no answer to anticollision"); + if (g_dbglevel >= DBG_DEBUG) { + DbpString("no answer to anticollision"); + } return 1; } } retlen = Get14443bAnswerFromTag(x_atqb, sizeof(x_atqb), iso14b_timeout, &eof_time); - Dbprintf("anticollision uid %llx", uid); + if (g_dbglevel >= DBG_DEBUG) { + Dbprintf("anticollision uid %llx", uid); + } // ATQB too short? if (retlen < 18) { diff --git a/client/src/cmdhfxerox.c b/client/src/cmdhfxerox.c index 5f9fde1e8..5b7f39abe 100644 --- a/client/src/cmdhfxerox.c +++ b/client/src/cmdhfxerox.c @@ -447,13 +447,16 @@ int read_xerox_uid(bool loop, bool verbose) { if (status != PM3_SUCCESS) { continue; } - } + } else { - if (loop == false) { - PrintAndLogEx(NORMAL, ""); + if (status == PM3_SUCCESS) { + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(SUCCESS, " UID : %s", sprint_hex(card.uid, card.uidlen)); + PrintAndLogEx(SUCCESS, " ATQB : %s", sprint_hex(card.atqb, sizeof(card.atqb))); + } else { + return PM3_ESOFT; + } } - PrintAndLogEx(SUCCESS, " UID : %s", sprint_hex(card.uid, card.uidlen)); - PrintAndLogEx(SUCCESS, " ATQB : %s", sprint_hex(card.atqb, sizeof(card.atqb))); } while (loop && kbd_enter_pressed() == false);