]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Added offset feature to hexsamples command
authordaniel.boteanu <daniel.boteanu@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 14 Jan 2010 23:11:31 +0000 (23:11 +0000)
committerdaniel.boteanu <daniel.boteanu@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 14 Jan 2010 23:11:31 +0000 (23:11 +0000)
client/command.c

index 5d27870e14d2f1198e841e4877009fe4630a802f..a2c567e6dc1587bdfa9579b277606a355b8236fb 100644 (file)
@@ -853,7 +853,15 @@ static int CmdHisamplest(char *str, int nrlow)
 static void CmdHexsamples(char *str)\r
 {\r
        int i, j, n;\r
-       int requested = strtol(str, NULL, 0);\r
+       int requested = 0;\r
+       int offset = 0;\r
+       sscanf(str, "%i %i", &requested, &offset);\r
+       if (offset % 4!=0) {\r
+               PrintToScrollback("Offset must be a multiple of 4");\r
+               return;\r
+       }\r
+       offset = offset/4;                \r
+\r
        int delivered = 0;\r
 \r
        if (requested == 0) {\r
@@ -863,7 +871,7 @@ static void CmdHexsamples(char *str)
                n = requested/4;\r
        }\r
 \r
-       for(i = 0; i < n; i += 12) {\r
+       for(i = offset; i < n+offset; i += 12) {\r
                UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {i, 0, 0}};\r
                SendCommand(&c);\r
                wait_for_response(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K);\r
@@ -2843,7 +2851,7 @@ static struct {
 /* data transfer functions */\r
 \r
        {"bitsamples",          CmdBitsamples,          0, "Get raw samples as bitstring"},\r
-       {"hexsamples",          CmdHexsamples,          0, "<blocks> -- Dump big buffer as hex bytes"},\r
+       {"hexsamples",          CmdHexsamples,          0, "<blocks> [<offset>] -- Dump big buffer as hex bytes"},\r
        {"higet",                       CmdHi14read_sim,        0, "<samples> -- Get samples HF, 'analog'"},\r
        {"hisamples",           CmdHisamples,           0, "Get raw samples for HF tag"},\r
        {"hisampless",          CmdHisampless,          0, "<samples> -- Get signed raw samples, HF tag"},\r
Impressum, Datenschutz