angr.analyses.s_reaching_definitions.s_rda_model

class angr.analyses.s_reaching_definitions.s_rda_model.SRDAModel

Bases: object

The model for SRDA.

__init__(func_graph, func_args, arch, variable_map=None)
add_vvar_use(vvar_id, expr, loc)
Return type:

None

Parameters:
update_after_block_edits(edited_blocks)

Incrementally update the model after the statements of edited_blocks were edited in place (statement indices preserved, e.g. by replacing removed statements with NoOp placeholders). vvar definitions and explicit vvar uses inside the edited blocks are recomputed from the edited blocks; implicit uses (expr is None, e.g. call-site argument registers) and all unedited blocks are left untouched.

This is designed to be equivalent to a full SRDA rebuild on the edited graph for the kind of edits performed by dead-assignment removal: statements are only removed (turned into NoOp) or rewritten in place, never inserted or reordered, and removed vvars are dead (so they are never used elsewhere, including by phi nodes or implicit call-site uses). Tmp tracking is not updated (AILSimplifier does not track tmps).

Return type:

None

canonical_form()

An order-insensitive snapshot of the model’s vvar-keyed data, for asserting equivalence between an incrementally-updated model and a freshly-rebuilt one (used by the incremental-update verification harness).

property all_definitions: Iterator[Definition[VirtualVariable, AILCodeLocation]]
is_phi_vvar_id(idx)
Return type:

bool

Parameters:

idx (int)

get_all_definitions(block_loc)
Return type:

set[Definition[VirtualVariable | Tmp, AILCodeLocation]]

Parameters:

block_loc (AILCodeLocation)

get_all_tmp_definitions(block_loc)
Return type:

set[Definition[Tmp, AILCodeLocation]]

Parameters:

block_loc (Address)

get_uses_by_location(loc, exprs=False)
Overloads:
  • self, loc (AILCodeLocation), exprs (Literal[True]) → set[tuple[Definition[atoms.VirtualVariable, AILCodeLocation], Any | None]]

  • self, loc (AILCodeLocation), exprs (Literal[False]) → set[Definition[atoms.VirtualVariable, AILCodeLocation]]

Parameters:
Return type:

set[Definition[VirtualVariable, AILCodeLocation]] | set[tuple[Definition[VirtualVariable, AILCodeLocation], Any | None]]

Retrieve all definitions that are used at a given location.

Parameters:
Returns:

A set of definitions that are used at the given location.

Return type:

set[Definition[VirtualVariable, AILCodeLocation]] | set[tuple[Definition[VirtualVariable, AILCodeLocation], Any | None]]

get_vvar_uses(obj)
Return type:

set[AILCodeLocation]

Parameters:

obj (VirtualVariable | VirtualVariable)

get_vvar_uses_with_expr(obj)
Return type:

set[tuple[VirtualVariable | None, AILCodeLocation]]

Parameters:

obj (VirtualVariable | VirtualVariable)

get_tmp_uses(obj, block_loc)
Return type:

set[AILCodeLocation]

Parameters:
  • obj (Tmp)

  • block_loc (Address)

get_uses_by_def(def_)
Return type:

set[AILCodeLocation]

Parameters:

def_ (Definition[VirtualVariable | Tmp, AILCodeLocation])