mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
verify that there is a card on the proxmark before continuing
This commit is contained in:
parent
eff967923f
commit
2d25716704
1 changed files with 19 additions and 1 deletions
|
@ -5754,6 +5754,24 @@ int CmdHFMFNDEFFormat(const char *Cmd) {
|
|||
}
|
||||
|
||||
|
||||
// Select card to get UID/UIDLEN/ATQA/SAK information
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500) == false) {
|
||||
PrintAndLogEx(WARNING, "iso14443a card select timeout");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
uint64_t select_status = resp.oldarg[0];
|
||||
if (select_status == 0) {
|
||||
PrintAndLogEx(WARNING, "iso14443a card select failed");
|
||||
return select_status;
|
||||
}
|
||||
|
||||
DropField();
|
||||
|
||||
|
||||
// init keys to default key
|
||||
uint8_t keyA[MIFARE_4K_MAXSECTOR][MFKEY_SIZE];
|
||||
uint8_t keyB[MIFARE_4K_MAXSECTOR][MFKEY_SIZE];
|
||||
|
@ -5876,7 +5894,7 @@ skipfile:
|
|||
}
|
||||
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue