Skip to content

Commit

Permalink
changed "hf 14a info" to also give a hint for NTAG424 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Nov 7, 2023
1 parent 1beab7e commit c1ec770
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/src/cmdhf14a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,7 @@ typedef enum {
MTEMV = 128,
MTFUDAN = 256,
MTISO18092 = 512,
MT424 = 1024,
} nxp_mifare_type_t;

// Based on NXP AN10833 Rev 3.6 and NXP AN10834 Rev 4.1
Expand Down Expand Up @@ -1723,7 +1724,7 @@ static int detect_nxp_card(uint8_t sak, uint16_t atqa, uint64_t select_status) {
}

printTag("NTAG 4xx");
type |= MTDESFIRE;
type |= (MTDESFIRE | MT424);
}
} else if ((sak & 0x04) == 0x04) {
printTag("Any MIFARE CL1");
Expand Down Expand Up @@ -1920,6 +1921,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
bool isEMV = false;
bool isFUDAN = false;
bool isISO18092 = false;
bool isNTAG424 = false;
int nxptype = MTNONE;

if (card.uidlen <= 4) {
Expand All @@ -1929,6 +1931,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
isMifareDESFire = ((nxptype & MTDESFIRE) == MTDESFIRE);
isMifarePlus = ((nxptype & MTPLUS) == MTPLUS);
isMifareUltralight = ((nxptype & MTULTRALIGHT) == MTULTRALIGHT);
isNTAG424 = ((nxptype & MT424) == MT424);

if ((nxptype & MTOTHER) == MTOTHER)
isMifareClassic = true;
Expand Down Expand Up @@ -1958,6 +1961,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
isMifareDESFire = ((nxptype & MTDESFIRE) == MTDESFIRE);
isMifarePlus = ((nxptype & MTPLUS) == MTPLUS);
isMifareUltralight = ((nxptype & MTULTRALIGHT) == MTULTRALIGHT);
isNTAG424 = ((nxptype & MT424) == MT424);

if ((nxptype & MTOTHER) == MTOTHER)
isMifareClassic = true;
Expand Down Expand Up @@ -2461,6 +2465,11 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
*/
}

if (isNTAG424) {
PrintAndLogEx(HINT, "Hint: try `" _YELLOW_("hf ntag424 info") "`");
}


PrintAndLogEx(NORMAL, "");
DropField();
return select_status;
Expand Down

0 comments on commit c1ec770

Please sign in to comment.