Commit Graph
1520 Commits
Author SHA1 Message Date
abou28andClaude Opus 5.5 537114da6c em4x50: keep the PR to the listen window fix
Per review, drop `lf em 4x50 config`, lf_em4x50_tune.lua, the debug
capture and the doc/commands.* changes. Reader timings go back to the
upstream constants; only the RM delay is new (132 cycles, centre of
the 104-164 range that worked).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 08:50:34 +01:00
abou28andClaude Opus 5.5 55aa198a04 Merge upstream master into em4x50-liw-sync-fix-pr
Resolve CHANGELOG.md: keep both the EM4x50 entries and the entries
from #3758.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:24:56 +01:00
Iceman 46a5a7209f Merge branch 'master' into fix-destron-sim
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-08 08:22:37 +08:00
abou28andClaude Opus 5.5 6c6032f4de Merge upstream master into em4x50-liw-sync-fix-pr
Resolve CHANGELOG.md: keep both the EM4x50 entries and the entries
from #3759.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:05:06 +01:00
Gabriele GristinaandClaude Opus 5.5 745c78d29e lf fdxb: ISO 11784 fields, Bio-Thermo clone/sim, sim and reader fixes
demod splits the starting digit from the reserved bits, writes the
animal code as CCC NNNNNNNNNNNN, knows all 249 ISO 3166-1 countries
and shows Bio-Thermo only for the chips' exact trailer. clone and sim
refuse values the frame can't carry, sim sends the data block flag for
--extended 000000 and stops with Enter, reader also tries 125 kHz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 22:07:54 +01:00
Gabriele GristinaandClaude Opus 5.5 5bc67a0d1c lf destron: implement sim, refuse uids the frame can't carry
lf destron sim only printed "To be implemented". It now sends the
frame that lf destron clone writes, FSK2 RF/50 as in the clone's T5577
config. Both take 5 bytes of 00-7F: clone wrote a byte above 7F
without its top bit and padded a short uid with FF of bad parity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 20:01:51 +01:00
abou28andClaude Opus 5.5 54751d8b5e Merge upstream master into em4x50-liw-sync-fix-pr
Resolve CHANGELOG.md: keep both the EM4x50 entries and the entries
from #3743.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 02:47:17 +01:00
Iceman 4b5eadd32b Merge branch 'master' into feat/supercard-gen2-uid-write
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-07 09:46:11 +08:00
abou28andClaude Opus 5.5 21e2dced23 Merge upstream master into em4x50-liw-sync-fix-pr
Resolve CHANGELOG.md: keep both the EM4x50 entries and the entries
from #3753.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 02:43:22 +01:00
Iceman 0bb60083d8 Merge branch 'master' into fix-wiegand-formats
Signed-off-by: Iceman <iceman@iuse.se>
2026-11-07 09:41:56 +08:00
abou28andClaude Opus 5.5 38f6cb966f Merge upstream master into em4x50-liw-sync-fix-pr
Resolve CHANGELOG.md: keep both the EM4x50 entries and the entries
from #3756, #3757.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 02:39:41 +01:00
Gabriele GristinaandClaude Opus 5.5 49e5b502f5 lf keri: refuse values the frame can't carry, print the sim id
clone took negative FC and CN, and MS values above 5 and 22 bits,
without a word: MS FC 40 wrote the card of FC 8. sim let ids of 32
bits or more change the fixed bits, so --id 2147483648 simulated id 0,
and printed the shifted frame as Internal Id. The sim help example
used --cn, the option is --id, and the clone hint named lf keri read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 00:25:21 +01:00
Gabriele GristinaandClaude Opus 5.5 3e7de8a116 wiegand: fix HPP32, H10320, S12906b, HGen37, format limits, list usage
HPP32 wrote its card number 10 bits past the 32-bit frame, it now uses
bits 13-30 as cardinfo shows. H10320 wrote its first digit over the
leading one, so decode refused most numbers, and two of its parity
masks had typos. S12906b needed ParityValid, which no caller sets.
HGen37 decode checked bit 28 instead of 26. The limits of nine formats
did not match the fields Pack writes. wiegand list printed the usage
of wiegand info.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 23:42:11 +01:00
Mykhailo ShevchukandClaude Opus 5 c2f83fc314 hf mf supercard - UID write on super card generation 2
The gen2 branch refused `-u` with "Not supported on this card". These
cards do take a UID write: a five command knock, the new UID one byte
per command (always seven commands, zero padded), then a HLTA which
commits it. The card answers the halt instead of staying silent, and
without it everything before is discarded when the field drops - which
is why the sequence is absent from the vendor app, whose HLTA is emitted
by the Android NFC stack on teardown.

The new UID must match the card's current UID length, the parts are
physically 4b or 7b. Outcome is decided by re-selecting and comparing
the UID, not by the status byte.

Verified on a 4 byte card. The 7 byte path is inferred from the sequence
always carrying seven UID bytes and is untested.

A refused -r / -u now returns an error instead of PM3_SUCCESS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-05 16:05:13 +02:00
abou28andClaude Opus 5.5 0f777089a4 em4x50: fix listen window sync, add runtime reader timings
Every bidirectional EM4x50 command (rdbl, info, dump, lf search) failed
on a PM3 Easy with a 500 uH antenna, while `lf em 4x50 reader` worked.
A raw ADC capture of the exchange showed RM being sent into the tag data
right after the double listen window: find_em4x50_tag() consumes the
first window, the second one is then taken as the first, and
invalid_bit() cannot reject data because its single 3/4-bit sample of
the AC-coupled, saturating signal always sits between g_Low and g_High.

- detect the second listen window by the absence of a rising edge over
  its 128-cycle low phase (Manchester data has one per bit)
- `lf em 4x50 config` (CMD_LF_EM4X50_CONFIG): threshold, pulse
  tolerance, "0" bit gap start/end and RM delay, changeable at runtime
- defaults moved to the centres of the working ranges measured with the
  new lf_em4x50_tune.lua sweep: tol 10 (5-15), gap end 38 (28-50),
  rm 132 (104-164); the old gap end 32 was 4 cycles from failing
- rdbl/info retry the login + selective read for up to 1 s
- at debug level extended the whole exchange is captured into BigBuf,
  fetch it with `data samples`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 11:51:59 +01:00
Innocent Bystander dfee79d0ed Update Documentation, FPGA and BWM firmware flashing 2026-11-01 21:51:41 -05:00
M35MARandopencode agent a260d0514e HF MFU: rewrite hf mfu countertear as faithful port of mfuev1_counter_reset.py
Problem
The native hf mfu countertear used a device-side
CMD_HF_MFU_COUNTER_TEAROFF path with a static increment payload,
decided once per run. The pyscript mfuev1_counter_reset.py implements
the same attack with auto-calibration, a 3-phase attack loop,
per-attempt BD delay tuning (hunting) and stuck-value handling,
which the native command lacked.

Change
- rewrite the client command around the generic tear-off hook
  (hw tearoff) and raw INCREASE_CNT frames, mirroring the pyscript
  step by step: preflight checks, CHECK_TEARING_EVENT support gate,
  targeted repair/normalize, BD sweep calibration (working delay
  accepted only on 0xBD), and the DECREMENT -> PREPARE (0x00FFFF)
  -> RESET phases with the same increment payloads (000100 for
  decrement steps, 010000 for reset/repair)
- same delay tuning on counter movement: +1 when unchanged, -1 when
  a jump exceeds 10, delay locked after a successful decrement
- remove CMD_HF_MFU_COUNTER_TEAROFF usage from the client; device
  side stays untouched
- add Lua port client/luascripts/mfuev1_counter_reset.lua with the
  same behaviour, using core.console capture and Enter-to-stop
- regenerate doc/commands.md and doc/commands.json

Behaviour change
Same CLI shape as the pyscript (-c/-f/--DelayBD/--Delay00, legacy
-i/-l/-s/-x options removed). Console output now matches the pyscript.

Testing
gcc warningless for client, armsrc and bootrom (RDV4). make check
green. doc regenerated with GD enabled. Verified 1:1 against the
pyscript and the new Lua port on hardware (EV1 card). Not tested
here: clang, Windows/ProxSpace and macOS. No build files are touched,
so the usual client-side review applies.

Co-Authored-By: opencode agent (GLM-5.3-Flash-Free) <noreply@opencode.ai>
2026-10-24 10:10:55 +02:00
Antonio Vázquez Blanco 3a57bb112c hf seos info: Try to print more information 2026-10-21 15:05:53 +02:00
Iceman 42c1c7a76e Merge pull request #3676 from dunderhay/desfire-reader-candidate-probe
Add DESFire reader candidate-key probe
2026-10-18 14:40:53 +07:00
Daniel UnderhayandOpenAI Codex 90525502f1 Add DESFire reader candidate-key probe
Add an opt-in simulator probe that checks a reader's AES authentication continuation against a supplied candidate and stops before the final card response. Expose the result through the firmware protocol and etest bench command, and document the evidence and handshake scope.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
2026-10-18 16:03:57 +11:00
Tom HarknessandClaude Sonnet 5 27797fb7d3 doc: update PM5-FLIPPER-USAGE.md with recent CEP/FAP fixes
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-16 08:38:39 +11:00
Iceman e69ac420e1 Merge branch 'master' into codex/gdm-wipe-safety
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-15 11:06:06 +07:00
歐歪 26e762f80d chore: update command description 2026-10-15 01:33:15 +08:00
towelbyte 294fb3c504 Simulate COTAG tag implementation
New CLI command `lf cotag sim` with COTAG tag simulation implementation.

Detects COTAG reader activation sequence and emulates a COTAG tag.

Signed-off-by: andrej@towelbyte.net
2026-10-14 17:14:56 +02:00
歐歪 4405335315 chore: commands file and wording adjustment 2026-10-14 05:07:07 +08:00
歐歪andOpenAI Codex 00fb003f61 Merge upstream/master into codex/gdm-wipe-safety
Co-Authored-By: OpenAI Codex <noreply@openai.com>
2026-10-14 04:19:58 +08:00
Niel Nielsen 92c7609fc5 Add standaolne module gdb-gateway 2026-10-13 20:03:45 +02:00
Iceman 8110082977 Merge branch 'master' into fix/t55xx-detect-pwd-guard
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-13 23:36:03 +07:00
Iceman cea810820b Merge pull request #3694 from TomHarkness/doc-pm5-flipper-usage-update
doc: update PM5-FLIPPER-USAGE.md to current CEP state
2026-10-13 15:22:38 +07:00
Iceman f653da1674 Merge branch 'master' into pm5-documentation-addition
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-13 15:16:35 +07:00
Matthew Carroll 3ba49c6a61 Merge remote-tracking branch 'upstream/master' into fix/t55xx-detect-pwd-guard
# Conflicts:
#	CHANGELOG.md
2026-10-07 09:11:55 -07:00
Tom HarknessandClaude Sonnet 5 99d7b02957 doc: update PM5-FLIPPER-USAGE.md to current CEP state
RF over CEP works now that the FPGA bitstream step is done - it was
never actually CEP-blocked. Note CMD_CEP_STATUS (Hardware Status
dashboard) and the real open bug (Read Hitag2 over CEP fails with
stale cached data, firmware-side). SPI bit-order/phase is confirmed,
not pending.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-07 08:23:38 +11:00
Innocent Bystander dfe5f23ae3 Change references to sim014.bin to sim024.bin to reflect the current sim firmware. 2026-10-06 14:57:09 +02:00
Philippe Teuwen 63063bd030 tune docs for default port 18888 2026-10-02 15:05:19 +02:00
Niel Nielsen f9bd1c3010 Update default port from 7777 to 18888
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-10-02 14:17:01 +02:00
Niel Nielsen 7d339ac4dc Update default port from 7777 to 18888
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-10-02 14:17:01 +02:00
Matthew CarrollandClaude Opus 5 8917c48cde lf t55xx detect: do not send a password the PWD bit has not confirmed
`lf t55xx detect -p <pwd>` reached for the password whenever detection
failed without one, and sent it across every downlink mode and again
after a wake. On a tag that is not password protected those frames can
be taken for a write: the PWD bit gets set and the tag's data is
destroyed, leaving it locked behind whatever block 7 already held.

`lf t55xx read` and `lf t55xx dump` already guard against this. They
verify the PWD bit in the configuration block before using a password,
and expose -o/--override to bypass the check deliberately. detect had
neither, and T55xxReadBlockEx() treats a live `detect -p` as proof the
bit is set.

detect cannot run the same check -- reading the configuration is what it
is for, and the password is only reached for once that has failed -- so
the risk has to be the user's to accept. Gate it behind -o/--override to
match read and dump, and carry read's warning banner into the help.

No change in behaviour for anyone not passing -p.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-01 16:13:49 -07:00
Innocent Bystander 196c0e392e Documentation updated from feedback 2026-10-01 00:22:05 -04:00
iceman1001 2e2598bca9 style 2026-09-27 21:15:18 +02:00
Iceman 2dea00f183 Merge pull request #3670 from 0x6r1an0y/20260926-felica-raw
Add FeliCa system-specific polling
2026-09-27 19:32:25 +07:00
歐歪andOpenAI Codex 4b99a422c8 fix(mifare): make GDM wipe failure-safe
Stage and verify a valid 4-byte UID before committing the clean configuration, propagate write failures, and preserve recovery when cleanup is incomplete. Correct the sector trailer template.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
2026-09-27 05:16:53 +08:00
Philippe Teuwen 12296f4afb CEP: change to SKIP_CEP=1 and clean a bit the doc 2026-09-26 21:16:19 +02:00
Tom HarknessandClaude Sonnet 5 16024ed4a1 Make WITH_CEP default-on for PM5, add SKIP_CEP to opt out
doegox asked on PR #3668 whether CEP really needs to be guarded by a
compile flag, suggesting it ship on by default with a SKIP_CEP opt-out
instead - mirrors the existing NO_LOWBATT_SHUTDOWN/NO_LOWBATT_BEEP
opt-out pattern in common_arm/Makefile.hal. WITH_CEP is now baked into
PM5's base PLATFORM_DEFS; PLATFORM_EXTRAS=SKIP_CEP filters it back out.

No change to armsrc/Makefile (already keys off the WITH_CEP define, not
the old extras token) or to the CEP transport logic itself. Updated the
PM5-FLIPPER-USAGE doc, the CHANGELOG entry, and one stale comment in
include/pm3_cmd.h that referenced the old opt-in token.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 19:55:50 +02:00
歐歪andCodex 24e11e3d72 hf felica: support polling a selected system
Add --sys to the FeliCa reader so repeated polling can activate an Express Transit card while keeping the RF field on.

Co-Authored-By: Codex (GPT-6 Sol) <noreply@openai.com>

Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
2026-09-27 01:04:40 +08:00
Iceman cbadbf4bfe Merge branch 'master' into pm5-idle-lowpower
Signed-off-by: Iceman <iceman@iuse.se>
2026-09-26 21:51:29 +07:00
Iceman 9ba8b13da6 Merge pull request #3653 from 0x6r1an0y/20260917-15magic-fix
Improve `hf 15 csetuid` command
2026-09-26 21:48:47 +07:00
Tom HarknessandClaude Sonnet 5 2b5e3e51eb Add PM5 CEP transport for Flipper Zero (WITH_CEP)
Wire up the previously-dead Flipper Zero handshake/SPI code from
at32_unit_test.c into a real WITH_CEP platform extra, independent of
BWM (new g_reply_via_cep flag, not reusing BWM's g_reply_via_fpc, so
both transports can run concurrently).

Fixes a real reconnect bug found during hardware bring-up: the
handshake listener was gated on a CC-controller attach edge that
didn't reliably fire on every FAP relaunch, requiring a physical
cable replug to reconnect. Now watches for a fresh incoming byte any
time the link reports attached, with a bounded receive timeout so a
stray byte can never hang the main loop.

RF/FPGA-dependent functionality (hf/lf reads) is out of scope here -
tracked separately. Closes #3667.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 09:45:51 -04:00
MsprgandClaude Fable 5.1 39bbf20cce pm5: hw bwm ble, the module's BLE settings incl. on/off and pairing
The module ships with BLE open: anyone in range can connect and run
commands, and there was no way to turn the radio off or to require
pairing from the PM5, although the module already implements bonding
with a static passkey (LE Secure Connections + MITM, SPP characteristic
encrypted) behind commands nothing exposed.

New CMD_PM5_BWM_BLE (0x0183): one action byte, then a full status
snapshot back (bwm_ble_status_t: switch, state, bonding, passkey, TX
power, address, name, bonded devices). Client menu `hw bwm ble`:
  status              everything above, with a warning while open
  on | off            persisted radio switch (needs the companion
                      Proxmark5_BWM_esp32 PR; off =
                      nothing can connect, USB/WiFi only)
  pairing on|off [-k] require the 6-digit passkey, set the passkey; a
                      change of on/off restarts the stack (drops a
                      connected client), the factory key 123456 is
                      flagged
  forget -i N | --all remove bonded devices
  txpower -a/-c dBm   advertising / connection power, -24..18 and 20

The firmware replies before restarting the stack so the reply survives
when the command itself arrived over BLE. Fields a module without the
switch cannot answer read 0xFF and print as unknown. A module that does
not answer at all ends the status snapshot after its first query instead
of running into the client's timeout.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 10:33:47 +02:00
MsprgandClaude Fable 5.1 0cd1fada0e pm5: auto power-off: idle timeout, unplug switch, stored on the BWM
The USB-unplug power-off left two ways to drain the battery: a PM5
woken by the button and forgotten, and one left idle after the phone
disconnected.

Idle trigger (opt-in, PM5_AUTOOFF_IDLE_MS 0 by default so out of the box
only the unplug trigger exists, as before): on battery the board powers
off after the idle timeout with no interaction and no wireless client.
Interaction is a received command over any transport, any button press,
or a client connecting or leaving; a standalone mode or a long-running
command holds the main loop, so neither can be cut short. The BWM
reports its clients with the LINK_STATE broadcast (8092, companion
Proxmark5_BWM_esp32 PR) which bwm_forward.c tracks; at boot the BLE
half is seeded with a status query since the module only reports
changes. When the timer is due but a client is still tracked, the module
is asked for its BLE state (at most every 10 s), so a lost "client left"
broadcast cannot pin the board on. And right before going off the module
is asked once more: older module firmware never sends the broadcast and
a "connected" one can get lost, and neither may power the board off
under a silent BLE client. No answer means off.

--unplug off: the unplug trigger always won, so "survive the unplug, go
off after N idle seconds" was not reachable. It is its own setting
(default on = unchanged). With it off an unplug only restarts the idle
clock - from the unplug, not from the last command, or a board that sat
idle on USB for an hour would still die with the cable. Unplug detection
is edge-based (VUSB present at the previous poll, absent at this one)
instead of "absent and seen since boot", which would fire on every poll
after a tolerated unplug. VUSB is followed while the feature is switched
off too, so switching it on again on battery is not taken for an unplug.

Stored on the BWM: runtime-only settings reset at every boot, which is
exactly when the idle trigger matters. The PM5 has no settings store, so
the switch, the idle timeout and the unplug switch live in the module's
host value slots (APP_CMD_SET/GET_SYS_HOST_VALUE 1021/1022, companion
PR; slot 0 switch, 1 idle seconds, 2 unplug), loaded at the first
auto-off poll and saved by CMD_PM5_BWM_AUTOOFF with 1 s per write, so a
silent or older module still leaves the reply inside the client's 5 s
wait. Without a module, or with an older one, the defaults apply and the
status says "not stored".

hw bwm autooff [on|off] [--idle <sec>] [--unplug <on|off>]; no argument
shows the state, one fact per line: switch, idle timeout, unplug
power-off, stored on module, USB power, USB seen since boot, unplug
trigger armed, tracked client, the module's BLE state, idle time.
Payload [action][enabled][idle_s u32][unplug, optional] with keep
sentinels; both actions are non-zero so an old firmware, which reads
byte 0 as the enable flag, can only be left enabled. hw status prints
the module's live BLE state and the auto power-off setting; at debug
level also the tracked client, which should agree with the live state.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 10:33:46 +02:00
MsprgandClaude Fable 5.1 5e1b04def1 pm5: hw bwm wifipower, WiFi off or the modem power-save type
New `hw bwm wifipower [off|none|min|max]`. `off` turns the BWM's WiFi
fully off (BLE-only, persisted; the same path as `hw bwm wifi stop`,
and the module's default state). The other three set the ESP's persisted
WiFi modem power-save type (CMD_PM5_BWM_WIFI_PS 0x0182, module commands
2052/2053, esp_wifi_set_ps()) used while WiFi is up: min (the ESP-IDF
default, the modem sleeps between DTIM beacons), max (sleeps for the
whole listen interval, lowest current, slower to react), none (modem
always on, lowest latency). With no argument it reports whether WiFi is
up at all and the stored type. Independent of `hw bwm powersave`.

The link helper's "cmd failed" diagnostic is now printed only at debug
level: a status query while WiFi is off fails by design and was
cluttering every call.

Verified on hardware: default reads min with WiFi off; none, max and
min each set and read back; off tears WiFi down; an unknown value is
rejected; max survives a module reboot. Not measured with WiFi
associated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 10:33:46 +02:00