From 65b9348ad97096c2d60fc2dd3889b88f1c42ad0a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 11 Jan 2025 19:18:33 +0100 Subject: [PATCH] modified lf hitag chk to show progress, added user side abort, and a minor delay since I noticed proxmark timeouts if running unlimited --- CHANGELOG.md | 3 ++- client/src/cmdlfhitag.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7207389e1..0d0542268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Changed `lf hitag chk` - added key counter, client side abort and minor delay (@iceman1001) - Added `hf seos sam` - Added support for HID SAM SEOS communications (@jkramarz) - Changed (extended) area accessible by spiffs into last page of FLASH (@piotrva) - Changed flash-stored key dictionaries (Mifare, iClass, T55XX) and T55XX configurations to SPIFFS files (@piotrva) @@ -27,7 +28,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Added simulation function to `hf iclass legrec` (@antiklesys) - Added keys from Momentum firmware projects. (@onovy) - Added Dutch Statistics Agency default key (@eagle00789) -- Changed hf mf autopwn - now allows for custom suffix (@zxkmm) +- Changed `hf mf autopwn` - now allows for custom suffix (@zxkmm) ## [Orca.4.19552][2024-11-22] - Fixed `hf_legic.lua` - removed bit32 commands from the script (@diorch1968) diff --git a/client/src/cmdlfhitag.c b/client/src/cmdlfhitag.c index 0c8956d75..7fac8fa45 100644 --- a/client/src/cmdlfhitag.c +++ b/client/src/cmdlfhitag.c @@ -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;