fixed missing waits for return OPcodes

This commit is contained in:
iceman1001
2026-08-29 17:30:07 +02:00
parent 297d5cef4b
commit 026a1c7648
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -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(
+1 -1
View File
@@ -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) {
+5 -5
View File
@@ -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");
+1 -1
View File
@@ -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;
}