Commit Graph
23855 Commits
Author SHA1 Message Date
Iceman 5ecdecafca Merge pull request #3791 from GiacoBot/lf-pcf7931-write-verify-v2
lf pcf7931 write: verify via read after write, retry when not confirmed
2026-11-12 06:41:14 +08:00
Iceman ea659cdf20 Merge pull request #3790 from GiacoBot/lf-pcf7931-reader-order-v2
lf pcf7931 reader: print blocks 0-7 in order, decode block 0/1
2026-11-12 06:39:41 +08:00
Iceman 38252cdf4c Merge branch 'master' into lf-pcf7931-reader-order-v2
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-12 06:39:15 +08:00
Iceman bdc7c03acc Merge pull request #3789 from craftbyte/patch-5
Allow executing mfdes sim without probe
2026-11-12 06:38:02 +08:00
Iceman c211215e4f Merge pull request #3792 from matrix/fix-mf-fchk
hf mf fchk: report keys and dumps not transferred to emulator memory
2026-11-12 06:37:13 +08:00
Iceman 53c5442a47 Merge branch 'master' into fix-mf-fchk
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-12 06:37:02 +08:00
Iceman a8ff834627 Merge pull request #3793 from matrix/fix-mf-chk
hf mf chk: report keys not transferred to emulator memory
2026-11-12 06:36:23 +08:00
Gabriele GristinaandClaude Opus 5.5 4f0b81d03e hf mf chk: report keys not transferred to emulator memory
With `--emu`, `hf mf chk` printed "Found keys have been transferred to
the emulator memory" and returned success whatever mf_elm_set_mem()
gave. It now checks that status, stops the transfer at the first
failure with fast mode off, says so and returns the status. With no
key found it wrote every trailer back and reported a transfer. It now
says "No keys found" and transfers nothing, as `hf mf fchk` does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:35:35 +01:00
Gabriele GristinaandClaude Opus 5.5 28cbc8d1a2 hf mf fchk: report keys and dumps not transferred to emulator memory
With `--emu`, `hf mf fchk` printed "Found keys have been transferred to
the emulator memory" and returned success whatever mf_elm_set_mem()
gave. It also ignored the result of FastDumpWithEcFill(), which itself
returned success after "Dump file is PARTIAL complete". The transfer
now stops at the first failure with fast mode off, says so and skips
the card fill. The fill returns the device status when both keys fail,
and the command returns the status that failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:48:39 +01:00
GiacoBotandClaude Opus 5.5 0684715c65 lf pcf7931 write: verify via read after write, retry when not confirmed
The tag never acknowledges a write, so the client printed "Done!" also
when the tag rejected it (wrong password, protected block, missed PMC
window). After a good write the tag stays silent during EEPROM access
(640T0), sends a PMC and then the programmed block, even outside
RFB..RLB, and continues as after reset (datasheet 6.4/6.5). On failure
it skips that block.

- RealWritePCF7931: keep the field on after the frame and switch to
  sampling right away (4.5 blocks). Confirm when the decoded blocks
  follow the read-after-write grid; when that block itself decodes,
  check the written byte and return the whole block
- DecodePCF7931: split from DemodPCF7931 to decode an existing capture;
  a block with no PMC before it gets its start from the closing PMC
- SendCmdPCF7931: frame sending split into SendFramePCF7931
- WritePCF7931: up to 3 attempts while not confirmed (a tag idle for a
  while often misses the first one); reply status and block
- client write: report confirmed with block data, confirmed by timing,
  or not confirmed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:23:08 +01:00
GiacoBotandClaude Opus 5.5 b96f56cf7b lf pcf7931 reader: give up after 3 empty captures, client timeout 20s
With the reset-aligned 12.5-block capture an empty one takes ~1.3s, so
10 of them took 13.4s against the 15s client timeout. A present tag
always decodes in the first capture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:22:46 +01:00
GiacoBotandClaude Opus 5.5 a9b5dfb97e lf pcf7931 reader: print blocks 0-7 in order, decode block 0/1
The tag does not send block numbers (datasheet 5.1, 6.1); only block 1
(sync pattern and RFB/RLB/RB1 selection) identifies positions. The
reader printed raw captures, repeated and unordered.

- ReadPCF7931: field off 50ms before each capture so it starts from a
  tag reset (first block = RFB, or block 1 with RB1, fig 10), record the
  start sample of each block and return its index in the sequence sent
  after reset in a pcf7931_read_t reply. Keep the longest capture, at
  least 10 blocks (a full cycle plus repeats)
- DemodPCF7931: capture 12.5 blocks (~0.9s) instead of 4.5, enough for
  the 9-block cycle (RB1 with a full range sends block 1 twice) to repeat
- PMC/block debug prints only at DBG_EXTENDED
- client: identify block 1 as the block whose selection explains the
  observed cycle; it must match the minimal period of the data (a single
  repeated block was taken for a 2-block selection). Print blocks 0-7
  (missing ones as not transmitted) and decode PAC, password, write
  protected blocks and selection
- client: when several blocks fit as block 1 (a full 8-block cycle is
  rotation symmetric, e.g. a user block ending in 55 C4 reads as RFB 5,
  RLB 4) pick --rfb, then the one with fewest reserved bits set (fig 8),
  else print the reset order as #n with the possible RFB values
- without block 1: print the blocks in transmission order as RFB+n, list
  the RFB values that keep block 1 out of the range, number them when
  only one is possible, or with the new --rfb option
- client: reader timeout 15s, covers the no-tag path

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:22:46 +01:00
Anže Jenšterle 9d70409027 Allow executing mfdes sim without probe
Signed-off-by: Anže Jenšterle <anze@anze.dev>
2026-11-11 18:24:21 +01:00
Iceman 88e84f927a Merge pull request #3785 from matrix/fix-mf-staticnested
hf mf staticnested: report keys not transferred to emulator memory
2026-11-11 21:53:29 +08:00
Iceman 0ccf04fc5a Merge branch 'master' into fix-mf-staticnested
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-11 21:53:13 +08:00
Iceman 740361e42a Merge pull request #3783 from matrix/fix-mf-eclr
hf mf eclr: wait for the device and report its status
2026-11-11 21:52:35 +08:00
Iceman 57ca4f8dc8 Merge branch 'master' into fix-mf-eclr
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-11 21:52:08 +08:00
Iceman 27716cea8c Merge pull request #3784 from matrix/fix-mf-nested
hf mf nested: report failed key transfers and recoveries
2026-11-11 21:51:30 +08:00
Iceman 194e2a201a Merge branch 'master' into fix-mf-nested
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-11 21:51:03 +08:00
Gabriele GristinaandClaude Opus 5.5 af63191ab2 hf mf staticnested: report keys not transferred to emulator memory
With `--emu`, `hf mf staticnested` printed "keys transferred to emulator
memory." and returned success whatever mf_elm_set_mem() gave. It now
checks that status, stops the transfer at the first failure with fast
mode off, says so and returns the status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:50:20 +01:00
iceman1001andClaude Opus 5.5 d434d60076 PM5: bundle BWM firmware V4
Release asset from RfidResearchGroup/Proxmark5_BWM_esp32 tag V4
(built Nov 11 2026 13:40:09, ESP-IDF v5.5.2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:43:04 +07:00
Gabriele GristinaandClaude Opus 5.5 114ac0b238 hf mf nested: report failed key transfers and recoveries
With `--emu`, `hf mf nested` printed "Key transferred to emulator
memory" or "keys transferred to emulator memory." and returned success
whatever mf_elm_set_mem() gave. It now checks that status, stops the
transfer at the first failure with fast mode off, says so and returns
the status. The single sector recovery also returned success when
mf_nested() failed, for example after "No valid key found". It now
returns the mf_nested() status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:54:11 +01:00
Gabriele GristinaandClaude Opus 5.5 9cd5135928 hf mf eclr: wait for the device and report its status
`hf mf eclr` returned success without waiting for the reply to
CMD_HF_MIFARE_EML_MEMCLR, and the device replied PM3_SUCCESS even
without room for the emulator memory. emlClearMem() now returns the
status of BigBuf_Clear_EM(), the device replies with it and the client
waits for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:09:32 +01:00
Iceman bb32e62481 Merge pull request #3782 from matrix/fix-mf-eload
hf mf eload: report failed emulator memory writes
2026-11-11 19:59:24 +08:00
Iceman 5f7a3043a7 Merge branch 'master' into fix-mf-eload
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-11 19:57:42 +08:00
Gabriele GristinaandClaude Opus 5.5 dfffa67063 hf mf eload: report failed emulator memory writes
The device did not answer CMD_HF_MIFARE_EML_MEMSET, so `hf mf eload`
and `hf mfu eload` printed "Done!" even when the device had no room
left for the emulator memory and nothing was written. BigBuf_Clear_EM()
then ran memset() on a NULL pointer. The device now refuses a MEMSET
packet shorter than its blocks and replies with the status, which the
client waits for. `hf mf eload` also turns fast mode off when its last
packet holds more than one block. hf_mf_tnp3_sim.lua sends the flags
byte added in 4d7d49e08, and both lua sims check the status. The
`hf mfu eload` hint loses a stray backtick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:51:47 +01:00
Iceman 7fccf68fcb Merge pull request #3781 from jmichelp/mkf-tag-formats
Mkf tag formats
2026-11-11 19:50:06 +08:00
iceman1001andClaude Opus 5.5 8039b25a2c PM5 BWM: bwm_cmd() shares the frame parser instead of dropping RX
bwm_cmd() emptied the UART RX ring before each query and its own parser
threw away every frame that was not its reply. Queries made during a
WiFi/BLE session (hw status asks five, the autooff and BLE paths more)
so ate forward-frame acks and client data:

- every eaten ack left a phantom frame in the flow-control window; the
  gate then stalled on its timeout and "forgot" frames, overrunning the
  ESP's UART ring, which lost reply frames (lines missing from hw status
  over WiFi, pings timing out)
- incoming client bytes were dropped outright

bwm_cmd() now registers the reply it expects with the shared app_com
parser (bwm_frame_expect) and pumps it, so acks, DATA_FORWARD and
LINK_STATE keep flowing while it waits. Pumping before arming replaces
the drain's job of not taking a late reply as the next one's.

Flow control: the ack timeout goes from 200 ms to 1 s (with accurate
counting it only fires on a real radio stall, and waiting beats
overrunning the ring), and the window resets after 5 s without a
forward frame, as the header promised ("drains at idle").

PM5 over WiFi, hw status speed test: ~20 KB/s with 190 forgotten frames
and lost lines -> up to ~90 KB/s (the 921600 baud UART) on a clean
link, every line and ping intact. Over a lossy link TCP retransmits
still stall it. WiFi up/down, BLE status, power save, name and OTA
checked on the PM5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:41:29 +07:00
Jean-Michel PicodandGemini 0abc8864c6 pm3_tests: cover WatchNET, LF ICT, Keri NXT, SecuraKey Short, and new Wiegand/LF sub-formats
Add offline `pm3_tests.sh` regression checks for Wiegand C37/WN55,
WatchNET, LF ICT 24X/GT 081, Keri NXT, SecuraKey Short, Indala
Keyscan 40010, AWID Cansec 37/HCC40/RBH 50-bit, G-Prox-II 40-bit,
Pyramid 35-bit, ioProx SSF, EM410x CDVI/EYEonGATE, and T55xx config
blocks.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:14 +01:00
Jean-Michel PicodandGemini f233475c5b hf 15: label AFI 0x30 as Secura Key e*Tag
Annotate AFI `0x30` as Secura Key e*Tag in `CmdHF15Info()` and
`print_tag_15693()`.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:14 +01:00
Jean-Michel PicodandGemini 566147d5a3 lf em 410x: add CDVI and EYEonGATE descramble patterns
Display CDVI (8-bit FC, 16-bit CN) and EYEonGATE (24-bit decimal ID)
output patterns in `printEM410x()`.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:14 +01:00
Jean-Michel PicodandGemini 0e5f27ae79 lf io: add Kantech SSF output and --ssf / --raw options
Print Kantech SSF formatted IDs during ioProx decoding, add `--raw` to
`lf io demod`/`clone`/`sim`, and accept `--ssf <4-hex>` (version + FC)
on `lf io clone` and `lf io sim`.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:13 +01:00
Jean-Michel PicodandGemini f0243e0a14 lf pyramid: add 35-bit format, raw demod, and fix byte parity length
Fix byte-parity removal to process the 112 payload bits separately from
the trailing 8-bit CRC8-Maxim checksum, add 35-bit Pyramid encoding/
decoding via `getPyramidBitsEx()`, add `--fmt` on `lf pyramid clone`/`sim`
and `--raw` on `lf pyramid demod`, and guard `detectPyramid()` against
truncated frame buffers.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:13 +01:00
Jean-Michel PicodandGemini 5c1cb73c24 lf gproxii: add 40-bit format support
Decode and clone 40-bit G-Prox-II frames (8-bit FC, 30-bit CN), update
help/field masks on `lf gproxii clone`, and fix spacing in raw decode
log output.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:07 +01:00
Jean-Michel PicodandGemini 0a252190a7 lf awid: add Cansec 37, Farpointe HCC40, RBH 50-bit, and raw demod
Extract Cansec 37-bit fields from AWID37 frames, add 40-bit AWID40 /
Farpointe HCC40 (6-bit FC, 32-bit CN) and RBH 50-bit (FC=4000) decoding
and encoding, and support `--raw` on `lf awid demod`.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:07 +01:00
Jean-Michel PicodandGemini 063cfe2368 lf indala: add Keyscan 40010 format and raw demod
Add Keyscan 40010 64-bit encoding/decoding (8-bit FC, 16-bit CN, odd
parity) via `decodeKeyscan40010()` and `getIndalaBits40010()`, expose
`--40010` on `lf indala sim`/`clone`/`brute`, and add `--raw` support
to `lf indala demod`.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:07 +01:00
Jean-Michel PicodandGemini 355f7113a4 lf securakey: add 64-bit SecuraKey Short support and raw demod
Detect and decode 64-bit SecuraKey Short (`0x7FC00000` preamble,
marker-free 24-bit card number), support `--raw` on `lf securakey demod`/
`clone`/`sim`, and generate/clone/simulate 64-bit Short frames via
`--cn` with T55X7_SECURAKEY_SHORT_CONFIG_BLOCK / EM4305 config blocks.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:06 +01:00
Jean-Michel PicodandGemini b9dd751483 lf keri: add Keri NXT FSK2a support and raw demod
Add FSK2a (RF/50, 128-bit) Keri NXT demodulation (with Pyramid frame
rejection), `--raw` support on `lf keri demod`/`clone`/`sim`, and
`-t n` cloning/simulation using T55x7/Q5/EM4305 FSK2a configs, plus
`-t m` simulation support.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:06 +01:00
Jean-Michel PicodandGemini b9fa4e7353 lf ict: add LF ICT (24X and GT 081) FSK2a command module
Implement LF ICT 224-bit FSK2a (RF/50, 7-block) demodulation, reader,
cloning (T55x7, Q5/T5555, EM4305/4469), and simulation (`lf ict`),
supporting Manchester-encoded ICT 24X and GT 081 payload decoding and
`lf search` integration.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:12:32 +01:00
Jean-Michel PicodandGemini 13b80df853 lf watchnet: add WatchNET FSK2a command module
Implement WatchNET 96-bit FSK2a (RF/50) demodulation, reader, cloning
(T55x7, Q5/T5555, EM4305/4469), and simulation (`lf watchnet`), with
55-bit Wiegand (21-bit FC, 32-bit CN, overlapping 27-bit parities)
encoding/decoding and `lf search` integration.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:12:32 +01:00
Jean-Michel PicodandGemini 3e61b8fb43 lf hid: set longFMT when Top is non-zero
Formats longer than 55 bits populate packed.Top while packed.Mid can be
<= 0xFFF, which caused sendTry(), CmdHIDSim(), and CmdHIDClone() to omit
long-format transmission. Include packed.Top != 0 in the longFMT check.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:11:48 +01:00
Jean-Michel PicodandGemini ee8d78db7b wiegand: add Cansec C37 and WatchNET WN55 formats
Implement Pack_C37/Unpack_C37 (37-bit Cansec with 7-bit OEM=40, 12-bit FC,
16-bit CN, even/odd parity) and Pack_WN55/Unpack_WN55 (55-bit WatchNET with
21-bit FC, 32-bit CN, and overlapping 27-bit even/odd parities) in
FormatTable.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:11:48 +01:00
Jean-Michel PicodandGemini 8f996b83ac lf t55xx: add WatchNET, LF ICT, Keri NXT, and SecuraKey Short config blocks
Define T55x7 and EM4x05 configuration block constants for WatchNET,
LF ICT (24X / GT 081), Keri NXT, and 64-bit SecuraKey Short, register
SecuraKey Short and ICT in testKnownConfigBlock(), and display these
formats in printT5x7KnownBlock0() with an enlarged output buffer.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:11:48 +01:00
iceman1001andClaude Opus 5.5 d46ad0c9b2 PM5: bundle BWM firmware V3
Release asset from RfidResearchGroup/Proxmark5_BWM_esp32 tag V3
(built Nov 11 2026 11:01:47, ESP-IDF v5.5.2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:05:03 +07:00
iceman1001andClaude Opus 5.5 cab165da4d hw status: BWM free RAM and chip lines
BWM free RAM.... free heap, plus lowest since boot and largest block on
ESP fw that reports them (APP_CMD_GET_SYS_FREE_HEAP).
BWM chip........ model, revision, package, flash maker / JEDEC id and
size (APP_CMD_GET_SYS_CHIP_INFO), omitted on ESP fw without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:05:24 +07:00
iceman1001andClaude Opus 5.5 f9b57f03de hw bwm upgrade: an OTA begin failure is no longer reported as uploaded
bwm_ota_once() returned PM3_ETIMEOUT both when OTA BEGIN timed out and
when the END ack was lost. The retry loop reads PM3_ETIMEOUT as "all
data sent", so a BEGIN timeout (e.g. upgrade re-run while the PM5 is
still resetting) printed "BWM firmware uploaded" with nothing sent and
reset the PM5 while the ESP was still erasing. BEGIN failures now return
PM3_EFAILED and take the normal retry path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:05:24 +07:00
iceman1001andClaude Opus 5.5 532e354797 hw bwm: hint "hw bwm ble on" when BLE is off, 2.4 GHz note on reason 201
With BLE off, `hw bwm ble` suggested `hw bwm ble pairing on`; it now
suggests `hw bwm ble on` and drops the pairing hint until BLE is on.
A WiFi join failing with reason 201 now says the BWM is 2.4 GHz only,
the usual cause when pointed at a 5 GHz SSID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:38:39 +07:00
iceman1001andClaude Opus 5.5 aebf9bea72 PM5: bundle BWM firmware V2
Release asset from RfidResearchGroup/Proxmark5_BWM_esp32 tag V2
(8b133b0, ESP-IDF v5.5.2). OTA-tested on PM5: V1-12-g23bfa7b -> V2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 09:15:15 +07:00
iceman1001andClaude Opus 5.5 f92b938d08 pm3_tests: cover all COTAG tag traces and the reader traces
Decode the five tag traces in traces/cotag that had no test (active
1558 / 385816, passive 2402442, Bewator 1576805 / 1576807) by card
number, and run lf search on an active and a passive trace.

The 3361, HD500 and TWN4 activation sequence traces carry no tag, so
lf cotag demod must fail on them and lf search must find nothing. That
guards the demod against reporting a card number from reader noise.

lf_cotag_reader_HD500_with_tag.pm3 is left out: lf cotag demod cannot
decode the tag inside that reader capture yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 09:13:27 +07:00
iceman1001andClaude Opus 5.5 a08c976243 hf mfu info: UL-C key page verdict in the fingerprint section
The ULC config / Attack lines are a fingerprint result, next to PRNG,
Vendor and Chip IC. hf mfu info now prints them there, including the
read protected case, and keeps the UL-C Configuration block for the
page decode only. dump / view / eview -v have no fingerprint section
and still print the verdict after the decode. Definite verdicts use
the [+] prefix like the other fingerprint lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 09:02:39 +07:00