Commit Graph
133 Commits
Author SHA1 Message Date
Julian Isaac 71ca59a8ad Moved the new tool to tools/kgh and renamed it legic_kgh_tool. Added some validation so we don't return random bytes from non-kgh cards. Applied some styling to the new code. Added GPL header to new source file. Cleaned up the static build. 2026-09-04 23:14:22 +02:00
Julian Isaac 1d5d09b073 Merge branch 'master' into feature/add_kgh_tools 2026-09-04 22:23:13 +02:00
YoungJules 08cf2e430e Added possibilty to write a found stamp to a binary file. 2026-08-31 13:14:35 +02:00
MsprgandClaude Fable 5 d852118de5 client: build the tab completion vocabulary at runtime from the command tree
Tab completion used a generated table (pm3line_vocabulary.h, refreshed by
hand via `make commands`) that drifted from the real command tables: new
commands were missing (e.g. `hw bwm*`), removed ones lingered, and the
"offline" flag depended on the platform of whoever regenerated it
(IfPm5() returns true offline on PM5 builds).

Build the vocabulary at startup instead:

- cmdparser: add walkCommandsRecursive(), a tree walk using a fourth
  internal sentinel (XX_internal_command_walk_XX) next to the dump ones.
  It hands each leaf to a visitor as its command_t chain (ancestors +
  leaf). A dispatch counter detects entries shown like a category but
  with their own parser (reveng) and reports them as leaves.
- pm3line_vocabulary: dynamic vocabulary holding the IsAvailable()
  predicates of every command and its ancestor categories, so completion
  applies exactly the rule CmdsHelp() uses, live, for both offline and
  connected devices. Script entries ("script run <relpath>") come from
  the same directories `script list` scans, sorted, including
  subdirectories with the path `script run` needs.
- pm3line: readline and linenoise completers consume the live vocabulary.
  The walk runs with output disabled so category handlers stay silent.
- Drop pm3_help2list.py and the header regeneration from `make commands`.

Behaviour change: entries whose category is hidden by `help` (e.g. `mem`,
`usart` offline) are no longer offered, matching `help`; when connected,
commands the device does not support are no longer offered either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 14:29:04 +02:00
Niel Nielsen 3156f0bfd7 Add ble_posix.c to CMakeLists.txt
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-26 16:07:37 +02:00
kormax f3bca6c291 Determine IDi and PMi in 'hf felica info' for cards with known keys 2026-08-26 11:34:57 +03:00
YoungJules 9def79f8be Fix extra segments identification if first segment also the last 2026-08-25 17:24:09 +02:00
iceman1001 26c23f6808 fix missing files 2026-08-21 23:15:01 +02:00
Cole Munz 0b40585124 Set the stringop-overflow flags before add_subdirectory(deps)
With the linker pin in place the proxspace job gets past the bootrom and
dies later instead, in the cmake build:

  client/deps/jansson/load.c:193:35: error: writing 1 byte into a region
  of size 0 [-Werror=stringop-overflow=]

client/CMakeLists.txt already turns that false positive off for GCC 10
and newer, but it does it at line 876 while add_subdirectory(deps) runs
at line 295. CMake copies the calling scope into a subdirectory at the
add_subdirectory call, so anything set afterwards never reaches the
bundled deps, and jansson is built without the suppression that the rest
of the client gets.

Move the block above the add_subdirectory call in both client and
experimental_lib. Checked by configuring before and after: 0 of 17 deps
targets carried -Wno-error=stringop-overflow in their flags.make before,
17 of 17 after.

ubuntu-cmake and macos-cmake stay green either way; their compilers do
not emit this particular false positive, which is why the gap went
unnoticed while the bootrom link was failing first.

Signed-off-by: Cole Munz <Munzzyy1@proton.me>
2026-08-19 13:18:46 +02:00
YoungJules 51752c3e1d Updated documentation to add usage, how to build in Linux as well as Windows (ProxSpace) 2026-08-19 12:22:30 +02:00
Philippe Teuwen a061f080ed experimental_lib: add missing cmdfpga.c 2026-08-19 12:04:32 +02:00
YoungJules 2b463e4bf9 Remove suffix from repo name in build doco 2026-08-19 11:53:06 +02:00
YoungJules e3ca960ae0 Update wording 2026-08-19 11:32:36 +02:00
YoungJules 89c23828a0 Create a small kgh_tools.exe that runs in Windows and can be used from another program to read a badge number, write a new KGH badge (given a badge number). You also have to provide a stamp (as .bin file, 4 bytes). The tool can also get a full set of info from a KGH badge in JSON form (including checking KGH crc for correctness). All based on publicly available knowledge, existing lua scripts, and careful obeservations! 2026-08-19 10:50:05 +02:00
Sanduuz 02a83c62e6 Add experimental client lib cmdlftrovan missing sources to CMakeLists 2026-07-31 12:15:35 +03:00
iceman1001 c6d01e6e72 update helptexts 2026-06-29 23:51:37 +02:00
Sanduuz e3ddd6a833 Merge branch 'RfidResearchGroup:master' into feature/hrt_parser 2026-06-24 19:14:04 +03:00
Philippe Teuwen 6550610ad0 Migrate from MINGW64 to UCRT64 as arm-none-eabi-gcc is not available anymore in MINGW64
cf https://github.com/msys2/MINGW-packages/commit/bb4125054bf0a400c77a64adb07b64658554083b
2026-06-23 11:04:34 +02:00
Sanduuz 4ff1a50288 Moved HRT parser logic under client/src/parsers + Restructured parser calling code to its own file that is hooked from hf mfdes info command 2026-06-20 23:55:55 +03:00
Sanduuz f71071eb94 Initial commit for HRT parser 2026-06-17 19:24:06 +03:00
Sanduuz 3bea6eaea7 Fail client experimental lib building at compile-time if there are undefined symbols on Linux 2026-06-12 20:31:42 +03:00
Sanduuz e83e2e58a3 Add missing files to CMakeLists for experimental client lib 2026-06-12 19:02:54 +03:00
Connor Milligan cc7b235a5b Native client support for FM11RF08S SEN recovery 2026-05-21 01:19:15 +02:00
Philippe Teuwen 729a8748d9 Fix vec dep with cmake 2026-05-19 09:36:32 +02:00
Sanduuz 2d1fbc12c0 Add prime.c containing mifare_prime_get_version_str symbol to experimental client lib CMakeLists.txt 2026-05-13 15:43:52 +03:00
kormax fa414f3b65 Implement 'hf mfd verifycert' command 2026-05-04 22:07:33 +03:00
kormax d06106b538 Add 'hf calypso info' command 2026-05-01 22:41:42 +03:00
Antiklesys 8d6e474a75 hf iclass legbrute speed improvements #1
Imported updates from legbrute hashcat modules to speed up hf iclass legbrute

1. Bitslicing — biggest win (~32×)
Kernel stores each cipher register (l, r, b, t) as 32 parallel 1-bit lanes in u32s (m64000_a3-pure.cl:147-201, bs_iclass_tick) and computes 32 MACs per tick. The CPU doMAC_brute does 1 at a time. A 64-bit bitslice port would give ~64× per core; AVX2 gets 256×. This is the single largest speedup lever.

2. Early-reject after 8 output ticks
In m64000_sxx (m64000_a3-pure.cl:534-535) the kernel breaks out as soon as the first MAC byte can't match. doMAC_brute always produces the full 32 output bits before memcmp. Comparing byte-by-byte as bits are produced saves ~3× on the output phase since 255/256 keys fail after byte 0.

3. Pre-expanded y_ccnr bit array
Kernel expands the 96 input bits into a flat array once (m64000_a3-pure.cl:239-247) and reuses it for every candidate. suc_bytes in cipher.c:181 re-does b >>= 1 shifts for every key. Pre-expanding lets the inner loop be branch-free and vectorizable.

4. Widen lanes to 256/512 via AVX2/AVX-512. The bitslice code is written against a single uint64_t lane type — swapping for __m256i/__m512i (or an abstracted bs_word_t) gives 4×/8× throughput on hosts that support it, with scalar u64 fallback on ARM/older x86. NEON gives 2× for ARM.
2026-04-15 01:09:19 +08: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 d6c823bea3 fix lib cmakelist & fix cmakelist alphabetic order 2026-04-13 21:44:50 +02:00
iceman1001 c502d2d88d fix cmake 2026-04-11 08:06:48 +07:00
kormax c8a4314353 Add hf gst commands 2026-03-14 17:34:58 +02:00
pingu2211 c07d688597 Implement Gallagher MIFARE Classic card writing and update MAD sector functionality 2026-03-10 15:13:42 +11:00
Philippe Teuwen c529895e68 remove Qt support from experimental_lib 2026-03-01 00:13:48 +01:00
kormax de94afa4f6 Add 'hf aliro info' command 2026-02-27 20:26:50 +02: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
Sanduuz 192c5237b8 Added pla.c to experimental client lib CMakeLists 2025-12-30 22:51:19 +02:00
Sanduuz e0eb2a6993 Add qrcode source to CMakeLists 2025-12-18 15:49:29 +02: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 8ce72a9dfe fix missing includes in Cmakefile 2025-09-04 14:30:53 +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
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 4496b7ec7a experimental lib & client: force symlinks 2025-03-24 09:18:21 +01:00
Philippe Teuwen 1aa8ae6076 cppcheck unused variable 2025-03-23 23:35:34 +01:00
douniwan5788 4bde83b89d Added lf hitag htu support for Hitag µ/8265 2025-03-19 18:56:23 +08:00