Commit Graph
26 Commits
Author SHA1 Message Date
CinderSocket 6639009681 client: document wiegand layer and improve online tests
Add inline comments throughout wiegand_formatutils and callers to explain
sentinel-bit stripping, HID transport framing, and the normalization contract
between input modes and downstream consumers.

Replace sim-only LF HID online tests with T55xx clone+readback flows and add
a full encode/decode roundtrip harness for hf mf encodehid, including sector
restore/cleanup and an optional --manual flag for external reader verification.
2026-03-17 16:45:14 -07:00
CinderSocket 2c403e157d client: unify wiegand input handling
Extract the reusable Wiegand normalization and packing flow into
wiegand_formatutils and move existing callers onto that shared path.
This rebuilds the feat-wiegand branch as one focused commit against
upstream/master instead of trying to preserve the original commit chain.

Key changes:
- add shared helpers for plain binary, raw HID, new PACS, and formatted
  Wiegand input
- centralize binary rendering used by cmdwiegand and PACS decode output
- update lf hid sim/clone to resolve one input mode through the shared
  Wiegand layer and enforce the LF packed transport limit explicitly
- update hf mf encodehid to accept bin/raw/new/formatted Wiegand input
  through the same normalization path
- preserve legacy raw HID transport behavior while clarifying the
  packed-HID vs LF transport limits in error reporting
- add offline regression coverage for the new PACS decode output and add
  interactive online targets for LF HID Wiegand and MIFARE encodehid

Validation performed:
- make client
- bash -n tools/pm3_tests.sh
- bash -n tools/pm3_online_tests.sh
- ./tools/pm3_online_tests.sh -h
- ./client/proxmark3 -c 'wiegand encode -w H10301 --fc 31 --cn 337'
- ./client/proxmark3 -c 'wiegand encode -w H10301 --fc 31 --cn 337 --new'
- ./client/proxmark3 -c 'wiegand decode --new 068F80A8C0'
2026-03-17 16:45:14 -07:00
Henry Gabryjelski e7c61f86c0 more const correctness
This allows compiler to optimize more, and allows caller to store the data in ROM (instead of RAM).
2025-09-03 16:38:42 -07:00
iceman1001 af3a16b25c text and style 2025-03-02 16:45:01 +01:00
Donny 8c23ebca2e Fix bug 2025-02-27 14:40:29 -08:00
Donny d2e8066cbf Revise decode_wiegand function 2025-02-27 11:29:57 -08: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
Donny 3f794818f0 fix incorrect HID bitlen calculations and wiegand format display 2025-02-15 21:56:19 -08:00
Emily AstranovaandGitHub ac3c1bbf9f Fix incorrect header length
Signed-off-by: Emily Astranova <emily@astralabs.dev>
2025-01-09 11:17:14 -05:00
@tweathers-sec f80e8d0f85 Updated clone and sim handling for 48-Bit HID (C1k48s) 2024-06-19 13:41:37 -04:00
iceman1001 30162f3d87 remove debug statement 2023-07-26 01:35:27 +02:00
iceman1001 e18194028b style 2022-08-24 07:25:10 +02:00
iceman1001 c27264e4c4 text 2022-08-22 05:49:47 +02:00
iceman1001 38a664f00c lets see if this still detects sentinels 2022-08-21 09:40:36 +02:00
Philippe Teuwen 30aa7aa7d1 Adapting license headers, WIP 2022-01-08 00:40:52 +01:00
iceman1001 3a920f4e0c unsigned shift 2021-05-14 22:43:08 +02:00
iceman1001 82e71d7815 lf hid clone - only print the selected format 2021-04-27 19:16:06 +02:00
iceman1001 10c9ea5f84 more wiegand formats, and if binary is user supplied use that length, and ignore parity faults is removed since we wanna see all decodings anyway 2021-04-27 15:19:34 +02:00
iceman1001 4620c0b21e cppchecker fixes 2021-02-23 23:00:29 +01:00
Anže Jenšterle cd36770c5e make style 2021-02-09 16:56:55 +01:00
iceman1001 249d3e7d1e text 2021-01-29 12:04:19 +01:00
iceman1001 7b14c98530 printf remove 2020-08-29 11:58:36 +02:00
iceman1001 988b61cfa5 fix clarify condition 2020-05-27 20:41:55 +02:00
iceman1001 977b198816 cppcheck fix 2020-05-14 09:03:54 +02:00
Philippe Teuwen 3529aea157 stricter warnings, wip 2020-05-03 01:13:28 +02:00
Bjoern Kerler 81bc0bc2b9 Reorder client src directories 2020-04-16 10:53:24 +02:00