angr.analyses.decompiler.expression_narrower¶
- class angr.analyses.decompiler.expression_narrower.ExprNarrowingInfo¶
Bases:
objectStores the analysis result of _narrowing_needed().
- __init__(narrowable, to_size=None, use_exprs=None, phi_vars=None)¶
- Parameters:
narrowable (bool)
to_size (int | None)
use_exprs (list[tuple[VirtualVariable, AILCodeLocation]] | None)
phi_vars (set[VirtualVariable] | None)
- narrowable
- to_size
- use_exprs
- phi_vars
- class angr.analyses.decompiler.expression_narrower.EffectiveSizeExtractor¶
Bases:
AILBlockWalker[None,None,None]Walks a statement once and extracts the effective size (in bits) of every virtual variable that appears in it.
For example, for virtual variable rax, (rax & 0xff) + 0x1 means the effective size of rax is 8 bits, from bit 0 to bit 7. We record this information in vvar_effective_bits as {rax.varid: {rax.idx: (0, 8)}}.
We pay special consideration to expressions that are used as Call arguments, as they may have been converted to a smaller size because the Call argument needs that size, but the Call prototype may have been incorrectly inferred.
A single walk records information for all virtual variables in the statement, so one walker instance can be queried for many different variables without re-walking the statement. Constraints that parent expressions impose on their children are tracked per expression node (keyed by object identity) during the walk; results are aggregated per (varid, expression idx) so that repeated occurrences of the same variable are kept separate.
- class angr.analyses.decompiler.expression_narrower.ExpressionNarrower¶
Bases:
AILBlockRewriterNarrows an expression regardless of whether the expression is a definition or a use.
- __init__(project, rd, manager, narrowables, addr2blocks, new_blocks)¶
- replacement_core_vvars: dict[int, list[VirtualVariable]]