angr.analyses.decompiler.optimization_passes.insert_extract_reverter¶
Function-level optimization pass that collapses Insert/Extract round-trips.
On i386 cdecl at O0, double parameters are decomposed into 4-byte halves and reassembled via Insert/Extract chains that may span multiple blocks:
Block A:
vvar_56 = Extract(a1, 32bits@0)
vvar_57 = Extract(a1, 32bits@4)
Block B:
vvar_61 = Insert(base, 0x4, vvar_57)
vvar_62 = Insert(vvar_61, 0x0, vvar_56)
call(vvar_62)
This pass resolves VVar references to their definitions across blocks and replaces the Insert chain with a direct reference to the source variable:
Block B:
call(a1)
When the two Inserts overwrite the whole base but their values are not halves of one source (MSVC spilling two
dword arguments into a qword slot for fild qword), the pair becomes hi Concat lo (except in Go binaries).
The Extract definitions (and any copies between them and the Inserts, or the overwritten base) are dropped once the
collapse leaves them without uses. They are O0 spills of the parameter halves into stack locals; the generic dead-assignment removal keeps
unused stack variables, so they would otherwise survive as v0 = *((unsigned int *)&a0).
- class angr.analyses.decompiler.optimization_passes.insert_extract_reverter.InsertExtractReverter¶
Bases:
OptimizationPassCollapse cross-block Insert(Extract()) round-trips into direct variable references.
- ARCHES = None¶
- PLATFORMS = None¶
- STAGE: OptimizationPassStage = 5¶
- NAME = 'Collapse Insert/Extract round-trips'¶
- DESCRIPTION = 'Collapse cross-block Insert(Extract()) round-trips into direct variable references.'¶
- __init__(func, manager=None, **kwargs)¶