chg "hf mf cwipe" - textual and also use magic wipe card

This commit is contained in:
iceman1001 2020-06-10 08:43:29 +02:00
parent 92aaf5c416
commit cb22004635

View file

@ -883,8 +883,11 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
int res;
for (int blockNo = 0; blockNo < 4 * 16; blockNo++) {
for (int retry = 0; retry < 3; retry++) {
PrintAndLogEx(INPLACE, "wipe block %d", blockNo);
if (blockNo == 0) {
res = mfCSetBlock(blockNo, block0, NULL, params);
res = mfCSetBlock(blockNo, block0, NULL, (params | MAGIC_WIPE));
} else {
if (mfIsSectorTrailer(blockNo))
res = mfCSetBlock(blockNo, blockK, NULL, params);
@ -894,16 +897,17 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
if (res == PM3_SUCCESS)
break;
PrintAndLogEx(WARNING, "Retry block[%d]...", blockNo);
PrintAndLogEx(WARNING, "retry block %d ...", blockNo);
}
if (res) {
PrintAndLogEx(ERR, "Error setting block[%d]: %d", blockNo, res);
PrintAndLogEx(ERR, "error setting block %d (%d)", blockNo, res);
return res;
}
}
DropField();
PrintAndLogEx(NORMAL, "");
return PM3_SUCCESS;
}