Commit Graph
14447 Commits
Author SHA1 Message Date
Iceman e99dccf43a Merge pull request #3745 from kormax/felica-discover-hidden-environments
Allow FeliCa hidden environment discovery on SD2 cards
2026-11-06 19:36:30 +08:00
kormax 12f72fc641 Allow FeliCa hidden environment discovery on SD2 cards 2026-11-05 21:10:27 +02:00
kormax b6398169e7 Add new known FeliCa systems and services 2026-11-05 20:26:37 +02:00
kormax 0752474574 Add new known FeliCa issuer identifiers 2026-11-05 20:24:02 +02:00
Innocent Bystander dfee79d0ed Update Documentation, FPGA and BWM firmware flashing 2026-11-01 21:51:41 -05:00
Iceman 754bbae3d9 Merge pull request #3733 from xdrr/fix/seos-2k3des-get-data
SEOS: fix 2K3DES GET DATA wrap and silent APDU failures
2026-10-30 10:04:22 +08:00
Niel Nielsen e6622f2dd8 Add Basiskort (CPH) entry to aid_desfire.json
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-10-28 13:49:09 +01:00
Ben NottandCursor Grok 4.6 68d3bf2bb0 SEOS: follow ISO7816 leftover GET RESPONSE in hf seos pacs
Large GET DATA returns 61 xx. Concatenate clear 00 C0 bodies before
unwrap so 255-byte AES and 2K3DES objects print instead of exit 246.

Co-Authored-By: Cursor Grok 4.6 <noreply@cursor.com>
2026-10-28 02:46:53 -07:00
Ben NottandCursor Grok 4.6 f7388ea3a4 SEOS: fix 2K3DES GET DATA wrap and silent APDU failures
hf seos pacs on 2K3DES cards exited 236 with no message after mutual
auth. Print ExchangeAPDU14a failures, check mbedtls DES-CMAC without
mutating the caller key, decode SELECT 85 at its real length, and emit
short-form 85 when the cryptogram is under 128 bytes.

Co-Authored-By: Cursor Grok 4.6 <noreply@cursor.com>
2026-10-28 00:02:29 -07:00
Adrian 6762b812d5 Avoid hanging the bootrom after a memory dump
Bootloader memory-dump cleanup sends CMD_PING to wake the communication
thread after clearing its run flag. The thread can be waiting for another
transmit after the dump ACK, so it sends this command before exiting.
The non-BWM bootrom does not handle CMD_PING: its default dispatch enters
Fatal(), leaving the device unresponsive even though the dump succeeded.

Use CMD_DEVICE_INFO for the wakeup instead. It is already supported by the
bootloader and used to identify it before the dump. Keep the wakeup so
closing the client does not leave the communication thread waiting.

Reproduced on PM5: the dump completed, but the following reset and device
probe failed. With only the rebuilt client changed, the same test script
passed five OS-to-bootloader, memory-dump and reset-to-OS cycles, with a
successful ping after each. No firmware was flashed for this comparison.

Built the client with AppleClang through Make, CMake and experimental_lib;
client/check passed. GCC 16 compiled the changed translation unit with
-Wall -Werror. Existing macOS linker warnings remain. The full GCC host
build was not repeated because of the previously observed Apple SDK
alignment error. Linux and Windows were not tested; this change replaces
an existing protocol command without changing platform-specific code.
2026-10-27 17:11:20 +00:00
Iceman 61ede21feb Merge pull request #3725 from M35mar/mfuev1-counter-reset
HF MFU: rewrite hf mfu countertear as faithful port of mfuev1_counter_reset.py
2026-10-27 09:54:36 +07:00
Iceman 34225e6df6 Merge pull request #3722 from antoniovazquezblanco/emv
Tag EMV cards
2026-10-27 09:50:08 +07:00
kormax 1883ef3369 Fallback to SELECT via AID if Calypso card does not respect LID file select 2026-10-24 18:29:53 +03:00
M35mar a3009aedbc Merge branch 'RfidResearchGroup:master' into mfuev1-counter-reset 2026-10-24 10:48:47 +02: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
M35MAR b497afc00e client/pyscripts: harden mfuev1 counter reset
Validate counter choices 0-2, treat only 0x00/0xBD as valid
CHECK_TEARING_EVENT answers, and detect NACK replies from the raw
payload, so retry logic does not mistake a NACK for a real answer.
2026-10-24 10:09:37 +02:00
Zhaoqi XuandGrok Bot 56efde54f5 emv: fix false -Wstringop-overflow in AID list rule with AVX2
Building the client with -march=x86-64-v3 (the CentOS/RHEL 10
baseline) fails with gcc 14:

  src/emv/emvcore.c:211:24: error: writing 32 bytes into a region of
  size 22 [-Werror=stringop-overflow=]

gcc vectorizes the dash fill loop in aidlist_rule() into 32-byte
stores and loses the pos + 2 < dstlen bound. The bound was correct.
Compute the dash count with the same limit and fill it with memset,
so there is no vectorized loop store to mis-size. Output is unchanged.

Reported in #3671.

Co-Authored-By: Grok Bot <noreply@users.noreply.github.com>
2026-10-23 19:06:41 -04:00
Antonio Vázquez Blanco 6d9526f4fb Tag EMV cards 2026-10-23 13:28:28 +02:00
Antonio Vázquez Blanco aa55bfca0e HF 14a: Only hint EMV when correct AID is found 2026-10-23 08:25:24 +02:00
Iceman f34f09b90f Merge branch 'master' into seosinfo
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-23 11:15:33 +07:00
Iceman 89c6536c5f Merge branch 'master' into managekeys
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-23 11:12:47 +07:00
Iceman d66273ea3c Merge branch 'master' into aid
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-23 11:12:00 +07:00
Iceman 8691140de8 Merge pull request #3718 from antoniovazquezblanco/seoskeys
hf seos: Print a better hint on missing keys
2026-10-23 11:09:32 +07:00
Iceman 6adf5a59f2 Merge pull request #3716 from antoniovazquezblanco/seos
HF 14a: Add a SEOS hint
2026-10-23 11:07:26 +07:00
Iceman 9502e1d1b9 Merge pull request #3693 from mfcarroll/fix/psk-fc2-bandpass
lf: fall back to pm3_psk_demod for weak fc/2 PSK when the wave tracke…
2026-10-23 11:06:33 +07:00
Antonio Vázquez Blanco 3a57bb112c hf seos info: Try to print more information 2026-10-21 15:05:53 +02:00
Antonio Vázquez Blanco e582bfe9c5 mf seos managekeys: Fix table alignment 2026-10-21 13:37:22 +02:00
Antonio Vázquez Blanco 798f9f3d28 aidlist: Fix uppercase in SEOS, TeslaDAP and LA TAP AIDs 2026-10-21 13:35:29 +02:00
Antonio Vázquez Blanco 75e4e766ec hf seos: Print a better hint on missing keys 2026-10-21 13:29:14 +02:00
Antonio Vázquez Blanco 748394d0ab HF 14a: Add a SEOS hint 2026-10-21 13:11:44 +02:00
Matthew CarrollandClaude Opus 5.5 ac59f2f768 lf: reject fc/2 PSK fallback clocks off nominal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:24:28 -07:00
Matthew CarrollandClaude Opus 5.5 13b841e0b1 lf: cache the fc/2 PSK fallback per graph buffer, name its thresholds
The cache is keyed on a hash of the graph buffer contents: the buffer has
many writers and no change counter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:24:28 -07:00
Iceman 693ead0803 Merge pull request #3699 from s00se/replace-deprecated-strtok-with-strtok_r
client: replace deprecated strtok calls with strtok_r
2026-10-18 22:43:20 +07:00
s00se a2501dc6d4 Fixed ndef vcard by replacing deprecated strtok with strtok_r
Use 200112L instead of 200809L
2026-10-18 09:02:13 -06: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
Matthew Carroll 1bc32bff15 Merge remote-tracking branch 'upstream/master' into fix/psk-fc2-bandpass
# Conflicts:
#	CHANGELOG.md
2026-10-17 23:47:19 -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
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
Iceman 501d8d53f1 Merge pull request #3698 from towelbyte/towelbyte_cotag_sim
Simulate COTAG tag implementation
2026-10-15 11:04:14 +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
phaseloop a8213a6fd5 Fix example usage
Signed-off-by: phaseloop <90922095+phaseloop@users.noreply.github.com>
2026-10-14 13:36:19 +02:00
phaseloop cbad3db692 Niimbot label tag patcher - initial commit
Signed-off-by: phaseloop <90922095+phaseloop@users.noreply.github.com>
2026-10-14 13:14:37 +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
Iceman 923c11b7ae Merge branch 'master' into fix/psk-fc2-bandpass
Signed-off-by: Iceman <iceman@iuse.se>
2026-10-13 23:41:09 +07: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
Zhaoqi XuandGrok Bot 10fa02ca24 client: free graph and demod buffer save states after restore
save_graphbuffer() and save_buffer8() calloc a copy, and the restore_*()
helpers only copy out of it, so every owner leaked its save state.
check_chiptype() lost 4 * g_GraphTraceLen bytes plus the packed demod
buffer on each online `lf search` (~2 MB after the COTAG probe), and the
Visa2000 demod leaked on every `lf search`, online or offline.

Add free_buffer_savestate() and call it after the last restore in
check_chiptype(), demodTI(), demodVisa2k(), demodzx(),
try_detect_modulation() and t55xx_psk_untrim_head(), including the
early-return and success paths that never restored.

Reported with the check_chiptype() diagnosis and fix by @BeheSQ.

Fixes #3675

Co-Authored-By: Grok Bot <noreply@users.noreply.github.com>
2026-10-11 06:51:44 +08: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
Matthew CarrollandClaude Opus 5.5 7344c7d5bc lf: fall back to pm3_psk_demod for weak fc/2 PSK when the wave tracker isn't clean
At fc/2 the subcarrier is a one-sample alternation and pskRawDemod_ext finds
wave tops one sample at a time, unfiltered. On a weak tag, sample noise erases
tops; a wave then reads as four samples and counts as a phase shift, and the
bit stream fills with errors although every bit is still in the trace. A T5577
Indala at 22 mm gave the wrong card on 14 of 50 lf search reads.

PSKDemod keeps the tracker's result whenever it is clean, so nothing changes
where master already works. Otherwise, for fc/2, it tries the existing coherent
receiver pm3_psk_demod (now with an optional per-symbol magnitude output) and
keeps that only if it scores well above what level-step leakage can produce,
its bits aren't doubled or constant, and no symbol is weak. The receiver's
output is differential, so one bad decision would flip every later bit: a weak
symbol refuses the trace rather than risk a wrong card (absolute decisions with
weak symbols left to maxErr were tried and gave wrong IDs on dropouts). With no
usable clock from the caller, candidate clocks are tried largest first. Polarity is voted from the
raw level over each phase reversal, the cue pskFindFirstPhaseShift reads at the
first one. Client only; firmware is unchanged.

Base vs this change, same captures:
- T5577 Indala, live lf search: 22 mm 3 right / 14 wrong -> 50 / 0; 24 mm
  0 / 2 -> 50 / 0; 26 mm and 0-20 mm unchanged
- lf t55xx dump, live: 22 and 24 mm blocks 0-2 and page 1 correct 5/5 where
  master reads nothing; unchanged where master reads
- emulated Indala (Chameleon Ultra, clock drifting against the reader):
  lf search right / wrong 56 / 130 -> 91 / 95 of 200; every one of the 95 is
  master's own wrong ID on the same capture
- 27 PSK traces in traces/, weakened with Gaussian noise: correct 341 -> 636 of
  810, wrong IDs 83 -> 21; with recorded Proxmark noise 367 -> 553 of 648,
  33 -> 27. No lost reads and no new wrong IDs in either
- traces/lf_*.pm3 (99): lf search -1 and -1 -c output identical; 1,581
  non-PSK probes: lf search and lf t55xx detect identical
- 200 empty-field captures: no decode, either build

tools/pm3_tests.sh: a weak 24 mm Indala trace must read its ID (fails on
master), and a synthetic NRZ with an fc/2 ripple must not decode as a tag
(the level-step leakage the score check rejects).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 14:45:41 -07:00