Merge pull request #3140 from recursivenomad-forks/master

Add `--timeout` to `hf 15 sim`
This commit is contained in:
Iceman
2026-03-24 19:16:30 +07:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -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]
- Added `-t` / `--timeout` option for `hf 15 sim` (@recursivenomad)
- Added `--aid` parameter to `hf seos` commands (@kormax)
- Added `hf iclass blacktears` command to perform an automated tearoff of block 1 to set non-secure page mode(@antiklesys)
- Changed wiegand encoding to use shared helpers and have unified parameters (--raw, --bin, --new, --wiegand, etc.) (@cindersocket)
+6 -1
View File
@@ -1489,6 +1489,7 @@ static int CmdHF15Sim(const char *Cmd) {
arg_param_begin,
arg_str0("u", "uid", "<hex>", "UID, 8 hex bytes"),
arg_int0("b", "blocksize", "<dec>", "block size (def 4)"),
arg_int0("t", "timeout", "<dec>", "timeout in ms (def -1, ie. until button press)"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
@@ -1502,6 +1503,7 @@ static int CmdHF15Sim(const char *Cmd) {
int uidlen = 0;
CLIGetHexWithReturn(ctx, 1, payload.uid, &uidlen);
payload.block_size = arg_get_int_def(ctx, 2, 4);
size_t timeout = arg_get_int_def(ctx, 3, -1);
CLIParserFree(ctx);
// sanity checks
@@ -1541,7 +1543,10 @@ static int CmdHF15Sim(const char *Cmd) {
clearCommandBuffer();
SendCommandNG(CMD_HF_ISO15693_SIMULATE, (uint8_t *)&payload, sizeof(payload));
WaitForResponse(CMD_HF_ISO15693_SIMULATE, &resp);
WaitForResponseTimeout(CMD_HF_ISO15693_SIMULATE, &resp, timeout);
if (timeout != (size_t) - 1) {
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
}
PrintAndLogEx(INFO, "Done!");
return PM3_SUCCESS;
}