Commit Graph
197 Commits
Author SHA1 Message Date
iceman1001 35c098d489 make style 2026-08-29 17:42:29 +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
Henry Gabryjelski 075f353f98 More fixes based on CoPilot suggestions
* add a check to prevent multiple log handler additions.  Still a hack, but ok for this purpose.
* GuessKey_Statistics.__init__() now validates is_solved using same class validator as unpack()
* fix exception text to reflect allowed types for Hangman_State
* Also in Hangman_State, fix validation when input is bytes / bytearray
* In dc34_PlayHangman_validate_user_input(), strip the input before checking length.
2026-08-23 01:10:49 -07:00
Henry Gabryjelski 9a461daf96 Resolve additional issues that CoPilot found
1. remove hard-coded binary path
2. define TCP_PORT in fallback path
3. only detect device when not called from client
4. struct.pack() requires bytes / bytearray when packing a string.
5. fix typo "existing" -> "exiting"
6. remove unused imports
2026-08-23 00:44:27 -07:00
Henry GabryjelskiandCopilot Autofix powered by AI 0ff99b8762 Update python minimum version
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Henry Gabryjelski <henrygab@users.noreply.github.com>
2026-08-23 00:29:01 -07:00
Henry Gabryjelski 3f4eef9991 Add script to interact with DefCon34 passport cards
Works both from the command-line and from within the PM3 client:
* python3 ./client/pyscripts/dc34.py
* ./pm3 -c "script run dc34"

Supports all three games:
* TicTacToe
* Hangman
* GuessKey

See https://dc34.rfid.wtf/
2026-08-23 00:05:51 -07:00
iceman1001 2c6e607110 style 2026-07-15 16:39:15 +02:00
M35MAR 52ef29b282 Restore original author credits in mfuev1_counter_reset.py 2026-06-20 16:31:10 +02:00
M35MAR 0e814659c3 client/pyscripts: fix and stabilize mfuev1 counter reset 2026-06-20 11:39:01 +02:00
Philippe Teuwen 410769e463 counterfeit ULC: remove legacy poc 2026-06-10 08:05:15 +02:00
Philippe Teuwen 184a957436 counterfeit ULC: add support to auth with nonce pairs 2026-06-10 01:02:14 +02:00
Philippe Teuwen 607737e52e counterfeit ULC: need to merge nonce collection in auth logic for proper timings 2026-06-10 00:39:46 +02:00
Philippe Teuwen 6d8ed745fd counterfeit ULC: misc tuning 2026-06-10 00:39:46 +02:00
Philippe Teuwen ff04e1ea9a hf mfu cauth: add -c to collect nonces 2026-06-07 22:58:39 +02:00
orbisai0security 94c0fc2edd Hardening: explicitly set shell=False on all subprocess.run() calls in fm11rf08s_recovery.py.
All four call sites already pass `cmd` as a Python list, so Python's default of `shell=False` means there is no active command-injection risk. This change makes the security intent explicit, prevents accidental future regression if a call site is later changed to pass a string, and improves code clarity.

No functional behaviour is changed.
2026-06-02 17:12:31 +02:00
Philippe Teuwen fa8e200c5b mfulc_counterfeit_recovery: faster vuln check 2026-05-28 23:58:09 +02:00
Philippe Teuwen f22dd43cfc mfulc_counterfeit_recovery: faster writes 2026-05-28 23:37:29 +02:00
Philippe Teuwen b13a8ce1d5 mfulc_counterfeit_recovery --cuda: dummy call to wake up the GPU ahead 2026-05-28 23:24:14 +02:00
Philippe Teuwen 20aaf4c292 mfulc_counterfeit_recovery.py: add --get_frequent_chal and --unlock 2026-05-22 18:52:02 +02:00
Philippe Teuwen c5e35b26a6 Add --force to mfulc_counterfeit_recovery.py 2026-05-22 11:12:17 +02:00
Philippe Teuwen ea3343156e mfulc_counterfeit_recovery.py: add --cuda to call the CUDA implementation of mfulc_des_brute 2026-05-22 00:26:22 +02:00
Philippe Teuwen 16706aeeac pm3_help2json.py: fix deprecation warning 2026-05-21 21:00:58 +02:00
Philippe Teuwen 88d20bd4f2 make style 2026-04-13 09:35:02 +02:00
W0rthlessS0ul 2ca4e91548 Added script mfuev1_counter_reset.py
This script bypasses the Anti-Tearing protection on MIFARE Ultralight EV1 monotonic counters and allows resetting the counter value
2026-03-23 22:09:14 +03:00
Philippe Teuwen c00e4801b7 make style 2026-02-06 13:43:41 +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 ab3a94c779 mfulc_des_brute & mfulc_counterfeit_recovery.py: integrate FJ8010 2026-01-19 21:47:49 +01:00
Philippe Teuwen 40727695d5 hw dicts 2026-01-19 21:47:49 +01:00
Philippe Teuwen b64924cbbd Add mfulaes_mask_recovery script 2026-01-19 21:47:49 +01:00
Philippe Teuwen 79b99450db Add ntag22x_suncmac_recovery script 2026-01-19 21:47:49 +01:00
noproto c2e1567160 Add mfulc_counterfeit_recovery script and mfulc_des_brute tool 2026-01-19 21:47:49 +01:00
Trigat cf96e4882b Enhance user prompts and add long input handling
Updated user prompts and error messages to include warning symbols for better visibility. Added a new function to read long user input on POSIX systems. Allow writing large inputs by splitting user data into smaller, fixed-size chunks.

Signed-off-by: Trigat <trigat@protonmail.com>
2025-12-05 15:22:32 -06:00
iceman1001 c4de141d03 style 2025-11-10 16:16:39 +01:00
Philippe Teuwen 3bdb7657f4 hf_mfu_uscuid.py: avoid exception 2025-11-04 10:56:15 +01:00
klks fb931ade82 Add read_t-union.py script for reading T-Union data 2025-11-03 13:12:51 +08:00
Philippe Teuwen c1441eb2ab autocompletion on 'script run ...' 2025-10-18 02:20:15 +02:00
Philippe Teuwen 1412b6882b script: more verbose on debug 2025-09-24 21:04:04 +02:00
Trigat b10de3549a Update des_talk.py
Add option to display AID file contents in human-readable text

Signed-off-by: Trigat <trigat@protonmail.com>
2025-09-09 15:45:06 -05:00
Trigat e68babd6ba Update response handling and fix detection command
Signed-off-by: Trigat <trigat@protonmail.com>
2025-09-02 08:42:35 -05:00
Robert Wittek 0054dd0c5b Print output of dumped card in mf_backdoor_dump.py
Signed-off-by: Robert Wittek <18316389+robo-w@users.noreply.github.com>
2025-09-01 16:53:36 +02:00
Robert Wittek 2bf7abbdfc Improve output checks in mf_backdoor_dump.py
Signed-off-by: Robert Wittek <18316389+robo-w@users.noreply.github.com>
2025-09-01 16:35:31 +02:00
Philippe Teuwen 989dad18cc fm11rf08s_recovery.py: load def keys as lowercase 2025-08-03 22:05:42 +02:00
Benjamin DELPY ab6e203560 Update intertic.py to support [FRA] Caen
Signed-off-by: Benjamin DELPY <benjamin@gentilkiwi.com>
2025-07-27 14:29:27 +02:00
Benjamin DELPY a33ea4dc6e [st25tb] Update intertic.py to support Colmar (Trace / Keolis) ID
Signed-off-by: Benjamin DELPY <benjamin@gentilkiwi.com>
2025-06-27 22:04:08 +02:00
iceman1001 488f7aa01e clear a warning for potential use of uninitialized variable 2025-06-22 17:36:40 +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
Philipp Schuler 5b9039d825 Ignore UnicodeEncodeError in lprint 2025-05-12 08:34:42 +02:00
Benjamin DELPY 3f43c061d7 Update intertic.py to support [FRA] Valenciennes
Signed-off-by: Benjamin DELPY <benjamin@gentilkiwi.com>
2025-04-26 21:58:06 +02:00
Benjamin DELPY b5b14e246b Update intertic.py with better parser for T2C / Clermont-Ferrand
Signed-off-by: Benjamin DELPY <benjamin@gentilkiwi.com>
2025-04-24 22:31:39 +02:00
Philippe Teuwen e86e5fd293 python: generalize find_tool() 2025-04-22 15:30:57 +02:00