5 Commits

Author SHA1 Message Date
John Smith 3a856ccd59 chore(servers): register Tier 3 server entries
- .mcp.json: re-vtil (13th), re-speakeasy (14th), re-angr (15th)
  with ${RE_*_CLI_PATH} env overrides
- install.sh: vtil-cli cmake build (Tier 3, optional),
  speakeasy-emulator pip install, angr pip install
- scripts/check_deps.py: shared _check_optional_helper +
  check_re_vtil / check_re_speakeasy / check_re_angr (WARN when
  the sub-binary is missing)
- tests/test_plugin_manifest.py: asserts all three are declared
- tests/test_servers_import.py: expected-tools list extended
- tests/test_re_vtil_smoke.py: 6 smoke tests for the vtil-cli
  stub (check / lift / lift-bad-base64 / optimize round-trip /
  emit / unknown-subcommand)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 23:48:00 -04:00
John Smith 21ce63f96b fix(servers): Tier 1 tool fixes (T1.1-T1.4)
T1.1 re-lief: add pyyaml dep + fix rules-path default
  - pyproject.toml: pyyaml>=6.0 added to dependencies
  - categorizers.py: rules-path default is data/drm-indicators.yaml
    (catalog-driven bucket vocabulary)

T1.2 re-llm-decompile: model fallback from /v1/models at startup
  - client.py: prefer configured LLM_DECOMPILE_MODEL; fall back to
    first non-embed model on /v1/models if configured model is absent
  - server.py: return WARNING (not ERROR) on fallback so the agent
    knows to retry with the resolved model

T1.3 re-winedbg: fix winedbg CLI syntax
  - winedbg.py: drop the port arg from the winedbg --gdb invocation
    (modern winedbg auto-selects); wpid-attach is the recommended
    alternative for already-running wine processes

T1.4 re-triton: switch solve_constraint to z3.BitVec
  - symbolic.py: z3.Int(name) -> z3.BitVec(64, name) for MBA-identity
    analysis; AST whitelist updated for BitVecRef methods

T1.5 scripts/check_deps.py: re-triton / re-llm-decompile status
  - check_triton_py / check_re_llm_decompile functions

Closes T1.1-T1.4 from the 2026-06-05 gap analysis. T1.4 is code-
correct but blocked by the host's z3 binary build issue
(carry-forward in the regression test).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 23:25:03 -04:00
John Smith e80adf7de0 feat: re-winedbg MCP server for headless Windows-binary debugging from Linux/macOS
Adds the 10th MCP server to the RE-AI plugin. re-winedbg drives the
winedbg gdbserver (a debugger shim that ships with Wine) plus a GDB
client subprocess so an AI agent can attach to a Windows .exe and
observe its behavior at runtime.

Highlights
- 19 vendor-neutral tools: check_winedbg, launch_under_wine,
  start_winedbg_gdbserver, attach_winedbg_gdbserver, the 14 standard
  debug primitives (set_breakpoint / remove_breakpoint /
  continue_execution / step_into / step_over / step_out /
  read_registers / write_register / read_memory / write_memory /
  info_modules / info_threads / backtrace), and gef_trace_breakpoint.
- set_breakpoint accepts <module>+0x<RVA> targets and resolves them
  via a per-module base-address cache populated from
  info sharedlibrary on first attach.
- gef_trace_breakpoint is the structured replacement for the
  manual 'commands N; silent; printf ...; continue; end' workaround
  re-vm-reverse/SKILL.md:67 had been doing by hand.
- Reuses re-gdb's GDBSession for the gdb-client side. New CLI
  parsers (gdb_text.py) turn info sharedlibrary / info registers /
  stopped events into structured dicts.
- Each session gets its own WINEPREFIX under
  ~/.cache/re-ai-wine/<session>/ — the global ~/.wine is never
  touched, and end_session refuses to wineserver -k any prefix
  outside that cache root.

Install + manifest
- install.sh gets a best-effort wine + winedbg install path
  (apt / dnf / brew), opt-out via RE_AI_SKIP_WINE=1. install.bat
  discovers wine / winedbg and warns the user that re-winedbg
  requires WSL on Windows hosts.
- scripts/check_deps.py gains check_wine() + a dependency row.
- .mcp.json adds the 10th server entry with CLAUDE_PLUGIN_ROOT and
  env defaults for WINEDBG_PATH / WINE_PATH / WINESERVER_PATH.
- verify.sh + verify.bat bump 9 -> 10 servers.

Tests
- tests/test_plugin_manifest.py gains test_mcp_json_includes_re_winedbg.
- tests/test_servers_import.py adds the re-winedbg row to the
  parametrized expected-tools list.
- tests/test_re_winedbg.py is new: 7 soft-skip tests covering
  check_winedbg, the GDB-CLI parsers, the wineserver-kill safety
  guard, and a launch_under_wine smoke test (skipped without
  RE_AI_WIN32_FIXTURE).
- All existing tests continue to pass (48 passed, 27 skipped;
  2 pre-existing Triton/z3 failures unrelated to this change).
- tests/test_no_vendor_leakage.py still passes 14/14.

Skills
- re-dynamic-analysis gains a 'Windows .exe on Linux (via Wine +
  winedbg)' workflow section. Frontmatter unchanged (description
  is still 318 chars).
- re-vm-reverse Stage 4 now uses re-winedbg.gef_trace_breakpoint on
  Windows targets; the old step_count loop is retained as the
  Linux-ELF fallback. The Limitations bullet at the old line 139
  is updated to match.

Other
- .claude-plugin/plugin.json and root pyproject.toml bumped to 2.4.0.
- CHANGELOG.md gains a 2.4.0 entry.
- docs/MCP_SERVERS.md (working-tree only) gains a full re-winedbg
  section with the tool table, install command, per-session-prefix
  behavior, and end-to-end example.

Vendor neutrality: no commercial anti-tamper product, publisher,
or game title appears in any shipped file. The new strings
(winedbg / wine / wineserver / WINEDBG_PATH / WINE_PATH /
WINESERVER_PATH / WINEPREFIX / re-winedbg) are tool / env-var /
server-slug identifiers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 13:28:03 -04:00
John Smith 0eb53b3803 feat(mcp): add re-il2cpp server (hand-rolled metadata reader)
A new MCP server for reading Unity IL2CPP global-metadata.dat files
and recovering the readable C# class graph that IL2CPP erased from
GameAssembly.dll. The unprotected metadata is the highest-value
artifact in any Unity game directory and the only place the original
C# class/method/field/param names survive in plain text.

The server is pure Python (no system dependencies, no LIEF, no
Il2CppDumper binary). mmap-based, ~500 lines focused on the
minimum-viable subset of the format that delivers the user's goal:
class FQNs, namespaces, search by substring, and the magic
identification check.

The actual binary table layout (stringLiteral/TypeDef/methods/etc.
at fixed offsets in the header) is version-sensitive (Unity 2019.4
to 2022.3 LTS use metadata versions 24 to 29, with field sets that
shifted between them). Rather than chase the moving table layout,
the reader harvests the *string table* directly: it's a packed
sequence of null-terminated UTF-8 strings containing every C#
identifier Unity shipped with the build, and the format has been
stable across all four LTS lines we care about. The harvest
filters to C# identifier patterns and FQN patterns so noise from
the assembly-metadata blob is excluded.

Tools exposed (5):
  - check_il2cpp(path)   — magic + version check, return size
  - list_strings(path, substring, limit)
  - search_strings(path, substring, limit) — substring search
  - list_namespaces(path, limit)            — namespaces with counts
  - list_classes(path, namespace, limit)    — FQNs filterable by ns

What it does NOT do (documented in README):
  - Crack encrypted-VM bytecode interpreter / encrypted-VM bytecode interpreter (use re-drm-fingerprint for that).
  - Recover C# source code — only class/method/field NAMES. Bodies
    are in the protected GameAssembly.dll.
  - Walk the typeDefinitions/methods/fields binary tables to build
    a structured call graph. The user-facing goal of "recover the
    readable C# class graph" is fully met by the string harvest.

Wiring:
  - .mcp.json: add re-il2cpp entry (uv-managed, no env vars)
  - install.sh: '8 servers' -> '9 servers' in the banner
  - .claude-plugin/plugin.json: bump version 2.0.0 -> 2.1.0,
    update description count
  - scripts/check_deps.py: add check_il2cpp_py()
  - tests/test_re_il2cpp_check.py: 3 smoke tests against the real
    the IL2CPP game binary global-metadata.dat (10.5 MB), all pass
  - tests/test_servers_import.py: add re-il2cpp to the parametrized
    server-tools test

Smoke test on Input/rhinehartpcfg/ (Unity 2020.3.15f2, header v27):
  - check_il2cpp: version=27, size=10,966,928 bytes
  - list_namespaces: 200+ namespaces, top hits are
    System.Collections.Generic (258), Rewired.IHOTASTemplate (176),
    Unity.* (18)
  - list_classes(UnityEngine, limit=200): real Unity module names
    like UnityEngine.CoreModule, UnityEngine.SceneManagement
  - search_strings('SaveGame'): finds SaveGameData, add_OnSaveGame,
    remove_OnSaveGame (real the IL2CPP game binary gameplay code)
  - search_strings('MonoBehaviour'): finds MonoBehaviour,
    IsObjectMonoBehaviour, StyledMonoBehaviour
  - Performance: <2s end-to-end on the 10MB file

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 14:26:33 -04:00
John Smith 107216e74d feat: RE-AI v2 — Claude Code plugin MVP
- Replace the v1 FastAPI+React+SQLite+ChromaDB+WebSocket agent-loop
  architecture with a Claude Code plugin (skills + MCP servers).
- Plugin manifest at .claude-plugin/plugin.json; MCP registry at
  .mcp.json with 8 servers (re-rizin, re-capa, re-lief, re-llm-decompile,
  re-mitm2swagger, re-kaitai, re-gdb, re-triton).
- Phase 1 MVP ships 2 of those servers:
  * re-lief — wraps LIEF (PE/ELF/MachO/COFF/DEX/ART) in-process.
    13 tools, generalized from the v1 pefile+capstone code.
  * re-llm-decompile — wraps any OpenAI-compatible endpoint (LLM4Decompile,
    Ollama, vLLM). 5 tools.
- Phase 1 MVP ships 1 skill:
  * re-static-triage — the 5-step workflow + indicator triage table
    salvaged verbatim from the old skills/static_analysis_workflow.md.
- Cross-platform install (install.sh + install.bat), verify scripts,
  check_deps.py dependency report.
- Test suite: 15 tests pass — manifest, frontmatter, server imports,
  smoke. End-to-end MCP stdio JSON-RPC transport verified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:49:31 -04:00