Commit Graph
4196 Commits
Author SHA1 Message Date
iceman1001 7c11ff5330 added extra length checks 2026-03-24 11:13:19 +07:00
Aaron Tulino (Aaronjamt) bd7d0735ce [hf 14a] Add Mifare Plus card type for sim 2026-03-18 12:48:22 -07:00
iceman1001 09ee0ced2c reset fpga after simulation, to see if this stabilizes the device 2026-03-18 10:50:48 +07:00
Erland Waldreus d281724ca8 Correct return value type int in EmGetCmd
The return false would trigger unwanted behaviour as emulation completed with button pressed.
2026-03-17 15:17:50 +01:00
xNovyz 6b5eee46af hf 14b tearoff: dramatically speed up tear-off loop timings
- Reinitialize BigBuf memory before FpgaSetupSsc to reset PDC internal buffer pointers
- With properly reset DMA pointers, the field stabilization time can be safely reduced from 5.0ms down to 0.25ms (which matches the timing originally intended by the near-field-chaos patch)
- Further reduced the ST25TB charge capacitor drain wait time from 10ms to an aggressive 0.5ms (the tRST minimum specified in ST25TB datasheet)
2026-03-14 22:44:12 +01:00
Christian Zanon 5b2e805c73 Update start delay comment
Signed-off-by: Christian Zanon <105173223+xNovyz@users.noreply.github.com>
2026-03-13 13:02:34 +01:00
Christian Zanon b9ddb038b7 Merge branch 'master' into hf-14b-tearoff
Signed-off-by: Christian Zanon <105173223+xNovyz@users.noreply.github.com>
2026-03-13 11:39:06 +01:00
xNovyz 52676ebbd4 style: whitespace fixes 2026-03-11 22:41:21 +01:00
xNovyz 286df8f4eb feat(14b): add interactive hf 14b tearoff command
Add an interactive command for performing tear-off attacks on ST25TB/SRx
monotonic counter blocks. This exploits EEPROM tearing to increment
counters that normally can only be decremented, based on the
near-field-chaos project by SecLabz.

The command sweeps tear-off timing from --start downward in --adj
microsecond steps, automatically consolidates partial writes, verifies
stability across multiple reads, and reports progress in real-time with
color-coded output.

Performance optimizations:
- One-time full iso14443b_setup() at start; subsequent field cycles use
  lightweight tearoff_field_on()/tearoff_field_off() that skip FPGA
  bitstream reload and buffer reallocation
- Periodic CMD_WTX keepalives to prevent USB timeouts during long attacks
- Calls FpgaResetBitstream() on exit to ensure clean FPGA state

Usage: hf 14b tearoff -b <block> -d <target> [--start <us>] [--adj <us>]
2026-03-11 21:43:37 +01:00
pingu2211 3d5f1df093 Pull docs out for all the existing stand alone modes, including a diagram and what do the lights mean, so users don't have to go digging in source code 2026-03-11 14:57:06 +11:00
xNovyz 0151c0d710 fix(fpga): add FpgaResetBitstream() to force re-initialization
After aggressive field cycling (e.g. tear-off attacks), the FPGA's
internal SSC/DMA state can become corrupted even though the bitstream
is technically loaded. FpgaDownloadAndGo() caches downloaded_bitstream
and skips re-download if it matches, so subsequent commands fail
silently or hang.

Add FpgaResetBitstream() which sets downloaded_bitstream to
FPGA_BITSTREAM_UNKNOWN, forcing the next FpgaDownloadAndGo() to
perform a complete reload.
2026-03-10 23:06:41 +01:00
xNovyz 57f200d107 fix(iso14443b): add WDT_HIT and timeout to DMA receive loop
In Get14443bAnswerFromTag(), the behindBy == 0 idle loop (waiting for
FPGA DMA samples) had no watchdog kick, no button check, and no
timeout. If the FPGA stops providing the SSC clock, this loop spins
infinitely until the hardware watchdog triggers a reboot.

Add WDT_HIT(), BUTTON_PRESS() check, and a 200ms failsafe timeout
using GetTickCountDelta() to prevent infinite spins.
2026-03-10 23:06:28 +01:00
Antiklesys 5041fbffa7 Added --creidit option for hf iclass legrec
Added --creidit option for hf iclass legrec
2026-03-05 19:32:52 +08:00
kormax f855866ce0 Handle inverted polarity RX frames in 'hf felica' 2026-03-04 09:49:23 +02:00
Aaron Tulino (Aaronjamt) a468265f5e [14a sniff] Stop sniff with Enter key 2026-02-26 02:51:26 -07:00
iceman1001 338ab9c81a Revert "Release v4.21128 - Permafrost"
This reverts commit b10235b03b.
2026-02-25 16:15:01 +01:00
iceman1001 b10235b03b Release v4.21128 - Permafrost 2026-02-25 16:15:01 +01:00
Philippe Teuwen b8a5e7b656 hf mf cauth/aesauth/cchk/aeschk: make fast READ0 optional 2026-02-24 16:46:00 +01:00
Philippe Teuwen 118652bd90 CMD_HF_DECAY: factor with structs, remove cast align warning 2026-02-21 23:54:51 +01:00
Philippe Teuwen 5458a95fda avoid cppcheck errors on uninit vars 2026-02-21 14:14:50 +01:00
Philippe Teuwen b62658f5ac make style 2026-02-21 12:43:25 +01:00
Philippe Teuwen 89d60fc2cb PoC Standalone mode: unlock Ultralight C / AES tags 2026-02-21 00:07:50 +01:00
michael fe878be492 Added a new command (hw decay [which monitors the decay rate of the hf antenna cap]) and updated hw tune to detect booster boards and if the pm3 easy is on a metal surface 2026-02-18 15:51:08 -08:00
kormax c6675018b3 felica: use NG frames for commands 2026-02-15 19:04:22 +02:00
Iceman 3d039d84cf Merge pull request #3095 from kormax/felica-dump-fix-missing-trace
hf felica dump: vastly improve speed; fix traces being empty
2026-02-15 12:09:43 +01:00
kormax 2721b13792 hf felica dump: vastly improve speed; fix traces being empty after command execution 2026-02-14 15:36:28 +02:00
Philippe Teuwen d6f74b342e Make sure RAMFUNC is not inlined, else it won't be in RAM.
Some static RAMFUNC got inlined which means they weren't relocated in RAM.
By forcing noinline on RAMFUNC, the following functions move to RAM:

F .data 00000034 optimizedSniff
F .data 00000148 skipSniff
F .data 000002c8 ManchesterDecoding_Thinfilm

But ManchesterDecoding_Thinfilm worked fine without being in RAM,
so we remove its RAMFUNC attribute and it works as previously,
and avoid eating some RAM bytes.

In summary, impacted command is only:

hf sniff
2026-02-11 14:19:05 +01:00
Philippe Teuwen 7c4758f40b ulaes: add verify_cmac, display counters in mfu info, fix sig when schann in mfu info 2026-02-09 12:44:50 +01:00
Philippe Teuwen 9f70011fee hf mfu setkey: supports ulc/ulaes auth and ulaes schann 2026-02-09 01:08:23 +01:00
Philippe Teuwen a4291f676f ulaes cmac: fix 14a raw 2026-02-08 22:56:33 +01:00
Philippe Teuwen 54b4459f45 ulaes cmac: reuse cmac api for read/write 2026-02-08 22:24:00 +01:00
Philippe Teuwen aeb28b36f2 cppcheck: fix warning on mixing boolean and bitwise operations 2026-02-06 22:19:28 +01:00
Philippe Teuwen cb1f66f9f4 cppcheck: fix size of pointer <> size of data 2026-02-06 22:19:11 +01:00
Philippe Teuwen 73df0e186b cppcheck: fix null ptr dereference warning 2026-02-06 16:00:29 +01:00
Philippe Teuwen 3234c2ba47 cppcheck: fix redundant condition 2026-02-06 14:34:26 +01:00
Philippe Teuwen c00e4801b7 make style 2026-02-06 13:43:41 +01:00
Philippe Teuwen 04bbd03347 hf mfu sim -t 13/14: hide key bytes on read, and refresh on compat write 2026-01-29 18:53:12 +01:00
Philippe Teuwen a26892a891 Add hf mfu cchk/aeschk and options to hf mf cauth/aesauth 2026-01-19 21:47:49 +01:00
Philippe Teuwen faca1550b8 hf mfu sim: add support to inject card replies 2026-01-19 21:47:49 +01:00
DXL 621af43a1d Merge branch 'master' into master
Signed-off-by: DXL <64101226@qq.com>
2025-12-24 20:17:37 +08:00
dxl 213c134bdc staticnested faild to find a KeyB
Fixes #2938
2025-12-24 20:02:43 +08:00
Aaron Tulino (Aaronjamt) 53306abd5e Reduce array usages in Seos simulation 2025-12-22 17:53:32 -07:00
Aaron Tulino (Aaronjamt) b7f9e3c41d Correct ATS in iso14443a
Turns out, at least for HID RevE readers, the ATS value must specify FSC=256 or it won't read.
2025-12-22 14:11:59 -07:00
Aaron Tulino (Aaronjamt) 262e5d900c Fix compiler errors 2025-12-22 14:08:54 -07:00
Aaron Tulino (Aaronjamt) 1c0eea2985 Use shared work buffers 2025-12-22 14:04:12 -07:00
Aaron Tulino (Aaronjamt) 223883dfe2 Avoid division on ARM side 2025-12-21 17:26:43 -07:00
Aaron Tulino (Aaronjamt) c0e82539f2 [hf seos] Simulate support 2025-12-21 04:26:44 -07:00
Aaron Tulino (Aaronjamt) 41670bef6a Fix CMAC padding for ARM 2025-12-21 02:58:56 -07:00
Aaron Tulino (Aaronjamt) 63fc2b415d Add 3DES CMAC for ARM 2025-12-21 00:34:11 -07:00
Iceman 42cd659b33 Merge pull request #3049 from kormax/nfc-b-polling-loop-annotations
Add polling loop annotation support for iso14443b
2025-12-19 12:09:55 +01:00