Conversation
Add a third decompiler backend built on angr so ToCode runs even when neither IDA nor radare2 is available. The backend implements the existing DecompilerSession protocol and produces a structurally identical export tree (verified file-for-file and key-for-key against an IDA export); decompilation quality is angr-level, which is accepted. - backends/angr.py: AngrSession over CFGFast + angr's decompiler, with clean C signature construction and stripping of angr's leading extern/typedef/comment blocks so the exporter parses prototypes correctly. - base.py: widen backend types, add probe_r2/probe_angr, and make choose_backend an IDA -> r2 -> angr auto chain. - analysis.py/exporter.py/cli.py: wire angr into the factory, parallel worker opener, and --backend choices. - pyproject.toml: optional [angr] extra and a mypy override so the optional import does not break type checking when angr is absent. - tests: choose_backend fallback coverage and an angr smoke test that skips when angr is not installed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The angr fallback is an optional extra (~450 MB of native deps), so it is not installed by default. Add an opt-in install path so users without IDA or radare2 can get a working backend out-of-the-box: - install.sh: --full flag, plus combinable extras handling for --dev/--full. - install.ps1: -Full switch with the same extras handling. - README: document --full / -Full and the angr install options. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
uv sync populates the project's .venv, but uv tool install builds a separate isolated environment for the `tocode` command -- which never received the angr extra, so `tocode --backend angr` reported the backend as unavailable even after `install.sh --full`. Pass the runtime extra to the tool-install path spec (DIR[angr]) so the installed command sees it. dev stays out of the tool environment (build/test tooling only). Also handle the no-pip case on the non-uv path: probe `python -m pip`, try ensurepip, and fail with an actionable message instead of a raw "No module named pip". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Modern distros and Homebrew mark their Python "externally managed", so `pip install --user` is refused with an externally-managed-environment error. Create a dedicated virtual environment instead (as pipx/uv do) and expose only the tocode launcher on PATH, so deps stay isolated and the system interpreter is untouched. If venv itself is unavailable, fail with an actionable hint (install python3-venv, or use uv). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Importing angr loads native extensions and emits noisy warnings (e.g. "failed loading unicornlib.so") at import time. Pulling it in at module top meant every run paid that cost even with --backend ida/r2. Defer the AngrSession import to the angr branch so non-angr runs never touch it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.