-// int CmdReadBlk(const char *Cmd)\r
-// {\r
- // int block = -1;\r
- // sscanf(Cmd, "%d", &block);\r
-\r
- // if ((block > 7) | (block < 0)) {\r
- // PrintAndLog("Block must be between 0 and 7");\r
- // return 1;\r
- // } \r
-\r
- // UsbCommand c;\r
- // c.cmd = CMD_T55XX_READ_BLOCK;\r
- // c.d.asBytes[0] = 0x00;\r
- // c.arg[0] = 0;\r
- // c.arg[1] = block;\r
- // c.arg[2] = 0;\r
- // SendCommand(&c);\r
- // WaitForResponse(CMD_ACK, NULL);\r
- \r
- // uint8_t data[LF_TRACE_BUFF_SIZE] = {0x00};\r
- \r
- // GetFromBigBuf(data,LF_TRACE_BUFF_SIZE,0); //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
- // return 0;\r
-// }\r
+// 0 = FSK\r
+// 1 = ASK\r
+// 2 = PSK\r
+// 4 = NZR (direct)\r
+typedef struct {\r
+ uint8_t modulation;\r
+ bool inversed;\r
+ uint32_t block0;\r
+} t55xx_conf_block_t;\r
+\r
+// Default configuration: FSK, not inversed.\r
+t55xx_conf_block_t config = { .modulation = 0, .inversed = FALSE, .block0 = 0x00};\r
+\r
+int usage_t55xx_config(){\r
+ PrintAndLog("Usage: lf t55xx config [d <demodulation>] [i 1]");\r
+ PrintAndLog("Options: ");\r
+ PrintAndLog(" h This help");\r
+ PrintAndLog(" d <FSK|ASK|PSK|NZ|BI> Set demodulation FSK / ASK / PSK / NZ / Biphase");\r
+ PrintAndLog(" i [1] Inverse data signal, defaults to normal");\r
+ PrintAndLog("");\r
+ PrintAndLog("Examples:");\r
+ PrintAndLog(" lf t55xx config d FSK - FSK demodulation");\r
+ PrintAndLog(" lf t55xx config d FSK i 1 - FSK demodulation, inverse data");\r
+ PrintAndLog("");\r
+ return 0;\r
+}\r
+int usage_t55xx_read(){\r
+ PrintAndLog("Usage: lf t55xx read <block> <password>");\r
+ PrintAndLog(" <block>, block number to read. Between 0-7");\r
+ PrintAndLog(" <password>, OPTIONAL password (8 hex characters)");\r
+ PrintAndLog("");\r
+ PrintAndLog("Examples:");\r
+ PrintAndLog(" lf t55xx read 0 - read data from block 0");\r
+ PrintAndLog(" lf t55xx read 0 feedbeef - read data from block 0 password feedbeef");\r
+ PrintAndLog("");\r
+ return 0;\r
+}\r
+int usage_t55xx_write(){\r
+ PrintAndLog("Usage: lf t55xx wr <block> <data> [password]");\r
+ PrintAndLog(" <block>, block number to read. Between 0-7");\r
+ PrintAndLog(" <data>, 4 bytes of data to write (8 hex characters)");\r
+ PrintAndLog(" [password], OPTIONAL password 4bytes (8 hex characters)");\r
+ PrintAndLog("");\r
+ PrintAndLog("Examples:");\r
+ PrintAndLog(" lf t55xx wd 3 11223344 - write 11223344 to block 3");\r
+ PrintAndLog(" lf t55xx wd 3 11223344 feedbeef - write 11223344 to block 3 password feedbeef");\r
+ PrintAndLog("");\r
+ return 0;\r
+}\r
+int usage_t55xx_trace() {\r
+ PrintAndLog("Usage: lf t55xx trace [1]");\r
+ PrintAndLog(" [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");\r
+ PrintAndLog("");\r
+ PrintAndLog("Examples:");\r
+ PrintAndLog(" lf t55xx trace");\r
+ PrintAndLog(" lf t55xx trace 1");\r
+ PrintAndLog("");\r
+ return 0;\r
+}\r
+int usage_t55xx_info() {\r
+ PrintAndLog("Usage: lf t55xx info [1]");\r
+ PrintAndLog(" [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");\r
+ PrintAndLog("");\r
+ PrintAndLog("Examples:");\r
+ PrintAndLog(" lf t55xx info");\r
+ PrintAndLog(" lf t55xx info 1");\r
+ PrintAndLog("");\r
+ return 0;\r
+}\r
+int usage_t55xx_dump(){\r
+ PrintAndLog("Usage: lf t55xx dump <password>");\r
+ PrintAndLog(" <password>, OPTIONAL password 4bytes (8 hex symbols)");\r
+ PrintAndLog("");\r
+ PrintAndLog("Examples:");\r
+ PrintAndLog(" lf t55xx dump");\r
+ PrintAndLog(" lf t55xx dump feedbeef");\r
+ PrintAndLog("");\r
+ return 0;\r
+}\r