angr.analyses.decompiler.expression_narrower

class angr.analyses.decompiler.expression_narrower.ExprNarrowingInfo

Bases: object

Stores the analysis result of _narrowing_needed().

__init__(narrowable, to_size=None, use_exprs=None, phi_vars=None)
Parameters:
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.

__init__(ignore_call_args=True)
Parameters:

ignore_call_args (bool)

vvar_effective_bits: dict[int, dict[int, tuple[int, int]]]
vvar_call_arg_effective_bits: dict[int, tuple[int, int]]
vvars_used_as_insert_base: set[int]
class angr.analyses.decompiler.expression_narrower.ExpressionNarrower

Bases: AILBlockRewriter

Narrows an expression regardless of whether the expression is a definition or a use.

__init__(project, rd, manager, narrowables, addr2blocks, new_blocks)
Parameters:
new_vvar_sizes: dict[int, int]
replacement_core_vvars: dict[int, list[VirtualVariable]]
walk(block)
Parameters:

block (Block)