No description
Find a file
Fish Wang 7cc76cffb9 Add per-block def/use cache (BlockDefUses) for lazy SRDA scanning
Make SReachingDefinitions reuse per-block virtual-variable definition/use
scans across runs instead of re-scanning every block on every invocation.

A new BlockDefUses holds the vvar definitions, phi sources, and explicit
uses found by scanning a single AIL block; a decompilation-scoped
BlockDefUsesCache (owned by Clinic) maps (block addr, block idx) to it and
is threaded through every function-mode SRDA call site (AILSimplifier,
_make_callsites, ConditionConstProp, RegisterSaveAreaSimplifierAdvanced,
GraphDephicationVVarMapping). The cross-block work (observe-based call-site
implicit uses, extern/arg reconciliation, phi maps) is unchanged and still
runs each time; only the per-block scan is cached.

Cache entries are validated by statement-list identity: every block mutation
in the decompiler replaces block.statements with a freshly allocated list
(Block.copy slices it; dead-assignment removal builds a new list), so a
stale entry for a rebuilt block is recomputed automatically. BlockSimplifier
can peephole-optimize expressions in place without replacing the list, so
Clinic marks those blocks dirty explicitly. update_after_block_edits keeps
the cache warm after incremental dead-assignment removal.

Standalone SRDA callers that pass no cache (outliner, rust mixin, tests) and
block-mode/track_tmps callers keep the original whole-graph scan, byte for
byte. An env-gated harness (VERIFY_BLOCK_DEFUSES_CACHE) checks every
cache-served collection against a fresh scan.

Behavior-preserving: 216 decompiler tests pass, including with both
VERIFY_BLOCK_DEFUSES_CACHE and VERIFY_INCREMENTAL_RD enabled. Cache hit rate
is 64-75% on the functions measured. Note: profiling shows per-block scanning
is only ~2% of decompile time (structuring ~24-46%, typehoon ~15%, SRDA total
~7%), so this is wall-clock-neutral as measured; it is groundwork for further
incremental-SRDA work rather than a standalone speedup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mw6khRGdin2yLi8KLRsQCF
2026-06-20 18:27:22 +00:00
.github ci: bump EnricoMi/publish-unit-test-result-action from 2.23.0 to 2.24.0 (#6495) 2026-06-15 10:00:58 -07:00
angr Add per-block def/use cache (BlockDefUses) for lazy SRDA scanning 2026-06-20 18:27:22 +00:00
corpus_tests Enable ruff isort rule (#6452) 2026-06-02 14:48:07 -07:00
docs docs: Auto-generate the API reference via autosummary (#6460) 2026-06-04 08:32:27 -07:00
native rust: bump pyo3 from 0.28.3 to 0.29.0 (#6494) 2026-06-12 13:19:44 -07:00
tests knowledge_plugins, code_location: recompute hashes after unpickling (#6511) 2026-06-17 12:06:45 -07:00
.dockerignore Oxidizer: Rust pseudocode generation (#6283) 2026-05-19 07:15:07 -07:00
.git-blame-ignore-revs .git-blame-ignore-revs: Fix reference 2025-11-26 17:44:09 -07:00
.gitignore docs: Auto-generate the API reference via autosummary (#6460) 2026-06-04 08:32:27 -07:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate (#6498) 2026-06-15 12:48:08 -07:00
.readthedocs.yml docs: Use integrated RTD rust support (#6382) 2026-05-01 23:08:38 -07:00
Cargo.lock rust: bump pyo3 from 0.28.3 to 0.29.0 (#6494) 2026-06-12 13:19:44 -07:00
Cargo.toml Update to Rust 1.88 (#5561) 2025-06-26 21:00:49 -07:00
COPYRIGHT Update LICENSE and COPYRIGHT. (#5376) 2025-03-27 23:58:21 -07:00
LICENSE Update LICENSE and COPYRIGHT. (#5376) 2025-03-27 23:58:21 -07:00
MANIFEST.in Definitions: JSONify the data; Create protos on-demand. (#5640) 2025-09-08 17:26:31 -07:00
pyproject.toml Decompiler: Use VariableMap to track Atom-Variable mapping. (#6470) 2026-06-05 16:28:58 -07:00
README.md README: Update some links 2025-10-13 13:57:08 -07:00
rust-toolchain.toml Update rust-toolchain.toml to 1.94 (#6289) 2026-03-27 09:54:54 -07:00
SECURITY.md Draft security and reporting advisory (#3072) 2022-01-09 19:49:40 -07:00
setup.py Enable ruff isort rule (#6452) 2026-06-02 14:48:07 -07:00

angr

Latest Release Python Version PyPI Statistics License

angr is a platform-agnostic binary analysis framework. It is brought to you by the Computer Security Lab at UC Santa Barbara, SEFCOM at Arizona State University, their associated CTF team, Shellphish, the open source community, and @rhelmot.

Homepage: https://angr.io

Project repository: https://github.com/angr/angr

Documentation: https://docs.angr.io

API Documentation: https://docs.angr.io/en/latest/api.html

What is angr?

angr is a suite of Python 3 libraries that let you load a binary and do a lot of cool things to it:

  • Disassembly and intermediate-representation lifting
  • Program instrumentation
  • Symbolic execution
  • Control-flow analysis
  • Data-dependency analysis
  • Value-set analysis (VSA)
  • Decompilation

The most common angr operation is loading a binary: p = angr.Project('/bin/bash') If you do this in an enhanced REPL like IPython, you can use tab-autocomplete to browse the top-level-accessible methods and their docstrings.

The short version of "how to install angr" is mkvirtualenv --python=$(which python3) angr && python -m pip install angr.

Example

angr does a lot of binary analysis stuff. To get you started, here's a simple example of using symbolic execution to get a flag in a CTF challenge.

import angr

project = angr.Project("angr-doc/examples/defcamp_r100/r100", auto_load_libs=False)

@project.hook(0x400844)
def print_flag(state):
    print("FLAG SHOULD BE:", state.posix.dumps(0))
    project.terminate_execution()

project.execute()

Quick Start