Commit Graph
14614 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 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 53c5442a47 Merge branch 'master' into fix-mf-fchk
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-12 06:37:02 +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 0ccf04fc5a Merge branch 'master' into fix-mf-staticnested
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-11 21:53:13 +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 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 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
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 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 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
iceman1001andClaude Opus 5.5 121bafde87 hf mfu info: UL-C config section header when read protected
The "read protected" verdict sat under the silicon info without a
header. Print the UL-C Configuration header like the readable case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:59:44 +07:00
iceman1001andClaude Opus 5.5 9b9845752b hf mfu info: UL-C fingerprint as PRNG, Vendor and Chip IC lines
The fingerprint printed a bare chip name, or a PRNG line followed by
"likely MF0ICU2". Every outcome now prints the same three lines:

  PRNG......... genuine | weak | inconclusive | n/a
  Vendor....... NXP | Feiju | Giantec | Lab401 | unknown
  Chip IC...... MF0ICU2 | FJ8010 | GT23SC4489 | USCUID-UL ...

Colours follow the client convention for exploitable findings: a weak
PRNG and counterfeit or magic chips are green, a genuine PRNG is red.
mfulc_prng_test() returns its result instead of printing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:56:19 +07:00
iceman1001andClaude Opus 5.5 ff9bead6c7 hf mfu: flag UL-C cards whose key pages are not locked
BREAKMEIFYOUCAN (eprint 2026/100) recovers UL-C keys by overwriting
three of the four key pages and brute forcing the fourth. Locking the
key pages with lock byte 3 (page 0x28 byte 1, bit 7) stops it.

hf mfu info now decodes that from the config pages:
  locked    - key pages locked (red)
  relay     - writable after authentication, relayed auth 75% (green)
  unlocked  - AUTH0 >= 0x2F, pages 0x2C..0x2E writable without auth,
              partial key overwrite (green)
and says when the config is read protected. A hint at the end of the
output names the attack and `hf mfu desbrute --reader`.

The same check runs on dumps: `hf mfu view -v`, and new -v flags on
`hf mfu dump` and `hf mfu eview`. Partial dumps stay silent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:55:56 +07:00
Iceman a61428e58a Merge branch 'master' into pcf7931-config-check
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-11 04:38:59 +08:00
GiacoBotandClaude Opus 5.5 616912bbc7 lf pcf7931 config: refuse out of range delay and offsets
The delay was masked to 16 bits and the offsets cut to int8 when sent,
so e.g. -d 70000 silently became 4464us.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:32:03 +01:00
GiacoBotandClaude Opus 5.5 78651301a6 lf pcf7931 write: fix device freeze, missing reply and write timing
- SendCmdPCF7931: track elapsed time in 32 bits. The 16-bit precision
  counter wraps ~3 times per write frame and the old single-overflow
  compensation made the wait loop never end (device freeze, nothing sent)
- WritePCF7931: send the missing reply_ng, the client always timed out
- SendCmdPCF7931: field off 50ms first so init_delay counts from a tag
  reset (tRESET <= 20ms); a write right after a read always failed
- client: default init_delay 17450us, centre of the measured working
  window 17400-17500us (17300 and 17600 fail)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:31:49 +01:00
iceman1001andClaude Opus 5.5 01282dbd21 hw bwm wifi: only suggest "hw bwm wifi status" when the join may still succeed
The DHCP hint was printed for every failure, also for a refused join such
as "network not found". bwm_wifi_forward_up() now returns PM3_ENODATA when
there is no IP yet but no refusal (joined without a lease, or timed out)
and PM3_EFAILED for a refused join; the client hints only on PM3_ENODATA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 22:08:08 +07:00
iceman1001andClaude Opus 5.5 063037624b flash: print the bootloader BWM link line once
get_proxmark_state() runs twice per flash (in enter_bootloader() and again
in flash_start_flashing()), so with the PM5 already in boot mode
"Bootloader BWM link at 921600 baud" was printed twice. Only the second,
post-bootloader query reports it now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 22:08:08 +07:00
Iceman 41629f1d94 Merge branch 'master' into fix-nexwatch-clone
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-10 21:57:30 +08:00
Gabriele GristinaandClaude Opus 5.5 4bc7d0cab3 lf nexwatch: fix clone --psk2 block 4 and its use with --q5 or --em
--psk2 set maxblock 4 but wrote blocks 1-3 only, so the tag sent block 4
with whatever it held, and with --q5 or --em it wrote its T55x7 config
block to a Q5 or EM4305.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:37:05 +01:00
Gabriele GristinaandClaude Opus 5.5 6b8551eacd lf nexwatch: fix clone -m default, limits and conflicting options
clone wrote mode 0 for a --cn without -m, used -1 as "no --cn", cut ids
above 32 bits, turned modes above 15 into 1, ORed -m into a --raw
without fixing its parity and checksum, and accepted a short --raw and
conflicting options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:56:12 +01:00