]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: Added the autodetection of Topaz to "HF SEARCH"
authoriceman1001 <iceman@iuse.se>
Sun, 6 Mar 2016 11:40:04 +0000 (12:40 +0100)
committericeman1001 <iceman@iuse.se>
Sun, 6 Mar 2016 11:40:04 +0000 (12:40 +0100)
FIX:  Fixed a minor bug in "HF SEARCH" where it always found a "14b" tag, making the command never test for other formats afterward the 14b test.
The 14b detection is not good still, conflicting return values is main reason for this bug

client/cmdhf.c
client/cmdhf14b.c
client/cmdhftopaz.c

index 969510df264d9244a3ff9ac1176fd2312d202270..0b4aa3794835516c632dad558a5b6c7d7f5ace42 100644 (file)
@@ -750,6 +750,11 @@ int CmdHFSearch(const char *Cmd){
                PrintAndLog("\nValid ISO15693 Tag Found - Quiting Search\n");
                return ans;
        }
+       ans = CmdHFTopazReader("");
+       if (ans == 0) {
+               PrintAndLog("\nValid Topaz Tag Found - Quiting Search\n");
+               return 1;
+       }
        PrintAndLog("\nno known/supported 13.56 MHz tags found\n");
        return 0;
 }
index fbe4d2e696bcc924fde6f2b3ceabddd22780a765..6ad2702dd1de3c51f166c0521f8125b0585d4ace 100644 (file)
@@ -73,16 +73,19 @@ int CmdSrix4kRead(const char *Cmd) {
        return 0;
 }
 
-int rawClose(void){
+static int rawCloseEx(bool silent){
        UsbCommand resp;
        UsbCommand c = {CMD_ISO_14443B_COMMAND, {0, 0, 0}};
        clearCommandBuffer();
        SendCommand(&c);
        if (!WaitForResponseTimeout(CMD_ACK,&resp,1000)) {
-               PrintAndLog("Command time-out");
-               return 1;
+               if ( !silent ) PrintAndLog("Command time-out");
+               return 0;
        }
-       return 0;
+       return 1;
+}
+static int rawClose() {
+       return rawCloseEx(false);
 }
 
 int HF14BCmdRaw(bool reply, bool *crc, bool power, uint8_t *data, uint8_t *datalen, bool verbose){
index 462cbec51583ce6942fc8734b94e4ec10bc75fbf..b4e47482da627dc6a110c97171afc9287c8a191d 100644 (file)
@@ -306,6 +306,7 @@ int CmdHFTopazReader(const char *Cmd) {
                        topaz_tag.uid[2], 
                        topaz_tag.uid[1], 
                        topaz_tag.uid[0]);
+                       
        PrintAndLog("       UID[6] (Manufacturer Byte) = %02x, Manufacturer: %s", 
                        topaz_tag.uid[6], 
                        getTagInfo(topaz_tag.uid[6]));
Impressum, Datenschutz