fix hf mf wipe: detect properly write fails

This commit is contained in:
Philippe Teuwen committed 2024-08-08 20:12:46 +02:00
1 parent 1656f1f8ce
commit 4c811fab0a
2 files changed
+5 -4

No files matched your search

+4 -4
View File
@@ -7624,12 +7624,12 @@ static int CmdHF14AMfWipe(const char *Cmd) {
SendCommandMIX(CMD_HF_MIFARE_WRITEBL, mfFirstBlockOfSector(s) + b, kt, 0, data, sizeof(data));
PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
uint8_t isOK = resp.oldarg[0] & 0xff;
if (isOK == 0) {
PrintAndLogEx(NORMAL, "( " _RED_("fail") " )");
} else {
int isOK = resp.oldarg[0];
if (isOK > 0) {
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
break;
} else {
PrintAndLogEx(NORMAL, "( " _RED_("fail") " )");
}
} else {
PrintAndLogEx(WARNING, "Command execute timeout");