From eaf11127be3e1138782a57b924dc5212fb49e38b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 3 Aug 2023 12:55:06 +0200 Subject: [PATCH] since HF SEARCH triggers multiple swaps of FPGA image HF -> HF 15 -> HF FELICA , its better to have relevant checks when the correct fpga image is loaded --- client/src/cmdhf.c | 78 ++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/client/src/cmdhf.c b/client/src/cmdhf.c index b5cff4e19..ef94adf41 100644 --- a/client/src/cmdhf.c +++ b/client/src/cmdhf.c @@ -113,24 +113,6 @@ int CmdHFSearch(const char *Cmd) { } } - PROMPT_CLEARLINE; - PrintAndLogEx(INPLACE, " Searching for ISO15693 tag..."); - if (IfPm3Iso15693()) { - if (readHF15Uid(false, false)) { - PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO 15693 tag") " found\n"); - res = PM3_SUCCESS; - } - } - - PROMPT_CLEARLINE; - PrintAndLogEx(INPLACE, " Searching for iCLASS / PicoPass tag..."); - if (IfPm3Iclass()) { - if (read_iclass_csn(false, false, false) == PM3_SUCCESS) { - PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("iCLASS tag / PicoPass tag") " found\n"); - res = PM3_SUCCESS; - } - } - PROMPT_CLEARLINE; PrintAndLogEx(INPLACE, " Searching for LEGIC tag..."); if (IfPm3Legicrf()) { @@ -149,25 +131,6 @@ int CmdHFSearch(const char *Cmd) { } } - // 14b is the longest test - PROMPT_CLEARLINE; - PrintAndLogEx(INPLACE, " Searching for ISO14443-B tag..."); - if (IfPm3Iso14443b()) { - if (readHF14B(false, false) == PM3_SUCCESS) { - PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO 14443-B tag") " found\n"); - res = PM3_SUCCESS; - } - } - - PROMPT_CLEARLINE; - PrintAndLogEx(INPLACE, " Searching for FeliCa tag..."); - if (IfPm3Felica()) { - if (read_felica_uid(false, false) == PM3_SUCCESS) { - PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO 18092 / FeliCa tag") " found\n"); - res = PM3_SUCCESS; - } - } - // texkom PROMPT_CLEARLINE; PrintAndLogEx(INPLACE, " Searching for TEXKOM tag..."); @@ -186,6 +149,47 @@ int CmdHFSearch(const char *Cmd) { } } + // 14b is the longest test + PROMPT_CLEARLINE; + PrintAndLogEx(INPLACE, " Searching for ISO14443-B tag..."); + if (IfPm3Iso14443b()) { + if (readHF14B(false, false) == PM3_SUCCESS) { + PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO 14443-B tag") " found\n"); + res = PM3_SUCCESS; + } + } + + // OBS! This triggers a swap to FPGA_BITSTREAM_HF_15 == 1.5sec delay + + PROMPT_CLEARLINE; + PrintAndLogEx(INPLACE, " Searching for ISO15693 tag..."); + if (IfPm3Iso15693()) { + if (readHF15Uid(false, false)) { + PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO 15693 tag") " found\n"); + res = PM3_SUCCESS; + } + } + + PROMPT_CLEARLINE; + PrintAndLogEx(INPLACE, " Searching for iCLASS / PicoPass tag..."); + if (IfPm3Iclass()) { + if (read_iclass_csn(false, false, false) == PM3_SUCCESS) { + PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("iCLASS tag / PicoPass tag") " found\n"); + res = PM3_SUCCESS; + } + } + + // OBS! This triggers a swap to FPGA_BITSTREAM_HF_FELICA == 1.5sec delay + + PROMPT_CLEARLINE; + PrintAndLogEx(INPLACE, " Searching for FeliCa tag..."); + if (IfPm3Felica()) { + if (read_felica_uid(false, false) == PM3_SUCCESS) { + PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO 18092 / FeliCa tag") " found\n"); + res = PM3_SUCCESS; + } + } + /* PROMPT_CLEARLINE; PrintAndLogEx(INPLACE, " Searching for CryptoRF tag...");