Change lf search to also run chipset detection if the colleced signal data was just noise

This commit is contained in:
iceman1001 committed 2025-09-02 19:41:04 +02:00
1 parent 7c4cfe889c
commit 0929a14b5d
2 files changed
+16 -9

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased] ## [unreleased][unreleased]
- Change `lf search` - also test for chipset even if there was just signal noice (@iceman1001)
- Added detection of PCF 7961 , thanks progman (@iceman1001) - Added detection of PCF 7961 , thanks progman (@iceman1001)
- Change `reveng -g` - now correctly take 1024 hexstring as input (@iceman1001) - Change `reveng -g` - now correctly take 1024 hexstring as input (@iceman1001)
- Added `--override` parameter to NDEF read for overriding MAD CRC check (@iceman1001) - Added `--override` parameter to NDEF read for overriding MAD CRC check (@iceman1001)
+15 -9
View File
@@ -1572,18 +1572,18 @@ static bool check_chiptype(bool getDeviceData) {
saveState_db.clock = g_DemodClock; saveState_db.clock = g_DemodClock;
saveState_db.offset = g_DemodStartIdx; saveState_db.offset = g_DemodStartIdx;
//check for em4x05/em4x69 chips first // check for em4x05/em4x69 chips first
uint32_t word = 0; uint32_t word = 0;
if (IfPm3EM4x50() && em4x05_isblock0(&word)) { if (IfPm3EM4x50() && em4x05_isblock0(&word)) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("EM4x05 / EM4x69")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("EM4x05 / EM4x69"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf em 4x05") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf em 4x05") "` commands");
retval = true; retval = true;
goto out; goto out;
} }
//check for t55xx chip... // check for t55xx chip...
if (tryDetectP1(true)) { if (tryDetectP1(true)) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("T55xx")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("T55xx"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf t55xx") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf t55xx") "` commands");
retval = true; retval = true;
goto out; goto out;
@@ -1594,7 +1594,7 @@ static bool check_chiptype(bool getDeviceData) {
// Hitag 2 // Hitag 2
if (ht2_read_uid() == PM3_SUCCESS) { if (ht2_read_uid() == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("Hitag 2")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("Hitag 2"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf hitag") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf hitag") "` commands");
retval = true; retval = true;
goto out; goto out;
@@ -1602,7 +1602,7 @@ static bool check_chiptype(bool getDeviceData) {
// Hitag S // Hitag S
if (read_hts_uid() == PM3_SUCCESS) { if (read_hts_uid() == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("Hitag 1/S / 82xx")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("Hitag 1/S / 82xx"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf hitag hts") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf hitag hts") "` commands");
retval = true; retval = true;
goto out; goto out;
@@ -1610,7 +1610,7 @@ static bool check_chiptype(bool getDeviceData) {
// Hitag µ // Hitag µ
if (read_htu_uid() == PM3_SUCCESS) { if (read_htu_uid() == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("Hitag µ / 8265")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("Hitag µ / 8265"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf hitag htu") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf hitag htu") "` commands");
retval = true; retval = true;
goto out; goto out;
@@ -1621,7 +1621,7 @@ static bool check_chiptype(bool getDeviceData) {
#if !defined ICOPYX #if !defined ICOPYX
// check for em4x50 chips // check for em4x50 chips
if (IfPm3EM4x50() && detect_4x50_block()) { if (IfPm3EM4x50() && detect_4x50_block()) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("EM4x50")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("EM4x50"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf em 4x50") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf em 4x50") "` commands");
retval = true; retval = true;
goto out; goto out;
@@ -1629,7 +1629,7 @@ static bool check_chiptype(bool getDeviceData) {
// check for em4x70 chips // check for em4x70 chips
if (IfPm3EM4x70() && detect_4x70_block()) { if (IfPm3EM4x70() && detect_4x70_block()) {
PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("EM4x70")); PrintAndLogEx(SUCCESS, "Chipset... " _GREEN_("EM4x70"));
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf em 4x70") "` commands"); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("lf em 4x70") "` commands");
retval = true; retval = true;
goto out; goto out;
@@ -1787,6 +1787,12 @@ int CmdLFfind(const char *Cmd) {
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(FAILED, _RED_("No data found!")); PrintAndLogEx(FAILED, _RED_("No data found!"));
// identify chipset
if (check_chiptype(is_online) == false) {
PrintAndLogEx(DEBUG, "Automatic chip type detection " _RED_("failed"));
}
PrintAndLogEx(HINT, "Hint: Maybe not an LF tag?"); PrintAndLogEx(HINT, "Hint: Maybe not an LF tag?");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
if (search_cont == 0) { if (search_cont == 0) {