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.
SimulationManager (also called simgr) allows you to wrangle multiple states in a slick way. States are organized into “stashes”, which you can step forward, filter, merge, and move around as you wish.
Class Signature
Parameters
The angr Project instance.
Active states to seed the “active” stash with.
A dictionary to use as the stash store.
A StateHierarchy object to track relationships between states.
A set of errors to catch during stepping. False: catch no errors. None: catch angr-specific errors. True: catch many common errors.
If True, introduce unsatisfiable states into the
unsat stash instead of discarding them.A set of stash names which should be treated as garbage chutes.
A function describing how multiple exploration techniques with the
complete hook set will interact.A list of techniques that should be pre-set to use with this manager.
Whether to automatically install the Suggestions exploration technique.
Attributes
The active stash containing states being actively explored.
States that have been temporarily stashed.
States that have reached a deadend (no successors).
A list of ErrorRecord objects for states that encountered errors.
States with unsatisfiable constraints.
States with unconstrained instruction pointers.
States that have been pruned.
Dictionary of all stashes.
Constants
Special stash name referring to all stashes.
Special stash name for dropping states.
Methods
Core Execution
step()
step()
Signature:Step a stash of states forward and categorize the successors appropriately.Parameters:Returns:
The name of the stash to step.
The name of the stash to put results in (defaults to same as
stash).If provided, only step states where this returns True.
A maintenance function called after each step.
Custom function to generate successors for a state.
Function that returns the stash name for each state.
SimulationManager - Self, for chaining.run()
run()
Signature:Run until the SimulationManager has reached a completed state or until there is nothing left to run.Parameters:Returns:
Operate on this stash.
Step at most this many times.
A function that takes a SimulationManager and returns True when stepping should terminate.
SimulationManager - Self, for chaining.explore()
explore()
Signature:Tick stash forward, looking for states that match Returns:
find and avoiding states that match avoid.Parameters:The stash to explore.
Maximum number of steps.
An address, list of addresses, or function to identify found states.
An address, list of addresses, or function to identify states to avoid.
Stash to put found states in.
Stash to put avoided states in.
Explore until this many states are found.
SimulationManager - Self, for chaining.Exploration Techniques
use_technique()
use_technique()
Signature:Use an exploration technique with this SimulationManager.Parameters:Returns:
An ExplorationTechnique object that modifies the SimulationManager’s behavior.
ExplorationTechnique - The technique that was added.remove_technique()
remove_technique()
Signature:Remove an exploration technique from the list of active techniques.Parameters:Returns:
The ExplorationTechnique to remove.
ExplorationTechnique - The removed technique.State Management
move()
move()
stash()
stash()
Signature:Stash some states. Alias for Returns:
move() with default stashes.Parameters:Stash states where this returns True.
Take states from this stash.
Put states into this stash.
SimulationManager - Self, for chaining.unstash()
unstash()
Signature:Unstash some states. Alias for Returns:
move() with default stashes.Parameters:Unstash states where this returns True.
Take states from this stash.
Put states into this stash.
SimulationManager - Self, for chaining.drop()
drop()
prune()
prune()
merge()
merge()
Signature:Merge states in a given stash.Parameters:Returns:
Custom merge function (uses state.merge by default).
Function returning a key for grouping mergeable states.
The stash to merge.
Whether to prune before merging.
SimulationManager - Self, for chaining.Utility Methods
apply()
apply()
Signature:Apply a function to states or an entire stash.Parameters:Returns:
Function to apply to each state.
Function to apply to the whole stash.
Stash to work with.
Store results in this stash.
SimulationManager - Self, for chaining.split()
split()
Signature:Split a stash into two based on various criteria.Parameters:Returns:
Function that splits the stash into two lists.
Function that ranks states (first
limit kept).Function providing sort key for states.
Number of states to keep.
SimulationManager - Self, for chaining.populate()
populate()
copy()
copy()
Signature:Make a copy of this simulation manager.Parameters:Returns:
If True, copy all states as well.
SimulationManager - A copy of this manager.complete()
complete()
Signature:Check if the manager has reached a “completed” state according to active exploration techniques.Returns:
bool - True if complete, False otherwise.ErrorRecord Class
debug()
debug()
Launch a postmortem debug shell at the site of the error.
reraise()
reraise()
Re-raise the error with its original traceback.