fix: 'hf iclass reader' - drop field when finished.

This commit is contained in:
iceman1001 2018-02-08 12:34:13 +01:00
parent b31afcfc31
commit 220614ca10

View file

@ -527,8 +527,10 @@ int HFiClassReader(const char *Cmd, bool loop, bool verbose) {
// no tag found or button pressed
if ( (readStatus == 0 && !loop) || readStatus == 0xFF) {
// abort
if (verbose) PrintAndLog("[-] Quitting...");
return 0;
if (verbose) PrintAndLog("[-] Quitting..."); {
DropField();
return 0;
}
}
if( readStatus & FLAG_ICLASS_READER_CSN){
PrintAndLog("CSN: %s", sprint_hex(data, 8));
@ -546,12 +548,16 @@ int HFiClassReader(const char *Cmd, bool loop, bool verbose) {
PrintAndLog(" : Possible iClass %s", (legacy) ? "(legacy tag)" : "(NOT legacy tag)");
}
if (tagFound && !loop) return 1;
if (tagFound && !loop) {
DropField();
return 1;
}
} else {
if (verbose) PrintAndLog("[!] command execute timeout");
}
if (!loop) break;
}
DropField();
return 0;
}