Commit Graph
100 Commits
Author SHA1 Message Date
Henry Gabryjelski 276a8bd15d Require fixed facility code for Simplex Grinnell 36-bit
And remove some comments per review.
2025-09-03 23:32:56 -07:00
Henry Gabryjelski 221f531c76 Update changelog 2025-09-03 16:39:10 -07:00
Henry Gabryjelski 55f5b124b2 Improved card limits validation
Unsupported features must have values in `weigand_card_t` data set to zero.
2025-09-03 16:38:42 -07:00
Henry Gabryjelski c389160dde Update name to match screenshot 2025-09-03 16:38:42 -07:00
Henry Gabryjelski 12aef961a2 _Static_assert() requires message
At least until C23, even if GCC allows it w/o errors being raised.
2025-09-03 16:38:42 -07:00
Henry Gabryjelski e6ed87072f HID Simplex 36-bit (Grinnell)
Likely more valid than legacy HID Simplex 36-bit?

There is no Issue Level ... previously defined Issue Level is actually two parity bits.
2025-09-03 16:38:42 -07:00
Henry Gabryjelski eb3a4df973 Column align fields
Allows for easier format comparisons, and minimal documentation one-liner at top.
2025-09-03 16:38:42 -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
Henry Gabryjelski af7aa26c14 Update changelog
Parity was always used for commands, even when the code seemed to suggest it was optional.  This was due to a bug in `LIW` delays sending 1.25 bits too early, coupled with the parity bit happening to align with non-transmission when needed.

Parity option was deprecated earlier, and now is fully removed.
2025-06-09 15:12:13 -07:00
Henry Gabryjelski 9b37250453 em4x70 --par deprecation: Step 5: remove client parameters entirely 2025-06-09 15:05:28 -07:00
Henry Gabryjelski b5e6d21128 Make it clear that this code was *always* sending a parity bit. All the tags require the parity bit. 2025-06-09 14:54:30 -07:00
Henry Gabryjelski 69a2cc1ff0 em4x70 --par deprecation: Step 4: remove client references to client->arm field that used to store this 2025-06-09 14:03:05 -07:00
Henry Gabryjelski 4dcf12fd8d em4x70 --par deprecation: Step 3: remove client-only variables, hard-code false for client->arm comms 2025-06-09 13:32:37 -07:00
Henry Gabryjelski 31b1117a51 em4x70 --par deprecation: Step 2: arm-side always uses false 2025-06-09 12:58:50 -07:00
Henry Gabryjelski 86bac8fe8c em4x70 --par deprecation: Step 1: client-side always sets false 2025-06-09 12:18:34 -07:00
Henry Gabryjelski 2aa58457e3 Missing lines from my last commit 2025-03-19 02:34:38 -07:00
Henry Gabryjelski 43e026b1c9 Fix LIW to RM delay
* Change from 40 FC to 72 FC as default delay between detecting LIW and sending the command.
* Use parity for ID, UM1, and UM2 commands
* Remove extra bit hack from AUTH, PIN, and WRITE commands
2025-03-18 23:18:36 -07:00
Henry Gabryjelski 8617541660 rename some constants to increase clarity 2025-03-18 23:06:33 -07:00
Henry Gabryjelski a588e74e9d rename global variable g_tag 2025-03-18 22:54:46 -07:00
Henry Gabryjelski ab602794d9 rename global variable g_command_parity 2025-03-18 22:52:19 -07:00
Henry Gabryjelski 22b2d422d6 update changelog 2025-03-16 01:06:19 -07:00
Henry Gabryjelski 21ad101ff5 Major update to EM4x70 support:
1. Rework how communications with tag occur.
    a. bitstream to be sent to the tag is now fully pre-generated.
    b. bits sent and received are logged with start / end times.

2. Support built-in `hw dbg` for controlling verbosity of debug output

The new bitstream generation and logging has exposed a surprising legacy behavior ... each of the command that sent additional data (beyond the command) were:
* inserting an extra RM zero bit
* force-enabling command parity is used

This was not expected.  However, this PR maintains the behavior of the existing code.

TODO: Root-cause why the third RM bit is needed.  Fix code to remove that hack.

TODO: change the arm/client interface to ONLY use arrays of bytes, with well-defined content endianness, to avoid this problem.
2025-03-16 01:05:55 -07:00
Henry Gabryjelski 740cfad457 Fix printf() mismatch 2025-01-15 13:11:41 -08:00
Henry Gabryjelski 1e95dadde9 Remove static assertions 2025-01-15 09:25:21 -08:00
Henry Gabryjelski 715e876c62 Per explicit request of iceman1001 2025-01-15 09:22:18 -08:00
Henry Gabryjelski dc0e6f4f91 Fix regression
Found by iceman1001's code review ... THANK YOU!
2025-01-15 09:18:39 -08:00
Henry Gabryjelski 6613ff7334 Workaround old GCC on Windows builds
This is supported for GCC >= version 13

See GCC bug 85487:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85487
2025-01-14 20:35:45 -08:00
Henry Gabryjelski 99e8de3687 fix build break on some compilers 2025-01-14 18:01:09 -08:00
Henry Gabryjelski 05319463fb improve comment 2025-01-14 18:01:09 -08:00
Henry Gabryjelski 1c3f84503a Quiet a spurious warning
The compiler warning is incorrect.
Since `calloc()` zero's memory, can
remove redundant line setting value
to zero, giving quieter builds.
2025-01-14 18:01:09 -08:00
Henry Gabryjelski 18f6604eb0 Prevent potential stack corruption 2025-01-14 18:01:09 -08:00
Henry Gabryjelski 1c75690b1a Various codeQL fixes
Code was previously performing arithmetic in
various loop check conditions.  Integer promotion rules could cause unintended comparisons.

`spiffs` defined `fs->block_count` as `uint32_t`, but defined `spiffs_page_ix` as `uint16_t`.  Various overflow checks detected by CodeQL and fixed by checking for those conditions before looping.
2025-01-14 18:01:09 -08:00
Henry Gabryjelski 91be146ecb CodeQL fixes for "Comparison between A of type TypeA and B of wider type TypeB" 2025-01-14 17:54:58 -08:00
Henry Gabryjelski 20c4756f2a no-op 2025-01-14 17:52:51 -08:00
Henry Gabryjelski 4d67f56656 Mismatched format string specifier (need to deref size pointer) 2025-01-14 17:52:51 -08:00
Henry Gabryjelski 4c6ccfedc1 See if this avoids changelist warnings when building in a fork 2025-01-10 12:20:17 -08:00
Henry Gabryjelski 7eefd358d3 Allow manual initiation of CodeQL 2025-01-10 12:06:49 -08:00
Henry Gabryjelski 1d4e5e8d90 Fix .PM3 traces that exceed single-byte range
This was done programmatically using python.

The `lf_Keri.pm3` was in range `[-508 .. 491]` (1000 value range).
Each value was divided by four, cast to integer, and then adjusted by +1 (to center the values).
The data plot in the pm3 client now shows discernible changes in amplitude.
The resulting samples are all within range [-128,127].

This final fix allows ALL sample `.pm3` traces to be converted to one-byte-per-sample binary format.
2024-09-16 23:35:03 -07:00
Henry Gabryjelski 1a7267ca53 Fix .PM3 traces that exceed single-byte range
This was done programmatically using python.
Files with a range that fell outside of [-128,127], but which would fit into that range, were offset by the noted amount to ensure the file woul now fit within range [-128,127].  This allows the trace files to be converted to one-byte-per-sample binary format, for example.

offset | filename
-----|-----
`-14` | `lf_Q5_mod-manchester.pm3`
`-14` | `lf_Q5_mod-nrz.pm3`
`-10` | `lf_Q5_mod-fsk1.pm3`
`-15` | `lf_Q5_mod-biphase.pm3`
`-9` | `lf_Q5_mod-fsk2.pm3`
2024-09-16 23:05:15 -07:00
Henry Gabryjelski f2ff5f757d writeup from discord, plus extra text
Created as a strawman response to iceman's
suggestion that this would be useful in the repo.

Feel free to move it elsewhere / edit, as you prefer.
2024-08-23 21:08:13 -07:00
Henry Gabryjelski f9dbe3fb6e Update CHANGELOG.md
Signed-off-by: Henry Gabryjelski <henrygab@users.noreply.github.com>
2024-05-14 21:34:43 -07:00
Henry Gabryjelski 20711e7037 Add em4x70 tests 2024-05-14 21:06:35 -07:00
Henry Gabryjelski f58992922d limit freen color to calculated values 2024-05-14 20:35:27 -07:00
Henry Gabryjelski 2757881945 functions should be static where possible 2024-05-14 20:22:30 -07:00
Henry Gabryjelski 2952d55904 Add lf em 4x70 calc 2024-05-14 20:21:42 -07:00
Henry Gabryjelski b7fff95b7c Improve editor folding (some editors use indentation as cue) 2024-05-14 19:16:37 -07:00
Henry Gabryjelski d27c084819 Internal code cleanup.
Reduce ambiguity in function and parameter names.
2024-05-14 19:16:05 -07:00
Henry Gabryjelski 483b192d40 rename parameter for em4x70_receive
Avoid generic "length" parameters, as they are often ambiguous.

Prefer `byte_count`, `element_count`, `bit_count` or more explicit names to reduce misunderstandings and thus reduce bugs.
2024-05-13 10:19:00 -07:00
Henry Gabryjelski 0de99805cd Fix broken test 2024-05-06 09:09:46 -07:00
Henry Gabryjelski c40f4be3e6 re-enable broken hitag2 test 2024-05-06 07:59:41 -07:00
Henry Gabryjelski 7712acff64 Use actions/setup-python for Ubuntu also 2024-05-05 18:35:38 -07:00
Henry Gabryjelski 9d33646b80 Disable broken hitag2 test so github actions work 2024-05-05 18:27:35 -07:00
Henry Gabryjelski 3d824425d2 Use actions/setup-python for MacOS 2024-05-05 18:23:45 -07:00
Henry Gabryjelski 18cbc7259c prevent sending corrupt data to em4x70 tags 2024-05-05 16:00:16 -07:00
Henry Gabryjelski b0b9f4fa42 Add key that tests autorecovery more quickly
This autorecovery test key also has three potential matches
for the last phase, thus ensuring authentication test is
required to determine which of those keys was actually used.
2024-05-05 15:57:26 -07:00
Henry Gabryjelski 569d57719d Fix firmware return value for em4x70 to always be of type PM3_* 2024-05-05 15:54:00 -07:00
Henry Gabryjelski c7d7680cd6 Decoder must not write more bit than requested 2024-03-13 23:23:31 -07:00
Henry Gabryjelski cc2bae2f4d lf em 4x70 writekey --> lf em 4x70 setkey 2024-03-13 09:38:35 -07:00
Henry Gabryjelski ba83ac065e lf em 4x70 writepin --> lf em 4x70 setpin 2024-03-13 09:25:43 -07:00
Henry Gabryjelski 7fbc6b2e47 fix formatting error 2024-03-11 18:28:47 -07:00
Henry Gabryjelski 7036e91f2e Add to changelog 2024-03-11 18:16:59 -07:00
Henry Gabryjelski 0a598b254c make style changes 2024-03-11 17:28:05 -07:00
Henry Gabryjelski 160d61682b Add lf em 4x70 autorecover
Also:
* common.h: Increase safety of some of the macros.
  Parenthesizing the macro parameters ... a best practice.
* firmware: partially-tracked source of "extra bits" messages.
  Add a TODO comment for further study.
* Improve reliability of `lf em 4x70 writekey`
  Authenticate w/new key after it is written.
  Particularly important for glass modules,
  or other tags with weaker coupling.
2024-03-11 17:14:03 -07:00
Henry Gabryjelski b4cfeca9fa Use INFO instead of NORMAL for PrintAndLogEx() 2024-03-03 12:17:02 -08:00
Henry Gabryjelski 12ee192782 disable assertions in PM3 build 2024-03-03 12:17:02 -08:00
Henry Gabryjelski 6c1aa10c91 bugfix: random alt nonce wasn't.
also improve output of multiple potential keys (remove extra `\n`)
2024-03-03 12:17:02 -08:00
Henry Gabryjelski d4942584ec Add CHANGELOG entry 2024-03-03 12:16:57 -08:00
Henry Gabryjelski 545c152d72 Remove large (128k) lookup table 2024-03-03 12:16:16 -08:00
Henry Gabryjelski 4ebd6d4bff Add id48lib and second half of key recovery. 2024-03-03 12:16:16 -08:00
Henry Gabryjelski 5b038631ca Comments change only 2024-03-03 12:16:16 -08:00
Henry Gabryjelski d3ae908b5f mark additional function as static 2024-03-03 12:16:16 -08:00
Henry Gabryjelski 940f63776c allow users to cache distinct Makefile.platform.xxx files 2024-03-02 13:25:01 -08:00
Henry Gabryjelski 2442a9f4f2 update wsl2 instructions for USBIPD v4.0.0 2024-01-28 19:05:05 -08:00
Henry Gabryjelski 1ecb00f6c3 Fix style error in udev rules.
As called out by running `udevadm verify`,
the existing rules violate the requirement
that sections are separated by commas,
(not whitespace).
2024-01-28 14:21:28 -08:00
Henry Gabryjelski 627cf6e3d5 Slow clock speed message update
Signed-off-by: Henry Gabryjelski <henrygab@users.noreply.github.com>
2023-11-14 01:52:02 -08:00
Henry Gabryjelski 939d3d4a93 Remove incorrect message (my own regression) 2023-10-30 17:26:07 -07:00
Henry Gabryjelski f2ed7d1299 Fix mf file loading error
Code was incorrectly checking if loop variable
`i` was greater than maximum data length,
rather than checking current buffer pointer.
2023-10-30 15:46:37 -07:00
Henry Gabryjelski 78262139ec more const for lfsampling and lfzx 2023-08-14 23:07:19 -07:00
Henry Gabryjelski 665cf3254b more const for lfops and some commonutil 2023-08-14 23:02:09 -07:00
Henry Gabryjelski d78dae5904 more const for legicrf and the disabled LCD code 2023-08-14 22:50:25 -07:00
Henry Gabryjelski db46e2ce11 more const for iso15693 2023-08-14 22:45:48 -07:00
Henry Gabryjelski a8d84b2f13 more const for iso14443b 2023-08-14 22:16:11 -07:00
Henry Gabryjelski efce76db53 more const for iso14443a 2023-08-14 22:07:04 -07:00
Henry Gabryjelski 8af8723528 const for i2c 2023-08-14 21:45:21 -07:00
Henry Gabryjelski 6eae62edec const for hitagS 2023-08-14 20:34:13 -07:00
Henry Gabryjelski db8f91d7e1 make logfile more unique (per client run) 2023-08-14 20:01:20 -07:00
Henry Gabryjelski c858d6fdc7 Minor update to WSL2 instructions 2023-08-14 19:07:35 -07:00
Henry Gabryjelski 0b143e5bcd Add 5..8 byte versions for LE/BE conversions 2023-08-14 18:57:36 -07:00
Henry Gabryjelski 47ea4d6566 const for hitag2 2023-08-09 00:11:52 -07:00
Henry Gabryjelski 282c0904a5 visual alignment only .. no code change 2023-08-09 00:08:13 -07:00
Henry Gabryjelski 890ea0d321 const for hfops 2023-08-09 00:03:48 -07:00
Henry Gabryjelski 6f38c814a7 Note inconsistency in FPGA frame layout docs. 2023-08-08 23:59:42 -07:00
Henry Gabryjelski 6804e719e5 const for felica 2023-08-08 23:55:20 -07:00
Henry Gabryjelski 63a457c27f const and static functions for epa 2023-08-08 23:38:26 -07:00
Henry Gabryjelski 0af484fdee const for em4x70 2023-08-08 23:24:10 -07:00
Henry Gabryjelski 1a8ef489c8 const for em4x50 2023-08-08 23:03:34 -07:00
Henry Gabryjelski e973aebae6 Workaround SPIFFS lack of const 2023-08-08 22:56:51 -07:00
Henry Gabryjelski b279df2d46 more const - spiffs 2023-08-08 22:50:34 -07:00
Henry Gabryjelski 31645c56b0 more use of const 2023-08-08 21:09:31 -07:00
Henry Gabryjelski 7801abf7a5 Localize effect of unused macro 2023-08-08 21:06:17 -07:00