angr.ailment.block_walker¶
- class angr.ailment.block_walker.AILBlockWalker¶
Bases:
GenericWalks all statements and expressions of an AIL node and construct arbitrary values based on them.
Note that we lazily initialize self._stmt_handlers and self._expr_handlers when they are accessed. This is to support the existing pattern of updating stmt/expr handlers in-place after creating a block walker, and is slightly slower. Overridding handler methods in a new class is the fastest approach.
- __init__(stmt_handlers=None, expr_handlers=None)¶
- property expr_handlers: dict[type, Callable[[int, Any, int, Statement | None, Block | None], ExprType]]¶
- reset()¶
Reset per-walk state variables so that this walker can be reused for another walk. Subclasses that updates state across a walk must override this to clear that state.
- Return type:
- walk_statement(stmt, block=None, stmt_idx=0)¶
- class angr.ailment.block_walker.AILBlockViewer¶
Bases:
AILBlockWalker[None,None,None]Walks all statements and expressions of an AIL node and do nothing.
- class angr.ailment.block_walker.AILBlockRewriter¶
Bases:
AILBlockWalker[Expression,Statement,Block]Walks all statements and expressions of an AIL node, and rebuilds expressions, statements, or blocks if needed.
If you need a pure walker without rebuilding, use AILBlockViewer instead.
- Variables:
update_block – True if the block should be updated in place, False if a new block should be created and returned as the result of walk().
replace_phi_stmt – True if you want _handle_Phi be called and vvars potentially replaced; False otherwise. Default to False because in the most majority cases you do not want vvars in a Phi variable be replaced.