Commit Graph
1438 Commits
Author SHA1 Message Date
iceman1001andClaude Opus 5 (1M context) 67c121f554 hf mfdes detect: sweep all key numbers, and count errors per key type
errcount was declared before the key type loop and only reset by a
non -11 result, so eleven scattered card errors during the DES pass left
the AES pass to break on its first error without trying a key.  Count
per key type instead.

With no -n, detect only ever looked at key 0.  Sweep the key numbers the
application declares (low nibble of the key settings) instead, falling
back to 0x00..0x0D when the settings are unreadable.  All keys in an
application share an algo, so the first key number that succeeds narrows
keytypes[] for the rest.  --save now stores the first key found rather
than whatever dctx was left holding, and a lost card aborts the sweep.

-n <num> behaves exactly as before.

Co-Authored-By: Claude Opus 5 (1M context)
2026-09-11 15:15:36 +02:00
iceman1001andClaude Opus 5 (1M context) cec0e800ab hf mfdes chk: detect the secure channel per application
secureChannel was the constant DACEV1, and there was no way to override
it, so a card in LRP mode could never be authenticated - chk reported no
keys on a card 'hf mfdes detect' handles fine.  When the key settings
were unreadable it gave up instead of probing.

Work the channel out per AID: the key settings give the algo, and for an
AES app one AuthenticateLRPFirst probe separates EV1/EV2 from LRP, which
the settings byte cannot.  When the settings are unreadable, fall back to
DesfireCheckAuthCommands() the way detect does.  --schann d40|ev1|ev2|lrp
pins it and skips detection.  Only AES is tried on an LRP channel.

Also clear the session after a found key, so the next key number starts a
first auth rather than an EV2/LRP non-first one.

Co-Authored-By: Claude Opus 5 (1M context)
2026-09-11 11:08:45 +02:00
iceman1001 2610d0cfc2 text 2026-09-11 10:42:33 +02:00
Innocent Bystander 1457a5d827 Add verbage to make flashing the BWM clearer 2026-09-10 01:17:06 -04:00
Innocent Bystander b3123d153f Adding BWM Flashing instructions to PM5 Documentation 2026-09-09 21:14:26 -04:00
Iceman 9f641c3ced Merge pull request #3427 from Sanduuz/feature/st25ta_ndef_sim
Added support for emulating ST25TA tag (IKEA Rothult) with custom NDEF response
2026-09-07 15:38:46 +07:00
Iceman e807ef0df7 Merge pull request #3497 from 0x6r1an0y/20260823-uscuiddoc
Update USCUID section in magic_cards_notes
2026-09-07 15:31:12 +07:00
xilni 342cc37cca docs(bwm): fix stale hw bwm command references 2026-09-07 00:07:07 -04:00
Iceman 45c1d79282 Merge branch 'master' into 20260823-mfuformat
Signed-off-by: Iceman <iceman@iuse.se>
2026-09-06 21:00:13 +07:00
Niel Nielsen 9dfc7aacf4 Refactor command syntax in PM5-BWM-USAGE.md
Updated command syntax and formatting for clarity.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-05 10:10:48 +02:00
歐歪 7bfd6b6189 docs: content clean up 2026-09-05 05:18:51 +08:00
Philippe Teuwen 47d0a8fa00 typo 2026-09-04 19:59:40 +02:00
iceman1001 1a34aac8df texts 2026-09-04 13:32:54 +02:00
Msprg d3bf03f3e3 Docs: Add PM5 BWM BLE connection instructions 2026-09-03 01:41:54 +02:00
Innocent Bystander 22fcbf60c9 Fold more PM5 exclusive resources into the PM5_Start_Here folder to speed up finding information. 2026-09-01 20:28:59 -04:00
Innocent Bystander 85b225b2c4 Changing the DFU Util section to better reflect the shortest path to recovery. 2026-09-01 20:11:02 -04:00
Philippe Teuwen 38e0c068d9 A few less hardcoded 40000 samples 2026-09-01 19:54:05 +02:00
Philippe Teuwen 18aed4eaa4 spurious hidden char 2026-09-01 14:09:49 +02:00
Philippe Teuwen 3ed5792b23 fix doc link 2026-09-01 14:07:12 +02:00
DJ Eric James bc7f0716a1 fixes 2026-08-31 23:42:38 -04:00
DJ Eric James aa189ca70c move files a bit. 2026-08-31 23:40:48 -04:00
DJ Eric James 1b4ac29a1e move files a bit. 2026-08-31 23:40:24 -04:00
DJ Eric James bfb7307216 fixes 2026-08-31 23:37:13 -04:00
DJ Eric James 7510e4faa5 fixes 2026-08-31 23:35:52 -04:00
DJ Eric James c5a67dad5f fixes 2026-08-31 23:32:59 -04:00
DJ Eric James c7915c5b83 fixes 2026-08-31 23:30:54 -04:00
DJ Eric James ab4ec63efd fixes 2026-08-31 23:29:08 -04:00
DJ Eric James 27dcb6a63c fixes 2026-08-31 23:25:55 -04:00
DJ Eric James cdf4a097bc fixes 2026-08-31 23:25:03 -04:00
DJ Eric James 4c454f387b fixes 2026-08-31 23:24:06 -04:00
DJ Eric James 50ee709954 fixes 2026-08-31 23:22:52 -04:00
DJ Eric James 7899b560a1 fixes 2026-08-31 23:19:59 -04:00
DJ Eric James b1de4b52c1 fixes 2026-08-31 23:19:03 -04:00
DJ Eric James bf230b4db4 fixes 2026-08-31 23:18:00 -04:00
DJ Eric James 6b12579546 fixes 2026-08-31 23:15:39 -04:00
DJ Eric James 52686ab6d2 fixes 2026-08-31 23:14:39 -04:00
DJ Eric James 5649bb268d fixes 2026-08-31 23:13:57 -04:00
DJ Eric James 399afc31a2 fixes 2026-08-31 20:40:58 -04:00
DJ Eric James b80be3cbf8 restructure document 2026-08-31 20:14:52 -04:00
DJ Eric James 243f1a0861 docu2 2026-08-31 19:09:36 -04:00
DJ Eric James f67eb452e3 docu2 2026-08-31 19:01:03 -04:00
DJ Eric James 703c7129fa docu2 2026-08-31 18:34:29 -04:00
DJ Eric James 448daf96b9 docu2 2026-08-31 18:33:55 -04:00
DJ Eric James 1991874159 docu2 2026-08-31 18:33:29 -04:00
DJ Eric James 0860eb749e docu2 2026-08-31 18:31:48 -04:00
DJ Eric James cdf8c03e73 docu2 2026-08-31 18:31:04 -04:00
DJ Eric James 214cb71677 docu2 2026-08-31 18:29:38 -04:00
DJ Eric James 9aa72a5d6f First Attempt 2026-08-31 17:48:00 -04:00
Niel Nielsen 50b94cf01b Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-30 17:36:56 +02:00
iceman1001 6d67465d7d hf plot: convert CMD_FPGAMEM_DOWNLOADED to NG
The FPGA trace loop was the last OLD reply on the device outside the two
the bootrom also serves. It stayed OLD because the DMA double-buffer was
sized to the frame payload and an NG header did not obviously fit in
front of it.

DMA straight into chunk->data of a download_chunk_t instead, so a filled
buffer is already a complete NG payload and needs no copy. Chunking now
follows DOWNLOAD_CHUNK_MAX and scales with PM3_CMD_DATA_SIZE. The
terminator carries download_done_t like the other bulk downloads. No
client change needed, dl_it already had the NG branch.

Two fixes fall out of it:

FPGA_TRACE_SIZE is 3072, an exact multiple of 512 but not of
DOWNLOAD_CHUNK_MAX. Each transfer is now armed for exactly the bytes
still expected - arming a full chunk for the short last one would spin in
FPGA_SSC_DMA_RX_Done() forever. This also drops the stray extra DMA the
old loop left armed.

get_tosend() moved after FpgaDownloadAndGo(). The loader calls
BigBuf_free(), which nulls s_toSend.buf, then reuses that same region for
its decompression ring buffer - the old code captured the pointer before
the free and only worked because the loader was done with it in time.

3072 bytes goes from 6 OLD frames to 7 NG frames at PM3_CMD_DATA_SIZE
512, and would be 5 at 688.
2026-08-30 14:02:18 +02:00