angr.analyses.variable_recovery.variable_recovery_base

angr.analyses.variable_recovery.variable_recovery_base.parse_stack_pointer(sp)

Convert multiple supported forms of stack pointer representations into stack offsets.

Parameters:

sp – A stack pointer representation.

Returns:

A stack pointer offset.

Return type:

int

class angr.analyses.variable_recovery.variable_recovery_base.VariableAnnotation

Bases: Annotation

__init__(addr_and_variables)
Parameters:

addr_and_variables (list[tuple[int, SimVariable]])

addr_and_variables
property relocatable

Returns whether this annotation can be relocated in a simplification.

Returns:

True if it can be relocated, false otherwise.

property eliminatable

Returns whether this annotation can be eliminated in a simplification.

Returns:

True if eliminatable, False otherwise

class angr.analyses.variable_recovery.variable_recovery_base.VariableRecoveryBase

Bases: Analysis

The base class for VariableRecovery and VariableRecoveryFast.

__init__(func, max_iterations, store_live_variables, vvar_to_vvar=None, func_graph=None, entry_node_addr=None)
get_variable_definitions(block_addr)

Get variables that are defined at the specified block.

Parameters:

block_addr (int) – Address of the block.

Returns:

A set of variables.

initialize_dominance_frontiers()
class angr.analyses.variable_recovery.variable_recovery_base.VariableRecoveryStateBase

Bases: object

The base abstract state for variable recovery analysis.

__init__(block_addr, analysis, arch, func, project, *, tv_manager, stack_region=None, register_region=None, global_region=None, typevars=None, type_constraints=None, func_typevar=None, delayed_type_constraints=None, stack_offset_typevars=None)
Parameters:
arch: Arch
stack_region: MultiValuedMemory
register_region: MultiValuedMemory
global_region: MultiValuedMemory
successor_block_addr: int | None
phi_variables: dict[SimVariable, SimVariable]
stack_offset_typevars: dict[int, TypeVariable]
static top(bits)
Return type:

BV

static is_top(thing)
Return type:

bool

static extract_variables(expr)
Return type:

Generator[tuple[int, SimVariable]]

Parameters:

expr (Base)

static annotate_with_variables(expr, addr_and_variables)
Return type:

TypeVar(T, bound= Base)

Parameters:
stack_address(offset)
Return type:

BV

Parameters:

offset (int)

static is_stack_address(addr)
Return type:

bool

Parameters:

addr (Base)

is_global_variable_address(addr)
Return type:

bool

Parameters:

addr (Bits)

get_stack_offset(addr)
Return type:

int | None

Parameters:

addr (Bits)

stack_addr_from_offset(offset)
Return type:

int

Parameters:

offset (int)

property func_addr
property dominance_frontiers
property variable_manager
property variables
get_variable_definitions(block_addr)

Get variables that are defined at the specified block.

Parameters:

block_addr (int) – Address of the block.

Returns:

A set of variables.

add_type_constraint(constraint)

Add a new type constraint.

Parameters:

constraint

Returns:

add_type_constraint_for_function(func_typevar, constraint)

Add a new type constraint for a specified function.

Parameters:
  • func_typevar

  • constraint

Returns:

downsize()

Remove unnecessary members.

Return type:

None

Returns:

None

static downsize_region(region)

Get rid of unnecessary references in region so that it won’t avoid garbage collection on those referenced objects.

Parameters:

region (MultiValuedMemory) – A MultiValuedMemory region.

Return type:

MultiValuedMemory

Returns:

None