fix lf search when running it without any tag on it. In short hitag get uid loop on device side just sits an waits
This commit is contained in:
1 parent
96a68a1ddc
commit
392c251c81
2 files changed
+10
-3
No files matched your search
+1
-1
@@ -1665,7 +1665,7 @@ int CmdLFfind(const char *Cmd) {
|
||||
if (is_online) {
|
||||
|
||||
if (IfPm3Hitag()) {
|
||||
if (readHitagUid()) {
|
||||
if (readHitagUid() == PM3_SUCCESS) {
|
||||
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("Hitag") " found!");
|
||||
if (search_cont) {
|
||||
found++;
|
||||
|
||||
@@ -447,7 +447,6 @@ static bool getHitag2Uid(uint32_t *uid) {
|
||||
if (uid) {
|
||||
*uid = bytes_to_num(resp.data.asBytes, HITAG_UID_SIZE);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -645,6 +644,7 @@ static int CmdLFHitagReader(const char *Cmd) {
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000) == false) {
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
if (resp.oldarg[0] == false) {
|
||||
@@ -1343,6 +1343,13 @@ int CmdLFHitag(const char *Cmd) {
|
||||
}
|
||||
|
||||
int readHitagUid(void) {
|
||||
return (CmdLFHitagReader("--ht2 --pwd") == PM3_SUCCESS);
|
||||
uint32_t uid = 0;
|
||||
if (getHitag2Uid(&uid) == false) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "UID.... " _GREEN_("%08X"), uid);
|
||||
PrintAndLogEx(SUCCESS, "TYPE... " _GREEN_("%s"), getHitagTypeStr(uid));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user