Commit Graph
1048 Commits
Author SHA1 Message Date
Matthew CarrollandClaude Opus 5 907f21b8cb lf psk demod: do not accept a phase shift from the lead-in
The emitted bit is the running phase, so a shift accepted before the tag answers
toggles curPhase once too often and the rest of the word comes back complemented.

pskFindFirstPhaseShift judged its first measured length, but waveStart starts as
wherever the caller began looking - that length is part of a wave, not a wave,
and any gap beating fc was taken as a shift. Baseline on the first peak instead.
pskRawDemod_ext separately trusted a shift under one bit period in; the clock is
known by then, so look again from a bit period in.

Both are needed - dropping either leaves one of the tags measured inverting on
most reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 14:57:15 -07:00
Matthew CarrollandClaude Opus 5 e206d748a2 lf fsk demod: do not fabricate a bit from a leading run
aggregate_bits sized each run of like waves in bits and then forced a zero to
one. That is right mid-stream, where a run rounding to nothing would drop a bit
the tag did send. On the leading run it is wrong: a single subcarrier wave is
about fchigh samples against a bit period of clk, so it rounds to no bits and
was made into one anyway - a bit the tag never sent, shifting every bit after it
and dragging startIdx back by most of a bit period.

Skip a leading run that rounds to nothing and let the next transition be first.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 14:57:14 -07:00
Matthew CarrollandClaude Opus 5 1ebcf225f1 lf nrz demod: start the bitstream at the first edge
The samples before the first level change were counted as bits, and where no
edge arrives inside ten clocks the long-run flush fired first and invented ten
of them out of the quiet lead-in. The count sat on a rounding boundary, so one
sample of jitter in that edge added or dropped a leading bit and rotated the
rest of the word - while startIdx, derived from the same count, held i % clk and
could name no sample.

A level change can only fall on a bit boundary, so start there and report it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 14:57:11 -07:00
iceman1001 ace5d63ff9 hitag2: fix simulation against genuine readers, add restore, fix info
Simulation now completes the full exchange with a genuine Paxton reader in
password mode, and crypto mode read/write passes Proxmark-to-Proxmark.

Firmware:
- SOF was one bit period short. The lead-in that compensated for the lost
  head half bit was removed and nothing replaced it, so readers rejected
  every answer with a second START_AUTH. Default is now 6.
- The edge-detect threshold was latched before being measured, so the value
  chosen depended on whether the Proxmark was in a field when sim started.
  It is now measured on field entry and re-armed when the reader leaves.
- The percentile walk latched on run-scoped variables, so one attempt made
  outside a field poisoned every later one.
- Field loss was detected from TIMESTAMP, which is free-running MCU time and
  never stalls. Detect it from receive silence instead.
- Frames of a length the protocol does not have no longer reach the state
  machine; our own modulation tail was resetting the session and breaking
  every write.
- A dropped edge merges two or three reader bit periods into one gap. Those
  bits were discarded; they are now recovered by decomposition, which is what
  made crypto mode work (AUTH decode 15% -> 100%).
- Threshold selection is limited to 20 and 32 and settles in under 25 ms.

Client:
- lf hitag info printed a hardcoded 0x06 and reported 'Password mode' for
  every tag. It now reads page 3, takes -k (4 bytes password, 6 bytes
  crypto), and says so when the config cannot be read.
- lf hitag restore: writes a dump back in dependency order - user pages,
  then key material, then config last - validates the config byte, and
  prints the credential the tag will require afterwards.
- lf hitag crack2 now reports why it failed instead of a bare 'fail'.
- trace list: bit count moved to its own column, relative mode shows a
  Frame Delay Time row rather than renaming Start/End, --frame and -r
  rejected together.
2026-09-04 13:20:29 +02:00
dxl 3ea93dfc85 Add the xyield macro function to yield the CPU. 2026-09-02 00:02:14 +08:00
dxl af9f16d880 Fixed unintended global export in commonutil.c, thx nieldk. 2026-08-19 12:04:32 +02:00
dxl 9cdda9aa62 Reuse the logic for checking version information. 2026-08-19 12:04:32 +02:00
iceman1001 2c6e607110 style 2026-07-15 16:39:15 +02:00
iceman1001 bf082caab7 fix coverity #910690 2026-07-03 11:22:38 +02:00
towelbyte 2e35b95a7c Fix: Replace VLAs with heap alloc in lfdemod signal helpers
Using "data load" on very large trace files (e.g. dumps with 700k samples,
such as COTAG dumps) was causing crashes on some platforms due to stack overflow
since VLA temporary buffers were used.

Replace VLAs in computeSignalProperties() and removeSignalOffset() with
heap-allocated buffers instead.
2026-06-13 00:33:24 +02:00
Philippe Teuwen d078e8a62b make style 2026-05-21 20:54:44 +02:00
iceman1001 cbb572afad style 2026-05-11 14:36:17 +02:00
Philippe Teuwen 64f0145cb4 ARM mbedtls: prevent compilation of self_test functions
They were discarded by the linker GC as they weren't used so far, but better to make it explicit.
2026-04-28 13:00:43 +02:00
Philippe Teuwen 0f4fd96f83 ARM common/generator.c: prevent compilation of functions requiring missing mbedtls files
They were discarded by the linker GC as they weren't used so far, but better to make it explicit.
2026-04-28 13:00:43 +02:00
Philippe Teuwen e7de85a1a3 ARM LZ4: prevent compilation of functions using malloc/free
They were discarded by the linker GC as they weren't used so far, but better be safe...
2026-04-28 13:00:43 +02:00
Philippe Teuwen 961e59b5d1 Revert "Release v4.21611 - BREAKMEIFYOUCAN!"
This reverts commit aaacc75e9f.
2026-04-14 10:19:30 +02:00
Philippe Teuwen aaacc75e9f Release v4.21611 - BREAKMEIFYOUCAN! 2026-04-14 10:19:30 +02:00
Philippe Teuwen 88d20bd4f2 make style 2026-04-13 09:35:02 +02:00
iceman1001 e6db327485 text 2026-03-30 09:29:52 +07:00
iceman1001 42c8699abc simplify 2026-03-30 08:30:31 +07:00
jof Lassoff ad3885a9bb Add Vanderbilt ACT pattern-based key generation to hf mf keygen
- Implements mfc_algo_vanderbilt_one() and mfc_algo_vanderbilt_all()
- Generates keys using 'Acces' + block ID pattern (416363657300-4163636573FF)
- Supports all 40 sectors for 4K cards
- Eliminates need for 256+ keys in dictionary file
- Keys generated dynamically on-demand
2026-03-10 15:49:39 +00: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 fdf3b2690a Various fixes to content GCC 16... 2026-02-07 00:51:53 +01:00
Philippe Teuwen c00e4801b7 make style 2026-02-06 13:43:41 +01:00
Aaron Tulino (Aaronjamt) 2197d9fc9f Fix ROTR conflict 2025-12-21 03:49:45 -07:00
Foxushka b380132cbb Replaced hf mf bambukeys with hf mf keygen with multiple KDFs support, use table for key output
Added Snapmaker U1 filament RFID KDF in `hf mf keygen`
2025-11-10 20:58:49 +03:00
Philippe Teuwen fd88967443 make style 2025-10-14 09:50:59 +02:00
Oleg Moiseenko 944a80d217 make style 2025-09-21 16:41:30 +03:00
iceman1001 628d8633f7 Revert "Release v4.20728 - Phrack"
This reverts commit ee9b3f4acb.
2025-09-11 20:31:08 +02:00
iceman1001 ee9b3f4acb Release v4.20728 - Phrack 2025-09-11 20:31:08 +02:00
iceman1001 2597c7576e style 2025-07-10 11:52:39 +02:00
iceman1001 a3c2d2b815 style 2025-07-08 21:15:09 +02:00
iceman1001 5de4dd68e5 text 2025-06-22 20:34:54 +02:00
iceman1001 65607fc727 added Ultralight-C simulation. hf mfu sim -t 13. Use eload first. Also added support to upload UL-C dictionaries and UL-AES to spiffs memory. A lot of textual reworked across client. Unifiy texts and a bit more color ;) 2025-06-19 17:26:20 +02:00
iceman1001 1f718683b3 Revert "Release v4.20469 - Daddy Iceman"
This reverts commit 9fa173c727.
2025-06-16 16:18:01 +02:00
iceman1001 9fa173c727 Release v4.20469 - Daddy Iceman 2025-06-16 16:18:01 +02:00
Philippe Teuwen 67da1c8ca5 Make CRC size explicit in some cmd/reply size calculations 2025-06-16 10:52:05 +02:00
iceman1001 6ed1853320 Revert "Release v4.20142 - Blue Ice"
This reverts commit a657dbda9b.
2025-03-25 16:18:49 +01:00
iceman1001 a657dbda9b Release v4.20142 - Blue Ice 2025-03-25 16:18:49 +01:00
Philippe Teuwen bd242f6e41 cppcheck ctunullpointerOutOfMemory 2025-03-24 11:33:08 +01:00
iceman1001 bbbfdc7edc fix cpp warning 2025-03-22 13:14:50 +01:00
iceman1001 c8d46a2a7c textual changes, one fix for overflows when sending OLD frames. Now inform and breaks like MIXED/NG does. Improved hf mf autopwn to detect static encrypted nonces and inform user. Last fix is the user abort during check keys steps in autopwn. The device side now detects and cancels if no card is available and on client it also allows to user abort 2025-03-22 13:14:37 +01:00
douniwan5788 ff1289c03d Update Crc16 function to use bitlength instead of length 2025-03-19 18:43:16 +08:00
iceman1001 49d25920c1 added support function for left shifting arrays 2025-03-19 08:57:20 +01:00
douniwan5788 d13e7b0b64 Refactor the concatbits function to support both MSB and LSB first src 2025-03-15 15:21:58 +08:00
iceman1001 4422101243 fix #2547 - compilation warning error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] 2025-02-21 16:33:22 +01:00
iceman1001 cef07dedf6 code style, code clean up of redundant functions, comments, its many minor fixes across the platform. Sorry for not making 20 commits 2025-02-21 15:38:33 +01:00
douniwan5788 f0b93405fa fix Hitag S concatbits and lf em 410x clone --hts 2024-11-27 00:02:00 +08:00
iceman1001 daff8228a2 Revert "Release v4.19552 - Orca"
This reverts commit a039ac18cc.
2024-11-22 12:15:19 +01:00