mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
Merge pull request #3140 from recursivenomad-forks/master
Add `--timeout` to `hf 15 sim`
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user