]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
CHG: Added the urls to the new Wiki on github inside the flasher.c usuage text.
[proxmark3-svn] / client / cmdlft55xx.c
index 10461754fe11f85af2d7898426e9e140ac650a78..7684bcc721fdb5adda1606d937bbb90d772c20b3 100644 (file)
@@ -1377,8 +1377,9 @@ int CmdT55xxBruteForce(const char *Cmd) {
        char buf[9];\r
        char filename[FILE_PATH_SIZE]={0};\r
        int     keycnt = 0;\r
+       int c;\r
        uint8_t stKeyBlock = 20;\r
-       uint8_t *keyBlock = NULL, *p;\r
+       uint8_t *keyBlock = NULL, *p = NULL;\r
        keyBlock = calloc(stKeyBlock, 6);\r
        if (keyBlock == NULL) return 1;\r
        \r
@@ -1451,10 +1452,10 @@ int CmdT55xxBruteForce(const char *Cmd) {
                for (uint16_t c = 0; c < keycnt; ++c ) {\r
        \r
                        if (ukbhit()) {\r
-                               getchar();\r
+                               c = getchar();\r
+                               (void)c;\r
                                printf("\naborted via keyboard!\n");\r
                                free(keyBlock);\r
-                               free(p);\r
                                return 0;\r
                        }\r
                \r
@@ -1466,7 +1467,6 @@ int CmdT55xxBruteForce(const char *Cmd) {
                        if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, testpwd)) {\r
                                PrintAndLog("Aquireing data from device failed. Quitting");\r
                                free(keyBlock);\r
-                               free(p);\r
                                return 0;\r
                        }\r
                        \r
@@ -1475,13 +1475,11 @@ int CmdT55xxBruteForce(const char *Cmd) {
                        if ( found ) {\r
                                PrintAndLog("Found valid password: [%08X]", testpwd);\r
                                free(keyBlock);\r
-                               free(p);\r
                                return 0;\r
                        } \r
                }\r
                PrintAndLog("Password NOT found.");\r
                free(keyBlock);\r
-               free(p);\r
                return 0;\r
        }\r
        \r
@@ -1505,7 +1503,8 @@ int CmdT55xxBruteForce(const char *Cmd) {
                printf(".");\r
                fflush(stdout);\r
                if (ukbhit()) {\r
-                       getchar();\r
+                       c = getchar();\r
+                       (void)c;\r
                        printf("\naborted via keyboard!\n");\r
                        free(keyBlock);\r
                        return 0;\r
Impressum, Datenschutz