]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
update changelog
[proxmark3-svn] / client / cmdlft55xx.c
index 5194357e9918f934fba30171ee9776c81379dec0..b11a64945325166b97ad7db941349b6181e197e2 100644 (file)
@@ -50,30 +50,30 @@ int usage_t55xx_config(){
        return 0;\r
 }\r
 int usage_t55xx_read(){\r
        return 0;\r
 }\r
 int usage_t55xx_read(){\r
-       PrintAndLog("Usage:  lf t55xx read b <block> p <password> <override_safety> <page1>");\r
+       PrintAndLog("Usage:  lf t55xx read [b <block>] [p <password>] <override_safety> <page1>");\r
        PrintAndLog("Options:");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     b <block>, block number to read. Between 0-7");\r
-       PrintAndLog("     p <password>, OPTIONAL password (8 hex characters)");\r
-       PrintAndLog("     o, OPTIONAL override safety check");\r
-       PrintAndLog("     1, OPTIONAL read Page 1 instead of Page 0");\r
+       PrintAndLog("     b <block>    - block number to read. Between 0-7");\r
+       PrintAndLog("     p <password> - OPTIONAL password (8 hex characters)");\r
+       PrintAndLog("     o            - OPTIONAL override safety check");\r
+       PrintAndLog("     1            - OPTIONAL read Page 1 instead of Page 0");\r
        PrintAndLog("     ****WARNING****");\r
        PrintAndLog("     Use of read with password on a tag not configured for a pwd");\r
        PrintAndLog("     can damage the tag");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("     ****WARNING****");\r
        PrintAndLog("     Use of read with password on a tag not configured for a pwd");\r
        PrintAndLog("     can damage the tag");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
-       PrintAndLog("      lf t55xx read b 0            - read data from block 0");\r
+       PrintAndLog("      lf t55xx read b 0              - read data from block 0");\r
        PrintAndLog("      lf t55xx read b 0 p feedbeef   - read data from block 0 password feedbeef");\r
        PrintAndLog("      lf t55xx read b 0 p feedbeef o - read data from block 0 password feedbeef safety check");\r
        PrintAndLog("");\r
        return 0;\r
 }\r
 int usage_t55xx_write(){\r
        PrintAndLog("      lf t55xx read b 0 p feedbeef   - read data from block 0 password feedbeef");\r
        PrintAndLog("      lf t55xx read b 0 p feedbeef o - read data from block 0 password feedbeef safety check");\r
        PrintAndLog("");\r
        return 0;\r
 }\r
 int usage_t55xx_write(){\r
-       PrintAndLog("Usage:  lf t55xx wr b <block> d <data> p [password] [1]");\r
+       PrintAndLog("Usage:  lf t55xx wr [b <block>] [d <data>] [p <password>] [1]");\r
        PrintAndLog("Options:");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     b <block>,    block number to write. Between 0-7");\r
-       PrintAndLog("     d <data>,     4 bytes of data to write (8 hex characters)");\r
-       PrintAndLog("     p [password], OPTIONAL password 4bytes (8 hex characters)");\r
-       PrintAndLog("     1,            OPTIONAL write Page 1 instead of Page 0");\r
+       PrintAndLog("     b <block>    - block number to write. Between 0-7");\r
+       PrintAndLog("     d <data>     - 4 bytes of data to write (8 hex characters)");\r
+       PrintAndLog("     p <password> - OPTIONAL password 4bytes (8 hex characters)");\r
+       PrintAndLog("     1            - OPTIONAL write Page 1 instead of Page 0");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx wr b 3 d 11223344            - write 11223344 to block 3");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx wr b 3 d 11223344            - write 11223344 to block 3");\r
@@ -84,7 +84,7 @@ int usage_t55xx_write(){
 int usage_t55xx_trace() {\r
        PrintAndLog("Usage:  lf t55xx trace [1]");\r
        PrintAndLog("Options:");\r
 int usage_t55xx_trace() {\r
        PrintAndLog("Usage:  lf t55xx trace [1]");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");\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("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx trace");\r
@@ -95,7 +95,7 @@ int usage_t55xx_trace() {
 int usage_t55xx_info() {\r
        PrintAndLog("Usage:  lf t55xx info [1]");\r
        PrintAndLog("Options:");\r
 int usage_t55xx_info() {\r
        PrintAndLog("Usage:  lf t55xx info [1]");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");\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("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx info");\r
@@ -106,8 +106,8 @@ int usage_t55xx_info() {
 int usage_t55xx_dump(){\r
        PrintAndLog("Usage:  lf t55xx dump <password> [o]");\r
        PrintAndLog("Options:");\r
 int usage_t55xx_dump(){\r
        PrintAndLog("Usage:  lf t55xx dump <password> [o]");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     <password>, OPTIONAL password 4bytes (8 hex symbols)");\r
-       PrintAndLog("     <Override>, OPTIONAL Force pwd read despite danger to card");\r
+       PrintAndLog("     <password>  - OPTIONAL password 4bytes (8 hex symbols)");\r
+       PrintAndLog("     o           - OPTIONAL override, force pwd read despite danger to card");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx dump");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx dump");\r
@@ -118,7 +118,7 @@ int usage_t55xx_dump(){
 int usage_t55xx_detect(){\r
        PrintAndLog("Usage:  lf t55xx detect [1]");\r
        PrintAndLog("Options:");\r
 int usage_t55xx_detect(){\r
        PrintAndLog("Usage:  lf t55xx detect [1]");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");\r
+       PrintAndLog("     [graph buffer data]  - if set, use Graphbuffer otherwise read data from tag.");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx detect");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("      lf t55xx detect");\r
@@ -1165,18 +1165,36 @@ uint32_t PackBits(uint8_t start, uint8_t len, uint8_t* bits){
        return tmp;\r
 }\r
 \r
        return tmp;\r
 }\r
 \r
+int CmdResetRead(const char *Cmd) {\r
+       UsbCommand c = {CMD_T55XX_RESET_READ, {0,0,0}};\r
+\r
+       clearCommandBuffer();\r
+       SendCommand(&c);\r
+       if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) {\r
+               PrintAndLog("command execution time out");\r
+               return 0;\r
+       }\r
+\r
+       uint8_t got[39999];\r
+       GetFromBigBuf(got,sizeof(got),0);\r
+       WaitForResponse(CMD_ACK,NULL);\r
+       setGraphBuf(got, sizeof(got));\r
+       return 1;\r
+}\r
+\r
 static command_t CommandTable[] =\r
 {\r
 static command_t CommandTable[] =\r
 {\r
-  {"help",   CmdHelp,           1, "This help"},\r
-  {"config", CmdT55xxSetConfig, 1, "Set/Get T55XX configuration (modulation, inverted, offset, rate)"},\r
-  {"detect", CmdT55xxDetect,    0, "[1] Try detecting the tag modulation from reading the configuration block."},\r
-  {"read",   CmdT55xxReadBlock, 0, "b <block> p [password] [o] [1] -- Read T55xx block data (page 0) [optional password]"},\r
-  {"write",  CmdT55xxWriteBlock,0, "b <block> d <data> p [password] [1] -- Write T55xx block data (page 0) [optional password]"},\r
-  {"trace",  CmdT55xxReadTrace, 0, "[1] Show T55xx traceability data (page 1/ blk 0-1)"},\r
-  {"info",   CmdT55xxInfo,      0, "[1] Show T55xx configuration data (page 0/ blk 0)"},\r
-  {"dump",   CmdT55xxDump,      0, "[password] [o] Dump T55xx card block 0-7. [optional password]"},\r
-  {"special", special,          0, "Show block changes with 64 different offsets"},\r
-  {"wakeup", CmdT55xxWakeUp,    0, "Send AOR wakeup command"},\r
+  {"help",     CmdHelp,           1, "This help"},\r
+  {"config",   CmdT55xxSetConfig, 1, "Set/Get T55XX configuration (modulation, inverted, offset, rate)"},\r
+  {"detect",   CmdT55xxDetect,    0, "[1] Try detecting the tag modulation from reading the configuration block."},\r
+  {"read",     CmdT55xxReadBlock, 0, "b <block> p [password] [o] [1] -- Read T55xx block data (page 0) [optional password]"},\r
+  {"resetread",CmdResetRead,      0, "Send Reset Cmd then lf read the stream to attempt to identify the start of it (needs a demod and/or plot after)"},\r
+  {"write",    CmdT55xxWriteBlock,0, "b <block> d <data> p [password] [1] -- Write T55xx block data (page 0) [optional password]"},\r
+  {"trace",    CmdT55xxReadTrace, 0, "[1] Show T55xx traceability data (page 1/ blk 0-1)"},\r
+  {"info",     CmdT55xxInfo,      0, "[1] Show T55xx configuration data (page 0/ blk 0)"},\r
+  {"dump",     CmdT55xxDump,      0, "[password] [o] Dump T55xx card block 0-7. [optional password]"},\r
+  {"special",  special,           0, "Show block changes with 64 different offsets"},\r
+  {"wakeup",   CmdT55xxWakeUp,    0, "Send AOR wakeup command"},\r
   {NULL, NULL, 0, NULL}\r
 };\r
 \r
   {NULL, NULL, 0, NULL}\r
 };\r
 \r
Impressum, Datenschutz