]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhf.c
Legic: rewrite reader to use xcorrelation and precise timing (#654)
[proxmark3-svn] / client / cmdhf.c
index 82313ae0cae0da63341566c68055f117426f02c5..93906a7d472bbf114f92a19e5b5bf962fe4323a4 100644 (file)
@@ -9,18 +9,18 @@
 // High frequency commands
 //-----------------------------------------------------------------------------
 
 // High frequency commands
 //-----------------------------------------------------------------------------
 
+#include "cmdhf.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include "proxmark3.h"
+#include "comms.h"
 #include "util.h"
 #include "util.h"
-#include "data.h"
 #include "ui.h"
 #include "iso14443crc.h"
 #include "parity.h"
 #include "cmdmain.h"
 #include "cmdparser.h"
 #include "ui.h"
 #include "iso14443crc.h"
 #include "parity.h"
 #include "cmdmain.h"
 #include "cmdparser.h"
-#include "cmdhf.h"
 #include "cmdhf14a.h"
 #include "cmdhf14b.h"
 #include "cmdhf15.h"
 #include "cmdhf14a.h"
 #include "cmdhf14b.h"
 #include "cmdhf15.h"
@@ -361,7 +361,7 @@ int CmdHFList(const char *Cmd)
        char param2 = '\0';
        char param3 = '\0';
        char type[40] = {0};
        char param2 = '\0';
        char param3 = '\0';
        char type[40] = {0};
-       char filename[FILE_PATH_SIZE];
+       char filename[FILE_PATH_SIZE] = {0};
        uint8_t protocol = 0;
        
        // parse command line
        uint8_t protocol = 0;
        
        // parse command line
@@ -497,8 +497,7 @@ int CmdHFList(const char *Cmd)
                trace = malloc(USB_CMD_DATA_SIZE);
                // Query for the size of the trace
                UsbCommand response;
                trace = malloc(USB_CMD_DATA_SIZE);
                // Query for the size of the trace
                UsbCommand response;
-               GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0);
-               WaitForResponse(CMD_ACK, &response);
+               GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0, &response, -1, false);
                traceLen = response.arg[2];
                if (traceLen > USB_CMD_DATA_SIZE) {
                        uint8_t *p = realloc(trace, traceLen);
                traceLen = response.arg[2];
                if (traceLen > USB_CMD_DATA_SIZE) {
                        uint8_t *p = realloc(trace, traceLen);
@@ -508,8 +507,7 @@ int CmdHFList(const char *Cmd)
                                return 2;
                        }
                        trace = p;
                                return 2;
                        }
                        trace = p;
-                       GetFromBigBuf(trace, traceLen, 0);
-                       WaitForResponse(CMD_ACK, NULL);
+                       GetFromBigBuf(trace, traceLen, 0, NULL, -1, false);
                }
        }
 
                }
        }
 
Impressum, Datenschutz