This commit is contained in:
merlokk 2019-12-06 17:12:29 +02:00
commit 45926261db
3 changed files with 10 additions and 10 deletions

View file

@ -616,9 +616,9 @@ int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID, uint8_
}
int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
uint8_t block0[16] = {0x01, 0x02, 0x03, 0x04, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xAF};
uint8_t blockD[16] = {0x00};
uint8_t blockK[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0x77, 0x8F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
uint8_t block0[16] = {0x01, 0x02, 0x03, 0x04, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xAF};
uint8_t blockD[16] = {0x00};
uint8_t blockK[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0x77, 0x8F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
uint8_t params = MAGIC_SINGLE;
if (uid != NULL) {
@ -632,7 +632,7 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
block0[6] = atqa[1];
block0[7] = atqa[0];
}
int res;
int res;
for (int blockNo = 0; blockNo < 4 * 16; blockNo++) {
for (int retry = 0; retry < 3; retry++) {
if (blockNo == 0) {
@ -643,19 +643,19 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) {
else
res = mfCSetBlock(blockNo, blockD, NULL, params);
}
if (res == PM3_SUCCESS)
break;
PrintAndLogEx(WARNING, "Retry block[%d]...", blockNo);
}
if (res) {
PrintAndLogEx(ERR, "Error setting block[%d]: %d", blockNo, res);
return res;
}
}
DropField();
return PM3_SUCCESS;
}