From 026a1c7648f4f1c6dd01bd7c78a6ba840f31abf9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 29 Aug 2026 17:30:07 +0200 Subject: [PATCH] fixed missing waits for return OPcodes --- armsrc/pcf7931.c | 2 +- client/src/cmdhfcryptorf.c | 2 +- client/src/cmdhficlass.c | 10 +++++----- client/src/cmdlfpcf7931.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/armsrc/pcf7931.c b/armsrc/pcf7931.c index aea852e34..186552703 100644 --- a/armsrc/pcf7931.c +++ b/armsrc/pcf7931.c @@ -427,7 +427,7 @@ end: } */ - reply_ng(CMD_LF_PCF7931_WRITE, PM3_SUCCESS, NULL, 0); + reply_ng(CMD_LF_PCF7931_READ, PM3_SUCCESS, NULL, 0); } static void RealWritePCF7931( diff --git a/client/src/cmdhfcryptorf.c b/client/src/cmdhfcryptorf.c index 18c1a05c4..e63ca3629 100644 --- a/client/src/cmdhfcryptorf.c +++ b/client/src/cmdhfcryptorf.c @@ -209,7 +209,7 @@ int readHFCryptoRF(bool loop, bool verbose) { clearCommandBuffer(); SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)&packet, sizeof(iso14b_raw_cmd_t)); PacketResponseNG resp; - if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { + if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, 2000)) { if (loop) { if (resp.status != PM3_SUCCESS) { diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 9bd035e3a..291d365d1 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -1639,7 +1639,7 @@ static int CmdHFiClassTagSim(const char *Cmd) { PacketResponseNG resp; bool running = true; - bool arm_ended = false; // true when ARM sent its own CMD_ACK (e.g. button press) + bool arm_ended = false; // true when ARM sent its own reply (e.g. button press) // --- live FC/CN navigation (wiegand mode only; binary mode has no FC/CN to adjust) if (bin_len == 0) { @@ -1649,7 +1649,7 @@ static int CmdHFiClassTagSim(const char *Cmd) { while (running) { // A non-zero-timeout poll lets us detect when the ARM ends the sim - if (WaitForResponseTimeout(CMD_ACK, &resp, 100)) { + if (WaitForResponseTimeout(CMD_HF_ICLASS_SIMULATE, &resp, 100)) { arm_ended = true; running = false; break; @@ -1760,7 +1760,7 @@ static int CmdHFiClassTagSim(const char *Cmd) { tagsim_rawmode_enter(); while (running) { - if (WaitForResponseTimeout(CMD_ACK, &resp, 100)) { + if (WaitForResponseTimeout(CMD_HF_ICLASS_SIMULATE, &resp, 100)) { arm_ended = true; running = false; break; @@ -1776,10 +1776,10 @@ static int CmdHFiClassTagSim(const char *Cmd) { if (!arm_ended) { // Client exited the loop (Enter/Esc) but the ARM is still simulating. - // Tell it to stop and consume the resulting CMD_ACK so the ARM is + // Tell it to stop and consume the resulting reply so the ARM is // cleanly back in the main loop before we return. SendCommandNG(CMD_BREAK_LOOP, NULL, 0); - WaitForResponseTimeout(CMD_ACK, &resp, 2000); + WaitForResponseTimeout(CMD_HF_ICLASS_SIMULATE, &resp, 2000); } PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("hf iclass esave -h") "` to save the emulator memory to file"); diff --git a/client/src/cmdlfpcf7931.c b/client/src/cmdlfpcf7931.c index dafbc7ab6..de8d69a74 100644 --- a/client/src/cmdlfpcf7931.c +++ b/client/src/cmdlfpcf7931.c @@ -80,7 +80,7 @@ static int CmdLFPCF7931Reader(const char *Cmd) { PacketResponseNG resp; clearCommandBuffer(); SendCommandNG(CMD_LF_PCF7931_READ, NULL, 0); - if (WaitForResponseTimeout(CMD_ACK, &resp, 2500) == false) { + if (WaitForResponseTimeout(CMD_LF_PCF7931_READ, &resp, 2500) == false) { PrintAndLogEx(WARNING, "command execution time out"); return PM3_ETIMEOUT; }