diff --git a/README.md b/README.md index 8739933..c3b2d37 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Pure-Python async client for the [Proxmark3](https://github.com/RfidResearchGrou - **Live sniff & simulation** — stream decoded reader↔tag frames into your REPL in real time; edit an emulated tag and push it live. - **Software-defined tags** — pure-Python transponder models (ISO 14443-A, ISO 15693, MIFARE Classic, NTAG/Type-2, NXP ICODE/SLIX2/NTAG5, LF) served from a firmware response table. - **Interactive raw console** — [`pm3py rawcli`](#pm3py-rawcli--interactive-raw-command-console) drops into a Proxmark-style TUI for raw command entry: a live annotated trace, hex/binary toggle, and function-style transponder commands. +- **Autocompleting client** — [`pm3py client`](#pm3py-client--autocompleting-console-for-the-stock-proxmark3-client) wraps the **stock Proxmark3 client** (so it works with any Proxmark/firmware) with full command-tree completion, press-→ help, and the client's own colored output — and can [spin off a single-file drop-in](#distributing-a-drop-in) for anyone on the stock repo. ## Install @@ -21,7 +22,7 @@ pip install -e . # or `pip install .` ``` Requires **Python 3.10+**; dependencies (`pyserial-asyncio`, `bitarray`, `pycryptodome`, -`prompt_toolkit`) install automatically. It's pure Python + pyserial, so it also runs on a **Raspberry Pi** +`prompt_toolkit`, `pexpect`) install automatically. It's pure Python + pyserial, so it also runs on a **Raspberry Pi** (aarch64) — see [Flashing firmware](#flashing-firmware-pm3flash) for the Pi bring-up. ## Quick Start @@ -527,6 +528,57 @@ NTAG213 (HF / 14a) UID 04A1B2C3 - **ipython-style completion** — command/argument menus with each command's help as the tooltip, plus history auto-suggestion. +## `pm3py client` — autocompleting console for the stock Proxmark3 client + +Where `rawcli` speaks pm3py's own protocol stack, `pm3py client` wraps the **standard Proxmark3 C +client** — so it works with any Proxmark3 and any firmware the stock client supports. You get the +real client's exact behavior and its native colored output, with autocompletion and inline help +layered over its full command tree. + +```bash +pm3py client # auto-detect the device and the client +pm3py client --driver pexpect # force the binary backend (no SWIG build needed) +pm3py client --port /dev/ttyACM0 --commands /path/to/commands.json +``` + +```text +[client / usb] pm3py --> hf mf rd⇥ # Tab completes to `hf mf rdbl`, then descends to its options +[client / usb] pm3py --> hf mf rdbl --blk 0 -k FFFFFFFFFFFF + [+] 0 | 04 A1 B2 C3 D4 08 04 00 62 63 64 65 66 67 68 69 | # the client's own colored output +[client / usb] pm3py --> hf 14a in⇥ # → on the highlighted `info` opens its full help in the bar +``` + +- **Full command-tree completion** — completes each level (`hf` → `hf mf` → `hf mf rdbl`) and a + command's option flags (`--blk`, `-k`), each with its description as the tooltip. **Tab** commits + the highlighted item and descends to the next level. +- **Press-→ help** — with a completion highlighted, **→** expands its full help (description, usage, + options, notes) in the bottom bar; **←** / **Esc** / **Ctrl-g** backs out. Otherwise the bar shows + a one-line hint for the current command. +- **The client's own output** — commands run through the real client and print its native colored + output verbatim; the breadcrumb `[client / usb]` reflects the live connection. +- **Two backends** (`--driver auto`, the default): + - **SWIG** — the in-process `_pm3` bindings (`console()` + captured output); needs the client's + `experimental_lib` extension built, and a connected device. + - **pexpect** — spawns the `proxmark3` binary and reads its prompts; no build required, and runs + offline. Used automatically when `_pm3` isn't importable, or forced with `--driver pexpect`. +- **Command tree from the client** — the menu is built from the checkout's `doc/commands.json` (the + same set the client itself exposes), auto-located from the repo; override with `--commands`. + +### Distributing a drop-in + +`pm3py client --pack` spins off a **self-contained** copy for people who use the stock Iceman/RRG +Proxmark3 repo but not pm3py: + +```bash +pm3py client --pack pm3cli.py # one readable file — needs `pip install prompt_toolkit pexpect` +pm3py client --pack pm3cli.pyz # a zipapp with those deps bundled — runs on bare `python3` +``` + +Drop the file into (or beside) a Proxmark3 checkout and run it (`python3 pm3cli.py`). It finds the +checkout's `doc/commands.json` and client automatically — walking up from where it's dropped, or via +`$PM3_REPO` — auto-detects `/dev/ttyACM*`, and gives the same console. The file is generated from +`pm3py/cli/clientcli/` (the tested source of truth), so it never drifts. + ## Firmware Compatibility On connect, pm3py pings the device and fetches the firmware version. The result is on @@ -619,7 +671,7 @@ pm3py/ │ ├── decode_iso14a.py / decode_iso15.py # per-protocol decoders │ ├── ndef.py # NDEF TLV/record decode │ └── format.py # ANSI color trace formatting -├── cli/ # `pm3py` console-script: rawcli (interactive raw-command TUI) +├── cli/ # `pm3py` console-script: rawcli (raw-command TUI) + clientcli (`pm3py client`) ├── sniff/ # SniffSession — protocol detection, live streaming lifecycle ├── sim/ # card-sim infrastructure: SimSession, response-table compiler, │ # Medium/Reader models, MCU bridge, replay/relay/fuzzer