Skip to content

Commit

Permalink
Consider different behavior of some Gen4 cards. Should fix RfidResear…
Browse files Browse the repository at this point in the history
  • Loading branch information
DidierA committed Dec 5, 2022
1 parent 4e24d46 commit 2f4167e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions armsrc/mifarecmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion client/luascripts/hf_mf_ultimatecard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions doc/magic_cards_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2f4167e

Please sign in to comment.