angr.ailment.block_walker

class angr.ailment.block_walker.AILBlockWalker

Bases: Generic

Walks all statements and expressions of an AIL node and construct arbitrary values based on them.

__init__(stmt_handlers=None, expr_handlers=None)
walk(block)
Return type:

TypeVar(BlockType)

Parameters:

block (Block)

walk_statement(stmt, block=None, stmt_idx=0)
Return type:

TypeVar(StmtType)

Parameters:
walk_expression(expr, stmt_idx=None, stmt=None, block=None)
Return type:

TypeVar(ExprType)

Parameters:
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.

__init__(stmt_handlers=None, expr_handlers=None, update_block=True, replace_phi_stmt=False)
Parameters:
  • update_block (bool)

  • replace_phi_stmt (bool)