fix hf mf wipe: detect properly write fails

This commit is contained in:
Philippe Teuwen 2024-08-08 20:11:31 +02:00
commit 4c811fab0a
2 changed files with 5 additions and 4 deletions

View file

@ -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]
- Fixed `hf mf wipe` to detect properly write errors (@doegox)
- Fixed `hf mf fchk` which was leaving the RF field on when interrupted by keyboard (@doegox)
- Changed file saving: do not prepend with default path if given path is an absolute path (@doegox)
- Added few tools to crack static encrypted nonce tags such as FM11RF08S (@doegox)

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");