hf mfdes etest: place the command doc entry at top level, state the draw order

The regenerated `hf mfdes etest` object had been spliced inside the
`hf mfdes esave` object in doc/commands.json, so catalog consumers did
not see it. Moved by hand to its place among the commands, matching what
`make commands` produces for that entry.

Help and how-to said a recorded session replays byte for byte. It does
only when the queue is filled in draw order: the random UID takes 3 bytes
at --scan on a random-id image, then each authentication takes its RndB.
Say so.

Co-Authored-By: Claude Fable 5.1 (claude-fable-5-1) <noreply@anthropic.com>
This commit is contained in:
Mistial DeveloperandClaude Fable 5.1 authored and Philippe Teuwen committed 2026-09-16 22:04:01 +02:00
1 parent deab288804
commit fee9648b53
3 files changed
+12 -12

No files matched your search

+2 -2
View File
@@ -9260,8 +9260,8 @@ static int CmdHF14ADesETest(const char *Cmd) {
"Drive the DESFire simulation from the host over USB, no RF involved.\n"
"The card image in emulator memory answers each --apdu, native or ISO 7816\n"
"wrapped, as `hf mfdes sim` would over the air. Bytes given with --random are\n"
"used for the next RndB and random UID draws, so a recorded session replays\n"
"byte for byte.\n"
"drawn in order by the next random UID (3, at --scan on a random-id image) and\n"
"RndB (8 or 16, at the next authentication), so a recorded session can be replayed.\n"
"\n"
"One action per call. Load an image first with `hf mfdes eload`",
"hf mfdes etest --begin\n"
+9 -9
View File
@@ -7899,9 +7899,17 @@
"hf mfdes esave -f myfile --keep -> keep applications and files a reader deleted"
],
"offline": false,
"options": [
"-h, --help This help",
"-f, --file <fn> Filename, if no <fn> UID will be used as filename",
"-v, --verbose Verbose output",
"--keep Keep applications and files that were deleted"
],
"usage": "hf mfdes esave [-hv] [-f <fn>] [--keep]"
},
"hf mfdes etest": {
"command": "hf mfdes etest",
"description": "Drive the DESFire simulation from the host over USB, no RF involved. The card image in emulator memory answers each --apdu, native or ISO 7816 wrapped, as `hf mfdes sim` would over the air. Bytes given with --random are used for the next RndB and random UID draws, so a recorded session replays byte for byte. One action per call. Load an image first with `hf mfdes eload`",
"description": "Drive the DESFire simulation from the host over USB, no RF involved. The card image in emulator memory answers each --apdu, native or ISO 7816 wrapped, as `hf mfdes sim` would over the air. Bytes given with --random are drawn in order by the next random UID (3, at --scan on a random-id image) and RndB (8 or 16, at the next authentication), so a recorded session can be replayed. One action per call. Load an image first with `hf mfdes eload`",
"notes": [
"hf mfdes etest --begin",
"hf mfdes etest --scan",
@@ -7923,14 +7931,6 @@
"-j, --json One line of JSON instead of text"
],
"usage": "hf mfdes etest [-hj] [--begin] [--end] [--scan] [--apdu <hex>] [--random <hex>] [--fieldoff] [--state]"
},
"options": [
"-h, --help This help",
"-f, --file <fn> Filename, if no <fn> UID will be used as filename",
"-v, --verbose Verbose output",
"--keep Keep applications and files that were deleted"
],
"usage": "hf mfdes esave [-hv] [-f <fn>] [--keep]"
},
"hf mfdes eview": {
"command": "hf mfdes eview",
+1 -1
View File
@@ -602,7 +602,7 @@ Switch LRP mode on
`hf mfdes etest --end` - drop the state and the random queue
The simulation normally uses a fixed RndB. Queued bytes are drawn in order by the next authentication and by the next activation of a random-id card (3 bytes). A draw that finds the queue short takes nothing, falls back to the fixed value and sets the underflow flag `--state` shows.
The simulation normally uses a fixed RndB and a tick-derived random UID. Queued bytes are drawn in order: `--scan` takes 3 for the UID when the image has random ID switched on, then each authentication takes its RndB, 8 or 16 bytes by key type. On a random-id image queue the UID bytes before `--scan` and the RndB before the authentication; queuing only the RndB first would spend it on the UID. A draw that finds the queue short takes nothing, falls back to the fixed or tick-derived value and sets the underflow flag `--state` shows.
`hf mfdes etest --apdu 900A0000010000 -j` - the same, as one line of JSON for a script