mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 07:05:40 -07:00
allow user abort when wiping
This commit is contained in:
parent
7368cccdf9
commit
7c8e9db822
1 changed files with 9 additions and 2 deletions
|
@ -5919,8 +5919,9 @@ int CmdHFMFNDEFRead(const char *Cmd) {
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
uint16_t ndef_aid = NDEF_MFC_AID;
|
uint16_t ndef_aid = NDEF_MFC_AID;
|
||||||
if (aidlen == 2)
|
if (aidlen == 2){
|
||||||
ndef_aid = (aid[0] << 8) + aid[1];
|
ndef_aid = (aid[0] << 8) + aid[1];
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t ndefkey[6] = {0};
|
uint8_t ndefkey[6] = {0};
|
||||||
memcpy(ndefkey, g_mifare_ndef_key, 6);
|
memcpy(ndefkey, g_mifare_ndef_key, 6);
|
||||||
|
@ -7007,6 +7008,7 @@ static int CmdHF14AMfWipe(const char *Cmd) {
|
||||||
PrintAndLogEx(INFO, "Forcing overwrite of sector 0 / block 0 ");
|
PrintAndLogEx(INFO, "Forcing overwrite of sector 0 / block 0 ");
|
||||||
else
|
else
|
||||||
PrintAndLogEx(INFO, "Skipping sector 0 / block 0");
|
PrintAndLogEx(INFO, "Skipping sector 0 / block 0");
|
||||||
|
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
|
||||||
uint8_t zeros[MFBLOCK_SIZE] = {0};
|
uint8_t zeros[MFBLOCK_SIZE] = {0};
|
||||||
|
@ -7018,7 +7020,12 @@ static int CmdHF14AMfWipe(const char *Cmd) {
|
||||||
|
|
||||||
for (uint8_t b = 0; b < mfNumBlocksPerSector(s); b++) {
|
for (uint8_t b = 0; b < mfNumBlocksPerSector(s); b++) {
|
||||||
|
|
||||||
// Skipp write to manufacture block if not enforced
|
if (kbd_enter_pressed()) {
|
||||||
|
PrintAndLogEx(WARNING, "\naborted via keyboard!\n");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip write to manufacture block if not enforced
|
||||||
if (s == 0 && b == 0 && gen2 == false) {
|
if (s == 0 && b == 0 && gen2 == false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue