ADD: Added the possibility to exit the bruteforce mode (either rangesearch or file) with the keyboard.

FIX:  if not found, the range search printed wrong number.
This commit is contained in:
iceman1001 2015-12-01 22:47:03 +01:00
commit d08faa4e02
2 changed files with 18 additions and 8 deletions

View file

@ -1394,6 +1394,12 @@ 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);
@ -1429,17 +1435,21 @@ int CmdT55xxBruteForce(const char *Cmd) {
while ((!found) && (i <= end_password)){
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++;
}
@ -1448,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;
}