hf 14a info - ntag21x identification

This commit is contained in:
iceman1001 2020-09-10 20:40:12 +02:00
commit 866f4b6313
3 changed files with 22 additions and 6 deletions

View file

@ -2242,6 +2242,7 @@ void MifareCIdent(void) {
uint8_t rec[1] = {0x00}; uint8_t rec[1] = {0x00};
uint8_t recpar[1] = {0x00}; uint8_t recpar[1] = {0x00};
uint8_t rats[4] = { ISO14443A_CMD_RATS, 0x80, 0x31, 0x73 }; uint8_t rats[4] = { ISO14443A_CMD_RATS, 0x80, 0x31, 0x73 };
uint8_t rdbl[4] = { ISO14443A_CMD_READBLOCK, 0xF0, 0x8D, 0x5f};
uint8_t *par = BigBuf_malloc(MAX_PARITY_SIZE); uint8_t *par = BigBuf_malloc(MAX_PARITY_SIZE);
uint8_t *buf = BigBuf_malloc(PM3_CMD_DATA_SIZE); uint8_t *buf = BigBuf_malloc(PM3_CMD_DATA_SIZE);
uint8_t *uid = BigBuf_malloc(10); uint8_t *uid = BigBuf_malloc(10);
@ -2319,7 +2320,18 @@ void MifareCIdent(void) {
goto OUT; goto OUT;
} }
// magic ntag test
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
SpinDelay(40);
iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);
res = iso14443a_select_card(uid, NULL, &cuid, true, 0, true);
if (res == 2) {
ReaderTransmit(rdbl, sizeof(rdbl), NULL);
res = ReaderReceive(buf, par);
if (res == 18) {
isGen = MAGIC_NTAG21X;
}
}
}; };
OUT: OUT:

View file

@ -1187,6 +1187,9 @@ int detect_classic_magic(void) {
case MAGIC_SUPER: case MAGIC_SUPER:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("super card")); PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("super card"));
break; break;
case MAGIC_NTAG21X:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("NTAG21x"));
break;
default: default:
break; break;
} }

View file

@ -220,6 +220,7 @@ ISO 7816-4 Basic interindustry commands. For command APDU's.
#define MAGIC_GEN_2 4 #define MAGIC_GEN_2 4
#define MAGIC_GEN_UNFUSED 5 #define MAGIC_GEN_UNFUSED 5
#define MAGIC_SUPER 6 #define MAGIC_SUPER 6
#define MAGIC_NTAG21X 7
/** /**
06 00 = INITIATE 06 00 = INITIATE
0E xx = SELECT ID (xx = Chip-ID) 0E xx = SELECT ID (xx = Chip-ID)