mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-31 04:39:49 +08:00
Hf15FindAfi WaitForResponse loop
This commit is contained in:
parent
931d115ef8
commit
ecaf919365
3 changed files with 18 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue