angr.state_plugins.debug_variables¶
- class angr.state_plugins.debug_variables.SimDebugVariable¶
Bases:
objectA 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:
state (SimState)
var_type (VariableType)
- static from_cle_variable(state, cle_variable, dwarf_cfa)¶
- Return type:
- Parameters:
- property mem_untyped: SimMemView¶
- property mem: SimMemView¶
- property string: SimMemView¶
- property resolvable¶
- property resolved¶
- property concrete¶
- store(value)¶
- property deref: SimDebugVariable¶
- array(i)¶
- Return type:
- class angr.state_plugins.debug_variables.SimDebugVariablePlugin¶
Bases:
SimStatePluginThis 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_namebased on the currentstate.ip.- Return type:
- 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¶