angr.blade

exception angr.blade.BadJumpkindNotification

Bases: Exception

Notifies the caller that the jumpkind is bad (e.g., Ijk_NoDecode)

class angr.blade.Blade

Bases: object

Blade is a light-weight program slicer that works with networkx DiGraph containing CFGNodes. It is meant to be used in angr for small or on-the-fly analyses.

__init__(graph, dst_run, dst_stmt_idx, direction='backward', project=None, cfg=None, ignore_sp=False, ignore_bp=False, ignored_regs=None, max_level=3, base_state=None, stop_at_calls=False, cross_insn_opt=False, max_predecessors=10, include_imarks=True, control_dependence=True, block_cache=None)
Parameters:
  • graph (DiGraph) – A graph representing the control flow graph. Note that it does not take angr.analyses.CFGEmulated or angr.analyses.CFGFast.

  • dst_run (int) – An address specifying the target SimRun.

  • dst_stmt_idx (int) – The target statement index. -1 means executing until the last statement.

  • direction (str) – ‘backward’ or ‘forward’ slicing. Forward slicing is not yet supported.

  • project (angr.Project) – The project instance.

  • cfg (angr.analyses.CFGBase) – the CFG instance. It will be made mandatory later.

  • ignore_sp (bool) – Whether the stack pointer should be ignored in dependency tracking. Any dependency from/to stack pointers will be ignored if this options is True.

  • ignore_bp (bool) – Whether the base pointer should be ignored or not.

  • max_level (int) – The maximum number of blocks that we trace back for.

  • stop_at_calls (bool) – Limit slicing within a single function. Do not proceed when encounters a call edge.

  • include_imarks (bool) – Should IMarks (instruction boundaries) be included in the slice.

  • control_dependence (bool) – Whether to consider control dependencies. If True, the temps controlling conditional exits will be added to the tainting set.

  • block_cache (dict[int, Block] | None) – Lifted blocks keyed by address, shared with the caller so that slices of the same region (e.g., at growing depths) lift each block once. The caller must only share it between slices lifted with the same parameters.

  • max_predecessors (int)

Returns:

None

property slice
get_block(addr)

The block at addr, lifted with this slice’s parameters (cached).

Return type:

Block

Parameters:

addr (int)

dbg_repr(arch=None)