]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
Fix incorrect memset parameters in lf t55xx wipe
[proxmark3-svn] / client / cmdlft55xx.c
index 7bf2c25cab5cbe5cb144a355916a20d0838d4ab7..868126c900fd65a84d7c7a269744e0c1097cee12 100644 (file)
@@ -150,15 +150,19 @@ int usage_t55xx_wakup(){
        return 0;\r
 }\r
 int usage_t55xx_bruteforce(){\r
+       PrintAndLog("This command uses A) bruteforce to scan a number range");\r
+       PrintAndLog("                  B) a dictionary attack");\r
        PrintAndLog("Usage: lf t55xx bruteforce <start password> <end password> [i <*.dic>]");\r
        PrintAndLog("       password must be 4 bytes (8 hex symbols)");\r
        PrintAndLog("Options:");\r
-       PrintAndLog("     h         - this help");\r
-       PrintAndLog("     i <*.dic> - loads a default keys dictionary file <*.dic>");\r
+       PrintAndLog("     h           - this help");\r
+       PrintAndLog("     <start_pwd> - 4 byte hex value to start pwd search at");\r
+       PrintAndLog("     <end_pwd>   - 4 byte hex value to end pwd search at");\r
+       PrintAndLog("     i <*.dic>   - loads a default keys dictionary file <*.dic>");\r
        PrintAndLog("");\r
        PrintAndLog("Examples:");\r
        PrintAndLog("       lf t55xx bruteforce aaaaaaaa bbbbbbbb");\r
-       PrintAndLog("       lf t55xx bruteforce i mykeys.dic");\r
+       PrintAndLog("       lf t55xx bruteforce i default_pwd.dic");\r
        PrintAndLog("");\r
        return 0;\r
 }\r
@@ -381,17 +385,23 @@ bool DecodeT55xxBlock(){
                        break;\r
                case DEMOD_PSK1:\r
                        // skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)\r
+                       save_restoreGB(1);\r
                        CmdLtrim("160");\r
                        snprintf(cmdStr, sizeof(buf),"%d %d 6", bitRate[config.bitrate], config.inverted );\r
                        ans = PSKDemod(cmdStr, FALSE);\r
+                       //undo trim samples\r
+                       save_restoreGB(0);\r
                        break;\r
                case DEMOD_PSK2: //inverted won't affect this\r
                case DEMOD_PSK3: //not fully implemented\r
                        // skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)\r
+                       save_restoreGB(1);\r
                        CmdLtrim("160");\r
                        snprintf(cmdStr, sizeof(buf),"%d 0 6", bitRate[config.bitrate] );\r
                        ans = PSKDemod(cmdStr, FALSE);\r
                        psk1TOpsk2(DemodBuffer, DemodBufferLen);\r
+                       //undo trim samples\r
+                       save_restoreGB(0);\r
                        break;\r
                case DEMOD_NRZ:\r
                        snprintf(cmdStr, sizeof(buf),"%d %d 1", bitRate[config.bitrate], config.inverted );\r
@@ -1306,7 +1316,7 @@ int CmdT55xxWipe(const char *Cmd) {
                if (!CmdT55xxWriteBlock(ptrData))\r
                        PrintAndLog("Error writing blk %d", blk);\r
 \r
-               memset(writeData, sizeof(writeData), 0x00);\r
+               memset(writeData, 0x00, sizeof(writeData));\r
        }\r
        return 0;\r
 }\r
Impressum, Datenschutz