X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/060fdaf998d09011610c14de5b27ac597b0660a0..8ce3e4b4e937f2e3b2fda5b0d5d2c6bd9c6b3ebc:/client/cmdlft55xx.c diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 91168a02..92e6f745 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -1394,16 +1394,26 @@ int CmdT55xxBruteForce(const char *Cmd) { uint64_t testpwd = 0x00; for (uint16_t c = 0; c < keycnt; ++c ) { + if (ukbhit()) { + getchar(); + printf("\naborted via keyboard!\n"); + return 0; + } + testpwd = bytes_to_num(keyBlock + 4*c, 4); PrintAndLog("Testing %08X", testpwd); - AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, testpwd); + if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, testpwd)) { + PrintAndLog("Aquireing data from device failed. Quitting"); + return 0; + } + found = tryDetectModulation(); if ( found ) { - PrintAndLog("Found valid password:[%08X]", testpwd); + PrintAndLog("Found valid password: [%08X]", testpwd); return 0; } } @@ -1419,20 +1429,27 @@ int CmdT55xxBruteForce(const char *Cmd) { if ( start_password >= end_password ) return usage_t55xx_bruteforce(); - PrintAndLog("Search password range [%08X -> %08X]", start_password, end_password); + PrintAndLog("Search password range [%08X -> %08X]", start_password, end_password); uint32_t i = start_password; while ((!found) && (i <= end_password)){ - AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, i); + printf("."); + fflush(stdout); + if (ukbhit()) { + getchar(); + printf("\naborted via keyboard!\n"); + return 0; + } + + if (!AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, i)) { + PrintAndLog("Aquireing data from device failed. Quitting"); + return 0; + } found = tryDetectModulation(); - if (found) - break; - - if ((i % 0x100) == 0) printf("[%08x], ",i); - + if (found) break; i++; } @@ -1441,7 +1458,7 @@ int CmdT55xxBruteForce(const char *Cmd) { if (found) PrintAndLog("Found valid password: [%08x]", i); else - PrintAndLog("Password NOT found. Last tried: [%08x]", i); + PrintAndLog("Password NOT found. Last tried: [%08x]", --i); return 0; }