mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
detect desfire rudimentary
This commit is contained in:
parent
bb57d6885b
commit
8f896940b0
1 changed files with 118 additions and 94 deletions
|
@ -479,6 +479,29 @@ static int CmdHfIctCredential(const char *Cmd) {
|
|||
bool verbose = arg_get_lit(ctx, 5);
|
||||
CLIParserFree(ctx);
|
||||
|
||||
SetAPDULogging(false);
|
||||
DropField();
|
||||
|
||||
iso14a_card_select_t card;
|
||||
if (ict_select_card(&card) != PM3_SUCCESS) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
bool isdesfire = false;
|
||||
if ((card.sak & 0x24) == 0x24) {
|
||||
isdesfire = true;
|
||||
} else if ((card.sak & 0x20) == 0x20) {
|
||||
if (card.atqa[0] == 0x003&& card.atqa[1] == 0x40) {
|
||||
isdesfire = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isdesfire) {
|
||||
|
||||
// read file in desfire application
|
||||
// add decrypt sector
|
||||
|
||||
} else {
|
||||
uint16_t sc_size = mfNumBlocksPerSector(ICT_MIFARE_SECTOR) * MFBLOCK_SIZE;
|
||||
uint8_t *data = calloc(sc_size, sizeof(uint8_t));
|
||||
if (data == NULL) {
|
||||
|
@ -503,6 +526,7 @@ static int CmdHfIctCredential(const char *Cmd) {
|
|||
// add decrypt sector
|
||||
|
||||
free(data);
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue