modified lf hitag chk to show progress, added user side abort, and a minor delay since I noticed proxmark timeouts if running unlimited

This commit is contained in:
iceman1001 committed 2025-01-11 19:18:33 +01:00
1 parent 7637fa0150
commit 65b9348ad9
2 files changed
+18 -2

No files matched your search

+16 -1
View File
@@ -488,8 +488,23 @@ static int ht2_check_dictionary(uint32_t key_count, uint8_t *keys, uint8_t keyl
uint8_t *pkeys = keys;
uint32_t toti = key_count;
uint32_t cnt = 0;
while (key_count--) {
cnt++;
if (kbd_enter_pressed()) {
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
PrintAndLogEx(INFO, "User aborted");
break;
}
PrintAndLogEx(INPLACE, "Checking Keys %u / %u", cnt, toti);
msleep(30);
if (keylen == 4) {
packet.cmd = HT2F_PASSWORD;
memcpy(packet.pwd, pkeys, keylen);
@@ -503,7 +518,7 @@ static int ht2_check_dictionary(uint32_t key_count, uint8_t *keys, uint8_t keyl
clearCommandBuffer();
SendCommandNG(CMD_LF_HITAG_READER, (uint8_t *)&packet, sizeof(packet));
PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_LF_HITAG_READER, &resp, 2000) == false) {
if (WaitForResponseTimeout(CMD_LF_HITAG_READER, &resp, 4000) == false) {
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
return PM3_ETIMEOUT;