Update cmdlft55xx.c
authormwalker33 <mwal5099@bigpond.net.au>
Mon, 17 Jun 2019 12:01:25 +0000 (22:01 +1000)
committermwalker33 <mwal5099@bigpond.net.au>
Mon, 17 Jun 2019 12:01:25 +0000 (22:01 +1000)
Fixed bruteforce filename

client/cmdlft55xx.c

index a05838b4a71d5e5b8b8fed4d88e7792724056fb0..da8fc703281281d996119f034ccdaffc2367083f 100644 (file)
@@ -1635,8 +1635,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
        keyBlock = calloc(stKeyBlock, 6);\r
        if (keyBlock == NULL) return 1;\r
 \r
-       PrintAndLog("New Downlink Supprt");\r
-\r
        while(param_getchar(Cmd, cmdp) != 0x00 && !errors) {\r
                switch(param_getchar(Cmd, cmdp)) {\r
                case 'h':\r
@@ -1649,7 +1647,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
                                        if (downlink_mode > 3) downlink_mode = 0;\r
                                        cmdp +=2;\r
                                        cmd_offset += 4;\r
-                                       PrintAndLog ("DL Mode : %d",downlink_mode);\r
                                        break;\r
                case 'i':\r
                case 'I':\r
@@ -1661,8 +1658,11 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
                                        len = strlen(Cmd+2);\r
                                        if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
                                        memcpy(filename, Cmd+cmd_offset+2, len);\r
+                                       // Drop any characters after space\r
+                                       char *p = strstr(filename," ");\r
+                                       if (p) *p = 0;\r
                                        cmdp += 2;\r
-               //                      PrintAndLog (" File : [%s]",filename);\r
+                                       // PrintAndLog (" File : [%s]",filename);\r
                                        break;\r
                case 'r':\r
                case 'R':\r
@@ -1670,12 +1670,11 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
                                                PrintAndLog ("use Range or File");\r
                                                return 0;\r
                                        }\r
-                                       use_range       = true; // = param_get32ex(Cmd, cmdp+1, 0, 16);\r
+                                       use_range       = true; \r
                                        start_password  = param_get32ex(Cmd, cmdp+1, 0, 16);\r
                                        end_password    = param_get32ex(Cmd, cmdp+2, 0, 16);\r
                                        cmdp += 3;\r
-                                       cmd_offset += 20; // 8 + 8 + 1 + 1 + 1\r
-               //                      PrintAndLog (" Range : [%0X] - [%0X]",start_password,end_password);\r
+                                       cmd_offset += 20; \r
                                        break;\r
                default:\r
                        PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));\r
@@ -1684,9 +1683,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
                }\r
        }\r
 \r
-\r
-//     if (cmdp == 'i' || cmdp == 'I') {\r
-\r
        if (use_file)\r
        {\r
                                FILE * f = fopen( filename , "r");\r
@@ -1753,7 +1749,7 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
 \r
                        PrintAndLog("Testing %08X", testpwd);\r
             \r
-                       // Try each downlink_mode of asked to \r
+                       // Try each downlink_mode if asked to \r
                        // donwlink_mode will = 0 if > 3 or set to 0, so loop from 0 - 3\r
                        for (dl_mode = downlink_mode; dl_mode <= 3; dl_mode++)\r
                        {\r
@@ -1768,7 +1764,7 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
                                if ( found ) {\r
                                        PrintAndLog("Found valid password: [%08X]", testpwd);\r
                                        free(keyBlock);\r
-                                                       // Add downlink mode to reference.\r
+                                       // Add downlink mode for reference.\r
                                        switch (dl_mode) {\r
                                                case  0 :       PrintAndLog ("Downlink   : e 0 - Default/Fixed Bit Length"); break;\r
                                                case  1 :   PrintAndLog ("Downlink   : e 1 - Long Leading Reference"); break;\r
@@ -1788,9 +1784,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
 \r
        if (use_range)\r
        {\r
-               // incremental pwd range search\r
-       //      start_password = param_get32ex(Cmd, 0, 0, 16);\r
-       //      end_password = param_get32ex(Cmd, 1, 0, 16);\r
 \r
                if ( start_password >= end_password ) {\r
                        free(keyBlock);\r
@@ -1827,7 +1820,7 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) {
        \r
                if (found) {\r
                        PrintAndLog("Found valid password: [%08x]", i);\r
-                                       // Add downlink mode to reference.\r
+                       // Add downlink mode for reference.\r
                        switch (downlink_mode) {\r
                                case  0 :       PrintAndLog ("Downlink   : e 0 - Default/Fixed Bit Length"); break;\r
                                case  1 :   PrintAndLog ("Downlink   : e 1 - Long Leading Reference"); break;\r
Impressum, Datenschutz