\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
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
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
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
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
\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
{"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