X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/b891758968ea76912c84a75b38e37dfdecaee23b..5fdf867253e9a97f8fd81564cf0a165722a67358:/client/cmdlft55xx.c diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 10461754..d104d7d7 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -1377,8 +1377,9 @@ int CmdT55xxBruteForce(const char *Cmd) { char buf[9]; char filename[FILE_PATH_SIZE]={0}; int keycnt = 0; + int c; uint8_t stKeyBlock = 20; - uint8_t *keyBlock = NULL, *p; + uint8_t *keyBlock = NULL, *p = NULL; keyBlock = calloc(stKeyBlock, 6); if (keyBlock == NULL) return 1; @@ -1451,10 +1452,10 @@ int CmdT55xxBruteForce(const char *Cmd) { for (uint16_t c = 0; c < keycnt; ++c ) { if (ukbhit()) { - getchar(); + c = getchar(); + (void)c; printf("\naborted via keyboard!\n"); free(keyBlock); - free(p); return 0; } @@ -1466,7 +1467,6 @@ int CmdT55xxBruteForce(const char *Cmd) { if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, testpwd)) { PrintAndLog("Aquireing data from device failed. Quitting"); free(keyBlock); - free(p); return 0; } @@ -1475,13 +1475,11 @@ int CmdT55xxBruteForce(const char *Cmd) { if ( found ) { PrintAndLog("Found valid password: [%08X]", testpwd); free(keyBlock); - free(p); return 0; } } PrintAndLog("Password NOT found."); free(keyBlock); - free(p); return 0; } @@ -1505,7 +1503,8 @@ int CmdT55xxBruteForce(const char *Cmd) { printf("."); fflush(stdout); if (ukbhit()) { - getchar(); + c = getchar(); + (void)c; printf("\naborted via keyboard!\n"); free(keyBlock); return 0; @@ -1551,11 +1550,12 @@ static command_t CommandTable[] = { }; int CmdLFT55XX(const char *Cmd) { - CmdsParse(CommandTable, Cmd); - return 0; + clearCommandBuffer(); + CmdsParse(CommandTable, Cmd); + return 0; } int CmdHelp(const char *Cmd) { - CmdsHelp(CommandTable); - return 0; + CmdsHelp(CommandTable); + return 0; }