BScout improves matching of binary code to source functions accurately
Recall-Oriented Precise Binary-to-Source Function Matching
Software Engineering
Summary
Matching parts of compiled software back to their original source code helps identify reused code but is tricky when the exact match isn't among the first guesses or when multiple source functions are combined into one compiled piece. The authors propose BScout, a method that uses known matches to find more correct source matches beyond initial guesses and handles combined functions better. BScout also uses language models to pick and check matches, improving accuracy. Tests show BScout finds more correct pairs with better precision and recall than previous methods, especially on complex software.
What this means in practice
- •For software security teams: Identify reused or vulnerable third-party code in large compiled applications even when original source references are incomplete or inlined.
- •For reverse engineering professionals: Improve accuracy of tracing binary functions back to their original source, aiding software comprehension and analysis.
Authors
Junlin Li, Jianjun Huang, Wei You, Bin Liang
Abstract
Binary-to-source function matching supports software composition analysis by identifying reused third-party code, but existing embedding-based approaches restrict subsequent refinement to initially retrieved candidates. When the correct source function is absent from this set, selecting or filtering the available candidates cannot recover the match. Inlining further complicates the retrieval by combining multiple source functions into one binary function. In this paper, we propose BScout to improve matching precision and uncover additional matches. BScout uses the positional information of existing matches to supplement candidates for unresolved binary functions, extending the search beyond the initial candidate set, and adopts composition-aware training to address the inlined composition matching. Large language models are adopted to select and review matches, while positional information also helps filter inconsistent results. Experiments show that BScout is effective in binary-to-source function matching. BScout achieves overall higher precision, recall and F1 scores than BinaryAI and SBridge with acceptable analysis costs. Particularly, on large stripped binaries, BScout outperforms the competitors with a precision increment of 32% and approximately 2.9 times the recall.