DarkFlippers / unleashed-firmware

Flipper Zero Unleashed Firmware
https://flipperunleashed.com
GNU General Public License v3.0
17.36k stars 1.44k forks source link

[NFC] DESfire Reading: Success on OFW, Fail on Unlshd #756

Closed zinongli closed 5 months ago

zinongli commented 5 months ago

Describe the bug.

Hi all! I am having trouble reading a Mifare DESfire EV1 card. I can read it with OFW 0.101.2. But when I try to read it with Unleashed 074, it shows 14443A(Unknown) and fail to read the DESfire specific information. If I go to additional action - Read Specific Card Type - Read MIFARE DESFire, it will stuck on "Don't Move". Some similar issues can be found on momentum which forked the NFC app from here. Other potentially relevant issues can be found in OFW 1, 2, both of which should have been fixed in this commit which have been merged here. So I don't know how much they are correlated.

An extra bit of info that might be helpful: As you can see from the Unleashed log, the version reading failed. I went into lib\nfc\protocols\mf_desfire\mf_desfire_poller.c to find mf_desfire_poller_handler_read_version line 71 to make the function to ignore the version reading failure and move on to the next step. Then it just encounters another error in the next step mf_desfire_poller_handler_read_free_memory. So my guess is it's not the specific reading of some information that went wrong.

Also here's the dump for this card. It's read from OFW.

DESdump.txt

Reproduction

I'm not sure whether this can be triggered from reading an emulation from the dump I attached. But I doubt how dump specific this issue is. Maybe reading a DESfire card can repreoduce this bug. If not, let me know what I can do and I will try my best.

Target

No response

Logs

Here are the logs from both readings respectively.

When reading with OFW 0.101.2: OFWlog.txt

When reading with Unleashed 074 UnleashedLog.txt

Anything else?

No response

zinongli commented 5 months ago

To follow up, the above PR has resolved this bug on my end.