From 0ef374e06fb0b0b1922f507f88d17ba70b9be782 Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Sat, 21 Sep 2024 16:47:05 +0800 Subject: [PATCH] fix: `lf search` hangs --- armsrc/hitag2.c | 5 +++-- client/src/cmdlf.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index 62bef7826..ef72747fb 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -1953,9 +1953,10 @@ void ReaderHitag(const lf_hitag_data_t *payload, bool ledcontrol) { memset(rx, 0x00, sizeof(rx)); rxlen = 0; - // If there is no response, just repeat the loop + // If there is no response if (detected_tag_modulation == false) { - continue; + checked = -1; + goto out; } // Make sure we always have an even number of samples. This fixes the problem diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index 84550729f..59998bc92 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -1569,7 +1569,7 @@ static bool check_chiptype(bool getDeviceData) { //check for em4x05/em4x69 chips first uint32_t word = 0; - if (em4x05_isblock0(&word)) { + if (IfPm3EM4x50() && em4x05_isblock0(&word)) { PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("EM4x05 / EM4x69")); PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf em 4x05`") " commands"); retval = true;