]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
FIXED: lf t55xx fsk now demods but only to binary.
[proxmark3-svn] / client / cmdlft55xx.c
index 9206fd2ad946e635ef70d82efee8ef83a0b1d902..8420465b93f231734436d40b902801fbf86a0152 100644 (file)
@@ -28,9 +28,7 @@ static int CmdHelp(const char *Cmd);
 \r
 int CmdReadBlk(const char *Cmd)\r
 {\r
-       //default to invalid block\r
        int Block = -1;\r
-       UsbCommand c;\r
 \r
        sscanf(Cmd, "%d", &Block);\r
 \r
@@ -39,10 +37,8 @@ int CmdReadBlk(const char *Cmd)
                return 1;\r
        }       \r
 \r
-       //PrintAndLog(" Reading page 0 block : %d", Block);\r
-\r
        // this command fills up BigBuff\r
-       // \r
+       UsbCommand c;\r
        c.cmd = CMD_T55XX_READ_BLOCK;\r
        c.d.asBytes[0] = 0x00;\r
        c.arg[0] = 0;\r
@@ -57,10 +53,10 @@ int CmdReadBlk(const char *Cmd)
        WaitForResponseTimeout(CMD_ACK,NULL, 1500);\r
 \r
        for (int j = 0; j < LF_TRACE_BUFF_SIZE; j++) {\r
-               GraphBuffer[j] = ((int)data[j]) ;\r
+               GraphBuffer[j] = (int)data[j];\r
        }\r
        GraphTraceLen = LF_TRACE_BUFF_SIZE;\r
-       CmdIceManchester(Cmd);\r
+       CmdIceManchester(Block);\r
        RepaintGraphWindow();\r
   return 0;\r
 }\r
@@ -97,9 +93,7 @@ int CmdReadBlkPWD(const char *Cmd)
                GraphBuffer[j] = ((int)data[j]) - 128;\r
        }\r
        GraphTraceLen = LF_TRACE_BUFF_SIZE;\r
-\r
-       CmdIceManchester(Cmd);\r
-       \r
+       CmdIceManchester(Block);        \r
        RepaintGraphWindow();\r
   return 0;\r
 }\r
@@ -349,6 +343,10 @@ int CmdIceFsk(const char *Cmd){
        return 0;\r
 }\r
 int CmdIceManchester(const char *Cmd){\r
+       ManchesterDemod( -1);\r
+       return 0;\r
+}\r
+int ManchesterDemod(int block){\r
 \r
        int  blockNum = -1;\r
        uint32_t blockData;\r
@@ -357,9 +355,9 @@ int CmdIceManchester(const char *Cmd){
        \r
        manchester_decode(GraphBuffer, LF_TRACE_BUFF_SIZE, bitstream);  \r
     blockData = PackBits(5, 32, bitstream);\r
-       sscanf(Cmd, "%d", &blockNum);\r
+\r
        if ( blockNum > -1){\r
-               PrintAndLog("   Block %d  : 0x%08X  %s", blockNum, blockData, sprint_bin(bitstream+5,32) );\r
+               PrintAndLog("   Block %d : 0x%08X  %s", blockNum, blockData, sprint_bin(bitstream+5,32) );\r
        }else{\r
                PrintAndLog("   Decoded : 0x%08X  %s", blockData, sprint_bin(bitstream+5,32) );\r
        }\r
@@ -484,7 +482,7 @@ static command_t CommandTable[] =
   {"info",   CmdInfo,        0, "[1] Read T55xx configuration data (page0 /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"},\r
+  {"man",    CmdIceManchester,      0, "Manchester demod (with SST)"},\r
   {NULL, NULL, 0, NULL}\r
 };\r
 \r
Impressum, Datenschutz