From 30c16b8f8f5e7f217a63297bdb9696c015f71422 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 10 Sep 2024 20:25:43 +0200 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + client/src/cmdhfmfu.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ce91b77..7dbf92393 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 364b12e9d..aee89da4e 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -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 { - tagtype = MFU_TT_UNKNOWN; + + // 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();