]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: added a Q5 parameter for "lf t55xx wipe",
authoriceman1001 <iceman@iuse.se>
Mon, 4 Jan 2016 09:13:38 +0000 (10:13 +0100)
committericeman1001 <iceman@iuse.se>
Mon, 4 Jan 2016 09:13:38 +0000 (10:13 +0100)
    the default config blocks is:
         t55x7      : 000880E0
         t5555 (Q5) : 6001F004

client/cmdlft55xx.c
client/cmdlft55xx.h

index fc76e8983bc4ae195ec34d9fdf539b3912ee1c70..2f8e2e2f5bf0730df61ab43ac4d98ffa541447a1 100644 (file)
@@ -166,7 +166,18 @@ int usage_t55xx_bruteforce(){
     PrintAndLog("");\r
     return 0;\r
 }\r
     PrintAndLog("");\r
     return 0;\r
 }\r
-\r
+int usage_t55xx_wipe(){\r
+       PrintAndLog("Usage:  lf t55xx wipe [h] [Q5]");\r
+       PrintAndLog("This commands wipes a tag, fills blocks 1-7 with zeros and a default configuration block");\r
+       PrintAndLog("Options:");\r
+       PrintAndLog("     h     - this help");\r
+    PrintAndLog("     Q5       - indicates to use the T555 (Q5) default configuration block");\r
+    PrintAndLog("");\r
+       PrintAndLog("Examples:");\r
+    PrintAndLog("      lf t55xx wipe   -  wipes a t55x7 tag,    config block 0x000880E0");\r
+       PrintAndLog("      lf t55xx wipe Q5 -  wipes a t5555 Q5 tag, config block 0x6001F004");\r
+       return 0;\r
+}\r
 static int CmdHelp(const char *Cmd);\r
 \r
 void printT5xxHeader(uint8_t page){\r
 static int CmdHelp(const char *Cmd);\r
 \r
 void printT5xxHeader(uint8_t page){\r
@@ -1307,7 +1318,7 @@ void t55x7_create_config_block( int tagtype ){
        switch (tagtype){\r
                case 0: snprintf(retStr, sizeof(buf),"%08X - T55X7 Default", T55X7_DEFAULT_CONFIG_BLOCK); break;\r
                case 1: snprintf(retStr, sizeof(buf),"%08X - T55X7 Raw", T55X7_RAW_CONFIG_BLOCK); break;\r
        switch (tagtype){\r
                case 0: snprintf(retStr, sizeof(buf),"%08X - T55X7 Default", T55X7_DEFAULT_CONFIG_BLOCK); break;\r
                case 1: snprintf(retStr, sizeof(buf),"%08X - T55X7 Raw", T55X7_RAW_CONFIG_BLOCK); break;\r
-               //case 2: snprintf(retStr, sizeof(buf),"%08X - Q5 Default", Q5_DEFAULT_CONFIG_BLOCK); break;\r
+               case 2: snprintf(retStr, sizeof(buf),"%08X - T5555 Q5 Default", T5555_DEFAULT_CONFIG_BLOCK); break;\r
                default:\r
                        break;\r
        }\r
                default:\r
                        break;\r
        }\r
@@ -1334,21 +1345,28 @@ int CmdResetRead(const char *Cmd) {
 int CmdT55xxWipe(const char *Cmd) {\r
        char writeData[20] = {0};\r
        char *ptrData = writeData;\r
 int CmdT55xxWipe(const char *Cmd) {\r
        char writeData[20] = {0};\r
        char *ptrData = writeData;\r
-       \r
+       char cmdp = param_getchar(Cmd, 0);      \r
+       if ( cmdp == 'h' || cmdp == 'H') return usage_t55xx_wipe();\r
+\r
+       bool Q5 = (cmdp == 'q' || cmdp == 'Q');\r
+\r
+       // Try with the default password to reset block 0\r
+       // With a pwd should work even if pwd bit not set\r
        PrintAndLog("\nBeginning Wipe of a T55xx tag (assuming the tag is not password protected)\n");\r
        PrintAndLog("\nBeginning Wipe of a T55xx tag (assuming the tag is not password protected)\n");\r
+               \r
+       if ( Q5 ){\r
+               snprintf(ptrData,sizeof(writeData),"b 0 d 6001F004 p 0");\r
+       } else {\r
+               snprintf(ptrData,sizeof(writeData),"b 0 d 000880E0 p 0");\r
+       }\r
        \r
        \r
-       //try with the default password to reset block 0  (with a pwd should work even if pwd bit not set)\r
-       snprintf(ptrData,sizeof(writeData),"b 0 d 000880E0 p 0");\r
-       \r
-       if (!CmdT55xxWriteBlock(ptrData))\r
-               PrintAndLog("Error writing blk 0");\r
+       if (!CmdT55xxWriteBlock(ptrData)) PrintAndLog("Error writing blk 0");\r
        \r
        for (uint8_t blk = 1; blk<8; blk++) {\r
                \r
                snprintf(ptrData,sizeof(writeData),"b %d d 0", blk);\r
                \r
        \r
        for (uint8_t blk = 1; blk<8; blk++) {\r
                \r
                snprintf(ptrData,sizeof(writeData),"b %d d 0", blk);\r
                \r
-               if (!CmdT55xxWriteBlock(ptrData)) \r
-                       PrintAndLog("Error writing blk %d", blk);\r
+               if (!CmdT55xxWriteBlock(ptrData)) PrintAndLog("Error writing blk %d", blk);\r
                \r
                memset(writeData,0x00, sizeof(writeData));\r
        }\r
                \r
                memset(writeData,0x00, sizeof(writeData));\r
        }\r
index f3532ce4a00e17048001c2de3a34318fbc3bbe5f..1771742a09e1584f6bcb678738e40d8e47e73570 100644 (file)
 #define T55X7_IOPROX_CONFIG_BLOCK              0x00147040  // maxblock 2\r
 #define T55X7_bin 0b0010\r
 \r
 #define T55X7_IOPROX_CONFIG_BLOCK              0x00147040  // maxblock 2\r
 #define T55X7_bin 0b0010\r
 \r
+#define T5555_DEFAULT_CONFIG_BLOCK             0x6001F004  // data rate 64 , ask, manchester, 2 data blocks?\r
+enum {\r
+       T55x7_RAW = 0x00,\r
+       T55x7_DEFAULT = 0x00,\r
+       T5555_DEFAULT = 0x01,\r
+       EM_UNIQUE  = 0x0,\r
+       FDBX = 0x02,\r
+       HID_26 = 0x03,\r
+       INDALA_64 = 0x04,\r
+       INDALA_224 = 0x05,\r
+       GUARDPROXXII = 0x06,\r
+       VIKING = 0x07,\r
+       NORALSYS = 0x08,\r
+       IOPROX = 0x09,\r
+} t55xx_tag;\r
+\r
 typedef struct {\r
        uint32_t bl1;\r
        uint32_t bl2; \r
 typedef struct {\r
        uint32_t bl1;\r
        uint32_t bl2; \r
Impressum, Datenschutz