Files
proxmark3/doc
iceman1001andClaude Opus 5 (1M context) 8fd9bcbebc hf mfdes: dump a whole card to json, and view it back
'hf mfdes dump' walked one application and printed it. It now walks
every application on the PICC, keeps what it reads, and saves a
'hf-mfdes-<UID>-dump.json' card image. '--aid' / '--isoid' / '--dfname'
still narrow it to one application, '--ns' skips the save.

The format is 'mfdes v1', written and read in fileutils.c and documented
in doc/mfdes_dump_format.md. Two decisions worth stating:

 - The PICC level is application 000000, so every key in the file says
   which AID it opens. Key version and key value are separate: a version
   with no key is the normal shape for a key that was found but never
   recovered, and a missing key never means the key is zero.

 - Every file carries a 'Read' flag. A file whose contents could not be
   fetched is recorded as unread with no data at all, rather than as a
   run of zeros. A simulator built on this must not confuse '8 bytes of
   00' with 'we could not read 8 bytes'.

'hf mfdes view -f <fn>' prints such a file with no device attached.

With no '--keys', the dump looks for 'hf-mfdes-<UID>-keys.json' by
itself, so a 'hf mfdes chk -j' run is picked up on the next dump without
naming the file again.

Two fixes fell out of testing against a DESFire EV2:

 - DesfireSetKey() calls DesfireClearContext(), which wipes command set,
   comm mode, KDF and UID, not just the key. Swapping in a per-application
   key that way left the context at 'Communication mode: n/a' and
   DesfireFillFileList() then returned junk file ids. Use
   DesfireSetKeyNoClear().

 - GetVersion and the originality signature are answered unauthenticated.
   Asking for them from inside the authenticated session produced a
   'Wrong communication mode' warning and a run of MAC mismatches.

hex_to_buffer() treats hex_max_len as a byte count while every sprint_hex*
caller passes sizeof(buf) - 1, a character count, so it writes two or
three times the buffer size. Measured, sprint_hex_inrow overflowed at
4098 input bytes. Doubling UTIL_BUFFER_SIZE_SPRINT to 16384 moves that to
8192; the mixed semantics still need auditing across ~30 call sites.

Co-Authored-By: Claude Opus 5 (1M context)
2026-09-14 09:11:38 +02:00
..
2026-08-25 17:04:52 +02:00
2026-08-25 17:04:52 +02:00
2019-05-05 00:18:18 +02:00
2021-07-13 00:35:43 -04:00
doc
2022-02-08 01:26:06 +02:00
2024-02-23 01:25:54 +02:00
2024-01-05 19:27:38 +01:00
2023-07-10 16:44:14 +02:00
2025-09-25 21:29:50 +02:00
2023-12-10 22:47:06 -05:00
2025-04-29 11:34:50 -04:00
2021-12-31 10:58:25 +01:00
2021-12-31 11:04:05 +01:00
2023-11-21 22:00:59 +02:00
2021-12-31 11:04:05 +01:00
2025-01-05 14:27:14 +01:00
2026-08-19 19:28:17 +02:00
2020-11-24 17:25:46 +11:00
2020-11-24 17:25:46 +11:00
2020-11-24 17:25:46 +11:00
2021-12-31 11:11:29 +01:00
2024-01-05 19:27:38 +01:00