angr.analyses.decompiler.edits.resolve¶
Resolution helpers shared by every edit operation: address-or-name to Function, and pseudocode display name to the underlying SimVariable.
- angr.analyses.decompiler.edits.resolve.parse_address(value)¶
Parse an address given as an int or a string. Accepts 0x-prefixed hex and decimal.
- angr.analyses.decompiler.edits.resolve.validate_name(name, *, strict=True)¶
Reject names that cannot be used as identifiers.
strictrequires a C identifier. Without it only whitespace-free names are required, which still admits things likeint;that render as uncompilable C – so strict is the default.
- angr.analyses.decompiler.edits.resolve.resolve_function(kb, *, address=None, name=None, containing=True)¶
Find a function by address or by name.
- class angr.analyses.decompiler.edits.resolve.ResolvedVariable¶
Bases:
objectA pseudocode display name resolved to the objects an edit needs.
variableis the concrete/SSA variable thatset_variable_typeexpects;unifiedis the unified variable that a rename mutates (None for globals, which have no unified form).- kind: Literal['argument', 'local', 'global']
- variable: SimVariable
- unified: SimVariable | None
- __init__(kind, variable, unified, cvar=None, arg_index=None, stack_offset=None, global_addr=None, ambiguous=False)¶
- Parameters:
kind (Literal['argument', 'local', 'global'])
variable (SimVariable)
unified (SimVariable | None)
cvar (CVariable | None)
arg_index (int | None)
stack_offset (int | None)
global_addr (int | None)
ambiguous (bool)
- Return type:
None
- angr.analyses.decompiler.edits.resolve.concrete_variables(varman, resolved)¶
Every SSA variable sharing the resolved variable’s unified form.
Retyping applies to all of them. Computed here rather than relying on
set_variable_type(all_unified=True), which silently does nothing when the variable it is handed is not a key in the SSA-to-unified map.- Return type:
- Parameters:
resolved (ResolvedVariable)
- angr.analyses.decompiler.edits.resolve.list_variable_names(codegen, kb=None, func_addr=None)¶
Every display name addressable in this decompilation, for error messages.
- Return type:
- Parameters:
kb (KnowledgeBase | None)
func_addr (int | None)
- angr.analyses.decompiler.edits.resolve.resolve_variable(kb, func_addr, display_name, *, codegen=None, flavor='pseudocode')¶
Resolve a name as it appears in the pseudocode to the underlying variable.
Precedence is argument > local > global. A name matching more than one variable within the same bucket resolves deterministically and sets
ambiguous, rather than failing – a batch edit should be able to report the collision and continue.- Return type:
- Parameters:
kb (KnowledgeBase)
func_addr (int)
display_name (str)
flavor (str)