Skip to content

aligned-entry: reduce false positives on -O2 optimized binaries #18

Description

@dodoazzurro

The combined detector (DetectFunctionsFromELF) produces a ~2.8x FP multiplier on -O2 binaries (14 FPs for 5 real functions in a stripped test binary). Recall is 5/5 but the noise makes the output impractical without post-filtering by the caller.

The FPs come from all three strategies combined - prologue, call-site, and aligned-entry. Aligned-entry is the likely largest contributor and the most tractable to improve, but the combined FP rate will never reach 0x: prologue patterns can match inside functions and call-site analysis picks up non-function jump targets regardless.

The most actionable starting point is reducing the aligned-entry noise. The main source there is loop-head alignment: with -O2, GCC aligns loop heads to 16-byte boundaries using NOP fill, producing the same ret + NOP padding + 16-byte aligned address pattern as a function separator.

/cc @maxgio92

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions