]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
ADD; Some 7816 error codes
[proxmark3-svn] / client / cmdlft55xx.c
index 2efe0c22d07a011e0cc2ce7ef9a12357f9ae023b..bc30d7e3b18546192c2a04bb068d16212b33983d 100644 (file)
@@ -1397,21 +1397,18 @@ int CmdT55xxBruteForce(const char *Cmd) {
        char buf[9];\r
        char filename[FILE_PATH_SIZE]={0};\r
        int     keycnt = 0;\r
-       int c;\r
+       int ch;\r
        uint8_t stKeyBlock = 20;\r
        uint8_t *keyBlock = NULL, *p = NULL;\r
-       keyBlock = calloc(stKeyBlock, 6);\r
-       if (keyBlock == NULL) return 1;\r
-       \r
     uint32_t start_password = 0x00000000; //start password\r
     uint32_t end_password   = 0xFFFFFFFF; //end   password\r
     bool found = false;\r
 \r
     char cmdp = param_getchar(Cmd, 0);\r
-    if (cmdp == 'h' || cmdp == 'H') {\r
-               free(keyBlock);\r
-               return usage_t55xx_bruteforce();\r
-       }\r
+       if (cmdp == 'h' || cmdp == 'H') return usage_t55xx_bruteforce();\r
+\r
+       keyBlock = calloc(stKeyBlock, 6);\r
+       if (keyBlock == NULL) return 1;\r
 \r
        if (cmdp == 'i' || cmdp == 'I') {\r
        \r
@@ -1472,8 +1469,8 @@ int CmdT55xxBruteForce(const char *Cmd) {
                for (uint16_t c = 0; c < keycnt; ++c ) {\r
        \r
                        if (ukbhit()) {\r
-                               c = getchar();\r
-                               (void)c;\r
+                               ch = getchar();\r
+                               (void)ch;\r
                                printf("\naborted via keyboard!\n");\r
                                free(keyBlock);\r
                                return 0;\r
@@ -1523,8 +1520,8 @@ int CmdT55xxBruteForce(const char *Cmd) {
                printf(".");\r
                fflush(stdout);\r
                if (ukbhit()) {\r
-                       c = getchar();\r
-                       (void)c;\r
+                       ch = getchar();\r
+                       (void)ch;\r
                        printf("\naborted via keyboard!\n");\r
                        free(keyBlock);\r
                        return 0;\r
Impressum, Datenschutz