mirror of
https://github.com/Heretek-AI/RE-AI.git
synced 2026-08-24 15:46:39 -04:00
main
6 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5e5e9e72c |
feat(re-lief): categorize_strings tool + catalog-driven string bucketing
Adds a keyword-bucketed strings dump to the re-lief MCP server, turning
the manual-grep step that today lives in the LLM's head into a
catalog-driven, deterministic lookup. Superset of extract_strings
(same {ascii, utf16le, totals, truncated} shape for backward compat)
plus a by_category block with 11 semantic categories (anti_debug,
hwid, crypto, network, registry, process, file, fingerprint,
activation, obfuscation, misc).
The categorization vocabulary lives in a new
data/drm-indicators.yaml::string_categories section. Two seed
categories (anti_debug, hwid) inherit their keyword lists from
existing catalog sections via a seed_from / seed_field YAML pointer
— when a future agent adds a new HWID API to hwid_apis.high_signal,
the categorizer picks it up on next MCP-server reload with zero
Python change. The YAML is the single source of truth for both the
indicator set that re-drm-fingerprint reads and the keyword set
that the categorizer reads.
Five skills (re-static-triage, re-malware-triage, re-drm-fingerprint,
re-vm-reverse, re-format-decode) had their manual-grep step replaced
with a call to re-lief.categorize_strings. No new workflow steps
were added — the categorizer IS the string scan.
ANTI-TAMPER-TAXONOMY.md gains a "Recognizing the patterns in
arbitrary binaries" section that documents Pattern A (encrypted-VM
bytecode interpreter: 7 section-name co-occurrence + W^X .idata +
.text virt>>raw + .ecode lazy-decrypt stub + vendor-tagged PDB +
late-bound export tail + 8+ HWID APIs) and Pattern B
(hardware-fingerprinting routine in a third-party launcher
activation library: ordinal-only exports + WinHTTP + OpenSSL +
HWID-vector APIs + split anti-debug surface) in vendor-neutral
category terms. No vendor / publisher / game / PDB-path literals
appear in any shipped file.
Tests: 7 new soft-skip tests in test_re_lief_categorize_strings.py
covering the result shape, the seed_from inheritance, the bundled
Activation64.dll high-signal hits, the legacy extract_strings
wrapper, and the GameAssembly full-section vs skip_sections paths.
All always-on tests (leakage, frontmatter, server registration,
smoke) continue to pass. ./verify.sh is green.
|
||
|
|
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> |
||
|
|
ad2bb6b7c9 |
feat(re-il2cpp): v2.2.0 — walk 7 binary tables + resolve method RVAs
PR #3 (il2cpp-triage-followup) shipped the re-il2cpp MCP server with 5 string-table tools and a 'future enhancement' marker in the code and the skill saying the typeDefinitions / methods / fields tables were not yet walked. v2.2.0 is the explicit future enhancement. Added - 7 new MCP tools that walk the binary record arrays in global-metadata.dat: get_type_definitions, get_methods, get_fields, get_parameters, get_properties, get_events, get_images. Each returns structured records (parent, type_index, token, member counts) parsed from the on-disk per-version struct formats. - 1 new tool: resolve_method_rva — walks the typeDef/method tables AND parses GameAssembly.dll's runtime registration structures to return the method's RVA. For non-stripped binaries it returns function_rva directly; for stripped binaries (the default for shipped Unity games) it returns the IL2CPP mangled name to feed to re-rizin.search_bytes. Requires 'pip install re-il2cpp[rva]' (LIEF is an optional dep). Code organization - version_table.py: added detect_subversion() (v24.x tree per Il2CppDumper/Metadata.cs:67-83), RECORD_FORMATS per-version struct table, CODE_REGISTRATION_FIELDS for the GameAssembly parser. - tables.py (NEW): 7 table walkers + helpers (full-header reader with LRU cache, string-by-index resolver, generic record-array walker, find_type_definition_by_fqn, find_method_by_name, _image_for_type). Pure stdlib + mmap + struct. - rva_resolver.py (NEW): LIEF-based GameAssembly.dll RVA walk with lazy import (server boots without LIEF). - _common.py (NEW): shared low-level helpers (moved from metadata.py) to break a circular import. - metadata.py: re-exports from tables.py; docstring now says 'does NOT do: resolve RVA' instead of 'does NOT walk tables'. - server.py: 8 new @mcp.tool() wrappers. Skill + docs - skills/re-il2cpp-decompile/SKILL.md: Step 4 adds get_type_definitions for structured class graphs; Step 5 adds the typed get_methods / get_fields / get_parameters flow; Step 6 uses resolve_method_rva as the primary path with re-rizin.search_bytes demoted to a fallback for stripped binaries; Limitations section drops the 'does not walk' bullet and adds the 'type_index not fully resolved' caveat. - docs/MCP_SERVERS.md: re-il2cpp section extended with the 7 binary-table tools, updated Limitations, updated Example. - servers/re-il2cpp/README.md: new Tools subsections (Metadata header / String table / Binary tables / RVA cross-reference); updated What-it-does-NOT-do. Tests - 9 new soft-skip tests in tests/test_re_il2cpp_check.py: one per new table walker + find_type_definition_by_fqn + resolve_method_rva (gates on LIEF being installed and the bundled sample being present). - Total: 35 tests, all pass. verify.sh 7/7. Version bumps - pyproject.toml and .claude-plugin/plugin.json: 2.1.0 → 2.2.0. - servers/re-il2cpp/pyproject.toml: 0.1.0 → 0.2.0; added optional 'rva' extra with lief>=0.16,<0.18. DMCA note: the new tools read only unprotected metadata + return names / indices / addresses. They do not reproduce, decompile, or ship any compiled code. The Input/ test fixture remains gitignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
8cfd2b3745 |
chore(release): v2.1.0 hygiene — sync counts, fix verify.sh, document re-il2cpp
PR #3 added a 9th MCP server (re-il2cpp) and a 13th skill (re-il2cpp-decompile) on top of v2.0.0, but the surrounding project state was not updated to match: counts disagreed across docs, the new server/skill were absent from every user-facing index, and verify.sh would fail on a clean checkout because it asserted on a top-level 'len(d)==8' of a dict whose top-level key is 'mcpServers' (so 'len(d)==1'). This is a pure-hygiene follow-up — no code logic changes, no new tests, no server/skill code edits: - Fix verify.sh and verify.bat stale assertion: now check the 'mcpServers' key, assert 9 entries, require the 8 originals as a subset, and require 're-il2cpp' to be present. - Bump pyproject.toml and .claude-plugin/plugin.json to 2.1.0 (matches .claude-plugin/plugin.json which was already at 2.1.0). - Add [2.1.0] entry to CHANGELOG.md with Added / Changed / Known limitations sections. - Update counts (8 -> 9 servers, 12/10/9 -> 13 skills) and add re-il2cpp + re-il2cpp-decompile to: README.md, docs/SKILLS.md, docs/MCP_SERVERS.md, docs/ARCHITECTURE.md, docs/MIGRATION_FROM_V1.md, docs/TROUBLESHOOTING.md, .claude-plugin/plugin.json. - Add new 'Companion data' section to README.md describing data/drm-indicators.yaml and data/ksy/unityfs.ksy (were not documented before). - Add new TROUBLESHOOTING entry: 're-il2cpp: Unity 6 / 2023+ metadata not supported'. All 26 existing pytest tests still pass; 'bash verify.sh' reports 7/7 PASS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
355b33651a |
feat: add re-vm-reverse, re-mba-deobfuscate, re-drm-fingerprint + drm-indicators.yaml
Three new skills and one companion data file, derived from the analysis of https://connorjaydunn.github.io/blog/posts/encrypted-VM bytecode interpreter-analysis/ and Connor Dunn's broader DRM-reverse-engineering methodology. Skills (all use existing MCP servers, no new infrastructure): - re-vm-reverse: custom VM bytecode analysis. Workflow combines re-lief section triage, re-rizin dispatcher pattern matching, re-gdb frequency analysis, and re-llm-decompile handler lifting. Applies to encrypted-VM bytecode interpreter, encrypted-VM bytecode interpreter, encrypted-VM bytecode interpreter, encrypted-VM bytecode interpreter. - re-mba-deobfuscate: Mixed-Boolean-Arithmetic simplification via Triton symbolic execution and Z3 equivalence queries. Workflow is LLM-driven (reads disassembly, translates to Python exprs) and Z3-verified (proves equivalence to a candidate simpler form). - re-drm-fingerprint: hardware-fingerprinting routine detection. Combines section, import, string, and anti-debug static signals to produce a confidence score (Low/Medium/High) and a vendor guess. Companion data: - data/drm-indicators.yaml: 384 lines covering KUSER_SHARED_DATA offsets, PEB fields, HWID-vector API catalog, section-name heuristics, VM dispatcher patterns, MBA identity catalog, anti-debug catalog, and vendor fingerprints. LLM-readable prose where the LLM needs to query it. Decision recorded in CHANGELOG: sogen is NOT added as an MCP server (GPL-2.0 license + setup cost). encrypted-VM bytecode interpreter-specific skill NOT added (vendor-specific framing goes stale; the three generic skills above are the right packaging). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
6b0301403b |
feat: RE-AI v2 — full v1 with 8 MCP servers, 9 skills, 5 docs
Phase 2 work, completing the v1 scope from the approved plan. 6 new MCP servers (re-rizin, re-capa, re-mitm2swagger, re-kaitai, re-gdb, re-triton) bring the total to 8, matching the .mcp.json registry. Each server follows the same pattern: pyproject.toml + src/<name>/server.py with a FastMCP instance and @mcp.tool() decorated functions. 8 new skills (re-decompile, re-api-reverse, re-format-decode, re-dynamic-analysis, re-symbolic-exec, re-malware-triage, re-vuln-research, re-report) bring the total to 9. Each has a SKILL.md with name/description frontmatter and a body describing when to use, the workflow (with specific MCP tool calls), tips, and limitations. 5 docs (ARCHITECTURE, MCP_SERVERS, SKILLS, TROUBLESHOOTING, MIGRATION_FROM_V1) round out the plugin. Test suite extended: 21/21 tests pass, including paramterized tool existence checks for all 8 servers. Each server's FastMCP instance is verified to expose its declared tools. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |