一句话:提出融合函数上下文与内容相似度、并用LLM验证候选的二进制代码相似性检测框架Co2FuLL,兼顾精确率、召回率与可解释性。
二进制代码相似性检测(BCSD)对漏洞检测等任务至关重要,但现有方法难以在大规模场景下兼顾高精确率与高召回率,且因忽略函数上下文、仅依赖相似度输出而缺乏可解释性。本文基于两点洞察:二进制函数并非自包含,其功能依赖函数之外的代码与数据;LLM 既能分析代码也能生成合理解释。据此提出通用框架 Co2FuLL:先系统选取稳定且有代表性的代码与数据特征及其对函数的依赖,构造函数上下文;再将其与既有 BCSD 方法计算的内容相似度融合,大幅缩小候选搜索空间;最后用精心设计的提示让 LLM 验证剩余候选并生成人类可读的解释。在多种编译设置及二进制剥离后的大型函数池上评估,基于 HermesSim 与 DeepSeek-V3 的 Co2FuLL 达到 80.5% 精确率与 94.4% 召回率,较基线分别提升 142.5% 与 42.2%。
Binary Code Similarity Detection (BCSD), essential for binary-code related tasks like vulnerability detection, has attracted increasing attention in recent years. However, existing methods frequently fall short of achieving both high precision and recall at scale, and their results often lack interpretability due to the neglect of function context and reliance on purely similarity-driven outputs. Our key insights are twofold: 1) Binary functions are not self-contained; they depend on other code and data beyond their content to fulfill their functionalities. 2) Large language models (LLMs) excel not only at analyzing code but also at generating reasonable explanations. Motivated by these insights, we propose a general BCSD framework, Co2F uLL. We first systematically select stable and representative code and data features, along with their corresponding dependencies on the functions, to construct the function context. Then, by fusing function context with content similarities computed by the existing BCSD approach, we substantially narrow down the search space. Ultimately, we employ LLMs with a carefully designed prompt to verify the remaining candidates and produce clear, human-readable explanations. We conduct comprehensive experiments on a large function pool under varying compilation settings and after binary stripping. The results show that Co2F uLL based on HermesSim and DeepSeek-V3 achieves 80.5% precision and 94.4% recall, improving the baseline HermesSim by 142.5% and 42.2%, respectively, providing an accurate and interpretable solution for BCSD.
DOI 原文 ·
@inproceedings{paperbot9326,
title = {Advancing Binary Code Similarity Detection via Context-Content Fusion and LLM Verification},
author = {Chaopeng Dong and Jingdong Guo and Shouguo Yang and Yi Li and Dongliang Fang and Yang Xiao and Yongle Chen and Limin Sun},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00033}
}