Consider different behavior of some Gen4 cards. Should fix #1822

This commit is contained in:
DidierA 2022-12-04 22:25:54 +01:00
parent 4e24d463e7
commit 2f4167ee74
3 changed files with 5 additions and 5 deletions

View file

@ -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;
}

View file

@ -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'

View file

@ -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)