angr.state_plugins.debug_variables

class angr.state_plugins.debug_variables.SimDebugVariable

Bases: object

A SimDebugVariable will get dynamically created when queriyng for variable in a state with the SimDebugVariablePlugin. It features a link to the state, an address and a type.

__init__(state, addr, var_type)
Parameters:
static from_cle_variable(state, cle_variable, dwarf_cfa)
Return type:

SimDebugVariable

Parameters:
property mem_untyped: SimMemView
property mem: SimMemView
property string: SimMemView
with_type(sim_type)
Return type:

SimMemView

Parameters:

sim_type (SimType)

property resolvable
property resolved
property concrete
store(value)
property deref: SimDebugVariable
array(i)
Return type:

SimDebugVariable

member(member_name)
Return type:

SimDebugVariable

Parameters:

member_name (str)

class angr.state_plugins.debug_variables.SimDebugVariablePlugin

Bases: SimStatePlugin

This is the plugin you’ll use to interact with (global/local) program variables. These variables have a name and a visibility scope which depends on the pc address of the state. With this plugin, you can access/modify the value of such variable or find its memory address. For creating program variables, or for importing them from cle, see the knowledge plugin debug_variables. Run p.kb.dvars.load_from_dwarf() before using this plugin.

Example

>>> p = angr.Project("various_variables", load_debug_info=True)
>>> p.kb.dvars.load_from_dwarf()
>>> state =  # navigate to the state you want
>>> state.dvars.get_variable("pointer2").deref.mem
<int (32 bits) <BV32 0x1> at 0x404020>
get_variable(var_name)

Returns the visible variable (if any) with name var_name based on the current state.ip.

Return type:

SimDebugVariable

Parameters:

var_name (str)

property dwarf_cfa

Returns the current cfa computation. Set this property to the correct value if needed.

property dwarf_cfa_approx