]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
ADD: marshmellows new lf command and DetectClock. (works great!)
[proxmark3-svn] / client / cmdlft55xx.c
index b4f884febe9e88bb370e07c1215399e911c50e4c..6ea9d2d3a575beff7868050ab5a298284abc01b6 100644 (file)
@@ -46,18 +46,17 @@ int CmdReadBlk(const char *Cmd)
        SendCommand(&c);\r
        WaitForResponse(CMD_ACK, NULL);\r
        \r
-//     uint8_t data[LF_TRACE_BUFF_SIZE] = {0x00};\r
+       uint8_t data[LF_TRACE_BUFF_SIZE] = {0x00};\r
        \r
-       // GetFromBigBuf(data,LF_TRACE_BUFF_SIZE,3560);  //3560 -- should be offset..\r
-       // WaitForResponseTimeout(CMD_ACK,NULL, 1500);\r
-\r
-       // for (int j = 0; j < LF_TRACE_BUFF_SIZE; j++) {\r
-               // GraphBuffer[j] = (int)data[j];\r
-       // }\r
-       // GraphTraceLen = LF_TRACE_BUFF_SIZE;\r
-       CmdSamples("12000");\r
+       GetFromBigBuf(data,LF_TRACE_BUFF_SIZE,3560);  //3560 -- should be offset..\r
+       WaitForResponseTimeout(CMD_ACK,NULL, 1500);\r
+\r
+       for (int j = 0; j < LF_TRACE_BUFF_SIZE; j++) {\r
+               GraphBuffer[j] = (int)data[j];\r
+       }\r
+       GraphTraceLen = LF_TRACE_BUFF_SIZE;\r
        ManchesterDemod(block);\r
-       // RepaintGraphWindow();\r
+       RepaintGraphWindow();\r
   return 0;\r
 }\r
 \r
@@ -316,12 +315,12 @@ int CmdDump(const char *Cmd){
        }\r
        \r
        if ( hasPwd ){\r
-               if (param_gethex(Cmd, 0, pwd, 4)) {\r
-                       PrintAndLog("password must include 4 HEX symbols");\r
+               if (param_gethex(Cmd, 0, pwd, 8)) {\r
+                       PrintAndLog("password must include 8 HEX symbols");\r
                        return 0;\r
                }\r
        }\r
-\r
+       \r
        for ( int i = 0; i <8; ++i){\r
                memset(s,0,sizeof(s));\r
                if ( hasPwd ) {\r
@@ -352,6 +351,7 @@ int ManchesterDemod(int blockNum){
        if (!HasGraphData()) return 0;\r
                \r
        uint8_t sizebyte = 32;\r
+       // the value 5 was selected during empirical studies of the decoded data. Some signal noise to skip.\r
        uint8_t offset = 5;\r
        uint32_t blockData;\r
        uint8_t  bits[LF_BITSSTREAM_LEN] = {0x00};\r
@@ -468,6 +468,9 @@ uint32_t PackBits(uint8_t start, uint8_t len, uint8_t* bits){
        \r
        int i = start;\r
        int j = len-1;\r
+       if (len > 32) {\r
+               return 0;\r
+       }\r
        uint32_t tmp = 0;\r
        for (; j >= 0; --j, ++i){\r
                tmp     |= bits[i] << j;\r
@@ -482,8 +485,8 @@ static command_t CommandTable[] =
   {"rdpwd",  CmdReadBlkPWD,  0, "<block> <password> -- Read T55xx block data with password mode"},\r
   {"wr",     CmdWriteBlk,    0, "<data> <block> -- Write T55xx block data (page 0)"},\r
   {"wrpwd",  CmdWriteBlkPWD, 0, "<data> <block> <password> -- Write T55xx block data with password"},\r
-  {"trace",  CmdReadTrace,   0, "[1] Read T55xx traceability data (page 1 / blk 0-1) "},\r
-  {"info",   CmdInfo,        0, "[1] Read T55xx configuration data (page0 /blk 0)"},\r
+  {"trace",  CmdReadTrace,   0, "[1] Read T55xx traceability data (page 1/ blk 0-1)"},\r
+  {"info",   CmdInfo,        0, "[1] Read T55xx configuration data (page 0/ blk 0)"},\r
   {"dump",   CmdDump,        0, "[password] Dump T55xx card block 0-7. optional with password"},\r
   {"fsk",    CmdIceFsk,      0, "FSK demod"},\r
   {"man",    CmdIceManchester,      0, "Manchester demod (with SST)"},\r
Impressum, Datenschutz