Preserve default flow

This commit is contained in:
Peter S. Hollander
2026-03-24 10:53:13 +00:00
parent 070211be1b
commit 422b3b7473
+3 -7
View File
@@ -1473,7 +1473,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 (0 will run until button press - def 0)"),
arg_int0("t", "timeout", "<dec>", "timeout in ms (def -1, ie. until button press)"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
@@ -1487,7 +1487,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, 0);
size_t timeout = arg_get_int_def(ctx, 3, -1);
CLIParserFree(ctx);
// sanity checks
@@ -1496,10 +1496,6 @@ static int CmdHF15Sim(const char *Cmd) {
return PM3_EINVARG;
}
if (timeout == 0) {
timeout = -1;
}
PacketResponseNG resp;
// get UID from emulator for printing
@@ -1532,7 +1528,7 @@ static int CmdHF15Sim(const char *Cmd) {
clearCommandBuffer();
SendCommandNG(CMD_HF_ISO15693_SIMULATE, (uint8_t *)&payload, sizeof(payload));
WaitForResponseTimeout(CMD_HF_ISO15693_SIMULATE, &resp, timeout);
if (timeout != -1) {
if (timeout != (size_t) - 1) {
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
}
PrintAndLogEx(INFO, "Done!");