fix #2457 - when testing cards which doesnt answer to GET_VERSION command we try to assume which card it is by looking if it can read a block or not

This commit is contained in:
iceman1001 2024-09-10 20:25:43 +02:00
commit 30c16b8f8f
2 changed files with 19 additions and 4 deletions

View file

@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Added detection for FM11NT021 (@iceman1001)
- Added detection of a magic NTAG 215 (@iceman1001)
## [Backdoor.4.18994][2024-09-10]

View file

@ -2216,7 +2216,8 @@ uint64_t GetHF14AMfU_Type(void) {
break;
}
// UL vs UL-C vs ntag203 test
// This is a test from cards that doesn't answer to GET_VERSION command
// UL vs UL-C vs NTAG203 vs FUDAN FM11NT021 (which is NTAG213 compatiable)
if (tagtype & (MFU_TT_UL | MFU_TT_UL_C | MFU_TT_NTAG_203)) {
if (ul_select(&card) == false) {
return MFU_TT_UL_ERROR;
@ -2235,22 +2236,35 @@ uint64_t GetHF14AMfU_Type(void) {
}
uint8_t data[16] = {0x00};
// read page 0x26-0x29 (last valid ntag203 page)
// if error response, its ULTRALIGHT since doesn't have that memory block
status = ul_read(0x26, data, sizeof(data));
if (status <= 1) {
tagtype = MFU_TT_UL;
} else {
// read page 0x30 (should error if it is a ntag203)
status = ul_read(0x30, data, sizeof(data));
// read page 44 / 0x2C
// if error response, its NTAG203 since doesn't have that memory block
status = ul_read(0x2C, data, sizeof(data));
if (status <= 1) {
tagtype = MFU_TT_NTAG_203;
} else {
// read page 48 / 0x30
// if response, its FUDAN FM11NT021
status = ul_read(0x30, data, sizeof(data));
if (status == sizeof(data)) {
tagtype = MFU_TT_NTAG_213;
} else {
tagtype = MFU_TT_UNKNOWN;
}
}
}
DropField();
}
}
if (tagtype & MFU_TT_UL) {
tagtype = ul_fudan_check();
DropField();