diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index f5e649a2a..3db9112af 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -2391,11 +2391,11 @@ void MifareCIdent(bool is_mfc) { if (res == 2) { // Check for Magic Gen4 GTU with default password : - // Get config should return 30 bytes. + // Get config should return 30 or 32 bytes AddCrc14A(gen4GetConf, sizeof(gen4GetConf) - 2); ReaderTransmit(gen4GetConf, sizeof(gen4GetConf), NULL); res = ReaderReceive(buf, par); - if (res == 32) { + if (res == 32 || res == 34) { isGen = MAGIC_GEN_4GTU; goto OUT; } diff --git a/client/luascripts/hf_mf_ultimatecard.lua b/client/luascripts/hf_mf_ultimatecard.lua index b9011c36f..4a70935bb 100644 --- a/client/luascripts/hf_mf_ultimatecard.lua +++ b/client/luascripts/hf_mf_ultimatecard.lua @@ -186,7 +186,7 @@ local function read_config() atqaf = atqa1..' '..atqa2 cardtype, cardprotocol, gtustr, atsstr = 'unknown', 'unknown', 'unknown', 'unknown' if magicconfig == nil then lib14a.disconnect(); return nil, "can't read configuration, "..err_lock end - if #magicconfig ~= 64 then lib14a.disconnect(); return nil, "partial read of configuration, "..err_lock end + if #magicconfig ~= 64 and #magicconfig ~= 68 then lib14a.disconnect(); return nil, "partial read of configuration, "..err_lock end if gtumode == '00' then gtustr = 'Pre-write/Shadow Mode' elseif gtumode == '01' then gtustr = 'Restore Mode' elseif gtumode == '02' then gtustr = 'Disabled' diff --git a/doc/magic_cards_notes.md b/doc/magic_cards_notes.md index 7b494d65c..c8decbfe2 100644 --- a/doc/magic_cards_notes.md +++ b/doc/magic_cards_notes.md @@ -1009,7 +1009,7 @@ The card will be identified only if the password is the default one. One can ide ``` hf 14a raw -s -c -t 1000 CF00000000C6 ``` -If the card is an Ultimate Magic Card, it returns 30 bytes. +If the card is an Ultimate Magic Card, it returns 30 or 32 bytes. ### Magic commands ^[Top](#top) ^^[Gen4](#g4top) @@ -1133,7 +1133,7 @@ hf 14a raw -s -c -t 1000 CF00000000CE02 ... ``` -👉 **TODO** In Mifare Ultralight / NTAG mode, the special writes (option -s, -e, -r) do not apply. Use `script run hf_mf_ultimatecard` for UID and signature, and `hf mfu wrbl` for PWD and PACK. +👉 **TODO** In Mifare Ultralight / NTAG mode, the special writes (`hf mfu restore` option `-s`, `-e`, `-r`) do not apply. Use `script run hf_mf_ultimatecard` for UID and signature, and `hf mfu wrbl` for PWD and PACK. ### Change ATQA / SAK ^[Top](#top) ^^[Gen4](#g4top)