TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/angr/angr/llms.txt
Use this file to discover all available pages before exploring further.
AngrObjectFactory (accessed via project.factory) provides convenient access to important angr analysis elements such as states, blocks, simulation managers, and callable functions.
Class Signature
Parameters
The angr Project instance.
The default execution engine to use (defaults to UberEngine).
Attributes
The associated angr Project.
The default execution engine instance (thread-local).
The engine for executing SimProcedures.
State Creation Methods
blank_state()
blank_state()
Signature:Returns a mostly-uninitialized state object.Parameters:Returns:
The address the state should start at instead of the entry point.
If provided, all symbolic registers will hold symbolic values with names prefixed by this string.
A dictionary of file names with associated preset SimFile objects.
Whether the host filesystem should be consulted when opening files.
A path to use as a fake root directory (only when concrete_fs is True).
SimState - The blank state.Example:entry_state()
entry_state()
Signature:Returns a state object representing the program at its entry point.Parameters:Returns:
Start address instead of the entry point.
Custom value for the program’s argc.
List of values to use as the program’s argv.
Dictionary to use as the environment.
SimState - The entry state.Example:full_init_state()
full_init_state()
Signature:Like
entry_state(), but starts at a SimProcedure that plays the role of the dynamic loader, calling initializer functions before reaching the entry point.Takes the same arguments as entry_state(), except for addr.Returns: SimState - The fully initialized state.Example:call_state()
call_state()
Signature:Returns a state initialized to the start of a given function, as if it were called with given parameters.Parameters:Returns:
The address of the function to call.
Positional arguments to pass to the function. Can be python types, which will be converted to binary format.
Use this SimState as the base instead of a blank state.
A SimCC object specifying the calling convention.
The function’s return target address.
Pointer to use as the top of the stack.
Pointer for placing excess argument data.
Whether allocations at alloc_base grow downward.
The address of the table of contents for ppc64.
SimState - The state at the beginning of the function.Example:Simulation Manager Methods
simulation_manager() / simgr()
simulation_manager() / simgr()
Signature:Constructs a new simulation manager.Parameters:Returns: Note:
What to put in the new SimulationManager’s active stash. If None, uses entry_state().
SimulationManager - The new simulation manager.Example:simgr() is an alias for simulation_manager().Block Methods
block()
block()
Signature:Create a Block object representing a basic block of code.Parameters:Returns:
The address of the block.
The size of the block in bytes.
Custom bytes to use instead of reading from memory.
Whether this is ARM Thumb mode.
Maximum number of instructions to lift.
VEX optimization level (0-2).
Block - The block object.Example:fresh_block()
fresh_block()
Callable Methods
callable()
callable()
Signature:Create a Callable object that represents a function in the binary that can be called like a native Python function.Parameters:Returns:
The address of the function (or a Function object).
The prototype of the call as a string or SimTypeFunction.
Throw an exception if execution splits into multiple states.
Merge all result states into one at the end.
The state from which to do runs.
The calling convention to use.
Maximum number of blocks to execute before pruning.
Callable - A callable object.Example:Calling Convention Methods
cc()
cc()
Signature:Return a SimCC (calling convention) object parameterized for this project.Returns:
SimCC - The calling convention object.Example:function_prototype()
function_prototype()
Signature:Return a default function prototype parameterized for this project.Returns:
SimTypeFunction - A default function prototype.Other Methods
successors()
successors()
Signature:Perform execution using an engine and return a SimSuccessors object.Parameters:Returns:
The state to analyze.
The engine to use (defaults to default_engine).
An address to execute at instead of the state’s IP.
The jumpkind of the previous exit.
Don’t copy the state (inline execution).
SimSuccessors - Object containing successor states.snippet()
snippet()
Signature:Create a CodeNode (HookNode, SyscallNode, or BlockNode) for the given address.Parameters:Returns:
The address of the snippet.
CodeNode - The code node.