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.
SimState class represents the state of a program at a particular point in execution, including its memory, registers, symbolic constraints, and execution history.
Class Signature
Parameters
The project instance.
The architecture of the state.
A dictionary of plugins to register with the state.
The execution mode (e.g., ‘symbolic’, ‘static’, ‘fastpath’). Defaults to ‘symbolic’.
A set of options to control state behavior.
Options to add to the default set.
Options to remove from the default set.
The plugin preset to use.
A CLE memory object to back the state’s memory.
A dictionary mapping addresses to bytes for memory backing.
A mapping from (start, end) address ranges to permission flags.
Default memory permissions (read=1, write=2, execute=4).
Attributes
A convenient view of the state’s registers, where each register is a property.
A convenient view of the state’s memory.
The state’s register file as a flat memory region.
The state’s memory as a flat memory region.
The symbolic solver and variable manager for this state.
The breakpoint manager for debugging and instrumentation.
Information about the state’s execution history.
Information about the current execution step.
POSIX/operating system environment model.
The current call stack.
The architecture of the state.
The set of options controlling state behavior.
The execution mode.
Properties
Instruction Pointer Access
ip
ip
Type:
IPTypeSymGet or set the instruction pointer expression. Triggers SimInspect breakpoints and generates SimActions.For read-only access without triggering breakpoints, use _ip instead._ip
_ip
Type:
IPTypeSymGet or set the instruction pointer expression without triggering SimInspect breakpoints or generating SimActions.addr
addr
Type:
IPTypeConcGet or set the concrete address of the instruction pointer. Returns an integer, or raises an exception if the instruction pointer is symbolic.Methods
State Manipulation
copy()
copy()
Signature:Returns a deep copy of the state.Returns:
SimState - A new state that is a copy of this one.merge()
merge()
Signature:Merges this state with other states.Parameters:Returns:
The states to merge with.
A tuple of conditions under which each state holds.
A state representing common history between the states.
Only merge plugins in this list.
tuple[SimState, list, bool] - (merged state, merge flag, whether merging occurred)widen()
widen()
Signature:Perform a widening operation between this state and others.Parameters:Returns:
States to widen with.
tuple[SimState, bool] - (widened state, whether widening occurred)Constraint Management
add_constraints()
add_constraints()
Signature:Add symbolic constraints to the state.Parameters:
Any number of symbolic boolean expressions to add as constraints.
satisfiable()
satisfiable()
Signature:Check whether the state’s constraints are satisfiable.Returns:
bool - True if satisfiable, False otherwise.simplify()
simplify()
Signature:Simplify this state’s constraints.
downsize()
downsize()
Signature:Clean up after the solver engine. Reduces memory usage when the state no longer needs to be solved.
Execution
step()
step()
Signature:Perform a step of symbolic execution using this state.Parameters: Any arguments to
AngrObjectFactory.successors can be passed.Returns: SimSuccessors - An object categorizing the results of the step.block()
block()
Signature:Represent the basic block at this state’s instruction pointer.Parameters: Any arguments to
AngrObjectFactory.block can be passed.Returns: Block - A Block object describing the code at this point.Register and Memory Access
reg_concrete()
reg_concrete()
Signature:Returns the contents of a register, raising
SimValueError if symbolic.Returns: int - The concrete value in the register.mem_concrete()
mem_concrete()
Signature:Returns the contents of memory, raising
SimValueError if symbolic.Returns: int - The concrete value in memory.Stack Operations
stack_push()
stack_push()
Signature:Push a value to the stack, adjusting the stack pointer.Parameters:
The value to push onto the stack.
stack_pop()
stack_pop()
Signature:Pop a value from the stack and return it. The length will be the architecture word size.Returns:
claripy.ast.BV - The popped value.stack_read()
stack_read()
Utility Methods
make_concrete_int()
make_concrete_int()
Signature:Force an expression to be concrete by adding a constraint.Parameters:Returns:
The expression to concretize.
int - The concrete value.dbg_print_stack()
dbg_print_stack()
set_mode()
set_mode()
Signature:Change the execution mode of the state.Parameters:
The new mode (e.g., ‘symbolic’, ‘static’).