angr.exploration_techniques.director¶
- class angr.exploration_techniques.director.BaseGoal¶
Bases:
object- REQUIRE_CFG_STATES = False¶
- __init__(sort)¶
- check(cfg, state, peek_blocks)¶
- Parameters:
cfg (angr.analyses.CFGEmulated) – An instance of CFGEmulated.
state (angr.SimState) – The state to check.
peek_blocks (int) – Number of blocks to peek ahead from the current point.
- Returns:
True if we can determine that this condition is definitely satisfiable if the path is taken, False otherwise.
- Return type:
- class angr.exploration_techniques.director.ExecuteAddressGoal¶
Bases:
BaseGoalA goal that prioritizes states reaching (or are likely to reach) certain address in some specific steps.
- __init__(addr)¶
- check(cfg, state, peek_blocks)¶
Check if the specified address will be executed
- class angr.exploration_techniques.director.CallFunctionGoal¶
Bases:
BaseGoalA goal that prioritizes states reaching certain function, and optionally with specific arguments. Note that constraints on arguments (and on function address as well) have to be identifiable on an accurate CFG. For example, you may have a CallFunctionGoal saying “call printf with the first argument being ‘Hello, world’”, and CFGEmulated must be able to figure our the first argument to printf is in fact “Hello, world”, not some symbolic strings that will be constrained to “Hello, world” during symbolic execution (or simulation, however you put it).
- REQUIRE_CFG_STATES = True¶
- __init__(function, arguments)¶
- check(cfg, state, peek_blocks)¶
Check if the specified function will be reached with certain arguments.
- Parameters:
cfg
state
peek_blocks
- Returns:
- class angr.exploration_techniques.director.Director¶
Bases:
ExplorationTechniqueAn exploration technique for directed symbolic execution.
A control flow graph (using CFGEmulated) is built and refined during symbolic execution. Each time the execution reaches a block that is outside of the CFG, the CFG recovery will be triggered with that state, with a maximum recovery depth (100 by default). If we see a basic block during state stepping that is not yet in the control flow graph, we go back to control flow graph recovery and “peek” more blocks forward.
When stepping a simulation manager, all states are categorized into three different categories:
Might reach the destination within the peek depth. Those states are prioritized.
Will not reach the destination within the peek depth. Those states are de-prioritized. However, there is a little chance for those states to be explored as well in order to prevent over-fitting.
- __init__(peek_blocks=100, peek_functions=5, goals=None, cfg_keep_states=False, goal_satisfied_callback=None, num_fallback_states=5)¶
Constructor.
- step(simgr, stash='active', **kwargs)¶
- Parameters:
simgr
stash
kwargs
- Returns: