mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-23 16:56:15 +08:00
chg "hf mf cwipe" - textual and also use magic wipe card
This commit is contained in:
parent
92aaf5c416
commit
cb22004635
|
@ -883,8 +883,11 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
|
||||||
int res;
|
int res;
|
||||||
for (int blockNo = 0; blockNo < 4 * 16; blockNo++) {
|
for (int blockNo = 0; blockNo < 4 * 16; blockNo++) {
|
||||||
for (int retry = 0; retry < 3; retry++) {
|
for (int retry = 0; retry < 3; retry++) {
|
||||||
|
|
||||||
|
PrintAndLogEx(INPLACE, "wipe block %d", blockNo);
|
||||||
|
|
||||||
if (blockNo == 0) {
|
if (blockNo == 0) {
|
||||||
res = mfCSetBlock(blockNo, block0, NULL, params);
|
res = mfCSetBlock(blockNo, block0, NULL, (params | MAGIC_WIPE));
|
||||||
} else {
|
} else {
|
||||||
if (mfIsSectorTrailer(blockNo))
|
if (mfIsSectorTrailer(blockNo))
|
||||||
res = mfCSetBlock(blockNo, blockK, NULL, params);
|
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)
|
if (res == PM3_SUCCESS)
|
||||||
break;
|
break;
|
||||||
PrintAndLogEx(WARNING, "Retry block[%d]...", blockNo);
|
|
||||||
|
PrintAndLogEx(WARNING, "retry block %d ...", blockNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
PrintAndLogEx(ERR, "Error setting block[%d]: %d", blockNo, res);
|
PrintAndLogEx(ERR, "error setting block %d (%d)", blockNo, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DropField();
|
DropField();
|
||||||
|
PrintAndLogEx(NORMAL, "");
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue