angr.analyses.decompiler.optimization_passes.fp_negation¶
- class angr.analyses.decompiler.optimization_passes.fp_negation.FpNegation¶
Bases:
OptimizationPassRewrite floating-point sign-bit XORs (
xorps/xorpd) into negation.The lifter cannot tell an FP sign flip from an arbitrary 128-bit integer XOR with a sign-shaped constant; both produce the same AIL. This pass only rewrites when the XORed value is provably floating-point: it lives in an FP argument register of the prototype, or has FP provenance in the expression (FP conversions and operations, traced through local definitions).
It runs right before variable recovery, ahead of KnownPatternOutliner (which would otherwise outline the XOR as an opaque
fneg()call), so Typehoon sees a floating-point negation instead of an integer XOR.- ARCHES = ['X86', 'AMD64']¶
- PLATFORMS = ['linux', 'windows']¶
- STAGE: OptimizationPassStage = 7¶
- NAME = 'Rewrite FP sign-bit XOR to negation'¶
- DESCRIPTION = 'Rewrite floating-point sign-bit XORs (``xorps``/``xorpd``) into negation.\n\n The lifter cannot tell an FP sign flip from an arbitrary 128-bit integer\n XOR with a sign-shaped constant; both produce the same AIL. This pass only\n rewrites when the XORed value is provably floating-point: it lives in an FP\n argument register of the prototype, or has FP provenance in the expression\n (FP conversions and operations, traced through local definitions).\n\n It runs right before variable recovery, ahead of KnownPatternOutliner (which\n would otherwise outline the XOR as an opaque ``fneg()`` call), so Typehoon\n sees a floating-point negation instead of an integer XOR.'¶
- __init__(func, *args, **kwargs)¶