diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b4ff5dcc..2360c615d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ 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] - - Added `hf 15 writeafi`, `hf 15 writedsfid` and detailed info for SLIX2 tags in `hf 15 info`. Also did some refactoring in HF15 commands. (@grspy) + - Change `hf 15` - some refactoring (@grspy) + - Added `hf 15 writeafi` and `hf 15 writedsfid` (@grspy) + - Added detailed info for SLIX2 tags in `hf 15 info` (@grspy) - Fix hf list felica and hf felica sniff (@7homasSutter) - Added hf felica wrunencrypted (@7homasSutter) - Added hf felica rdunencrypted (@7homasSutter) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 3dc64b8b8..7ea08e59c 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -967,9 +967,10 @@ void BruteforceIso15693Afi(uint32_t speed) { Dbprintf("AFI = %i UID = %s", i, sprintUID(NULL, buf + 2)); } - if (BUTTON_PRESS()) { + aborted = BUTTON_PRESS(); + + if (aborted) { DbpString("button pressed, aborting.."); - aborted = true; break; } } diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 8dba0d565..1650aefd4 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -951,6 +951,8 @@ static int CmdHF15Sim(const char *Cmd) { // helptext static int CmdHF15FindAfi(const char *Cmd) { PacketResponseNG resp; + uint32_t timeout = 0; + char cmdp = tolower(param_getchar(Cmd, 0)); if (cmdp == 'h') return usage_15_findafi(); @@ -959,13 +961,19 @@ static int CmdHF15FindAfi(const char *Cmd) { clearCommandBuffer(); SendCommandMIX(CMD_HF_ISO15693_FINDAFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); - if (WaitForResponseTimeout(CMD_ACK, &resp, 120000)) { // 2 minutes should be enough - DropField(); - return resp.status; // PM3_EOPABORTED or PM3_SUCCESS + while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { + timeout++; + + // should be done in about 2 minutes + if (timeout > 180) { + PrintAndLogEx(WARNING, "\nNo response from Proxmark3. Aborting..."); + DropField(); + return PM3_ETIMEOUT; + } } DropField(); - return PM3_ETIMEOUT; + return resp.status; // PM3_EOPABORTED or PM3_SUCCESS } // Writes the AFI (Application Family Identifier) of a card