BinEnhance:一种基于外部环境语义的二进制代码搜索增强框架
BinEnhance: An Enhancement Framework Based on External Environment Semantics for Binary Code Search
AI总结:
BinEnhance通过构建外部环境语义图并利用关系图卷积网络增强函数内部语义表达,从而提升二进制代码搜索性能,在多个模型上显著提高MAP并实现四倍效率提升。
摘要:
二进制代码搜索在软件复用检测等应用中发挥着至关重要的作用。目前,现有模型通常基于内部代码语义,或者基于函数调用图(CG)与内部代码语义的组合。然而,这些模型存在局限性。内部代码语义模型只考虑函数内部的语义,忽略了函数间语义,难以处理函数内联等情况。CG与内部代码语义的组合不足以应对复杂的现实场景。为了解决这些局限性,我们提出了BinEnhance,这是一个新颖的框架,旨在利用函数间语义来增强二进制代码搜索中内部代码语义的表达。具体而言,BinEnhance构建了一个外部环境语义图(EESG),通过使用不同的函数间语义关系(例如调用、位置、数据共用)为同源函数建立稳定且相似的外部环境。在构建EESG之后,我们利用现有内部代码语义模型生成的嵌入来初始化EESG的节点。最后,我们设计了一个语义增强模型(SEM),该模型使用关系图卷积网络(RGCN)和一个残差块在EESG上学习有价值的外部语义,以生成增强的语义嵌入。此外,BinEnhance利用数据特征相似性来细化语义嵌入的余弦相似度。我们在六种不同的任务下进行了实验(例如函数内联场景),结果说明了BinEnhance的性能和鲁棒性。将BinEnhance应用于两个公共数据集上的HermesSim、Asm2vec、TREX、Gemini和Asteria,使平均精度均值(MAP)从53.6%提高到69.7%。此外,效率提高了四倍。
英文摘要:
Binary code search plays a crucial role in applications like software reuse detection. Currently, existing models are typically based on either internal code semantics or a combination of function call graphs (CG) and internal code semantics. However, these models have limitations. Internal code semantic models only consider the semantics within the function, ignoring the inter-function semantics, making it difficult to handle situations such as function inlining. The combination of CG and internal code semantics is insufficient for addressing complex real-world scenarios. To address these limitations, we propose BinEnhance, a novel framework designed to leverage the inter-function semantics to enhance the expression of internal code semantics for binary code search. Specifically, BinEnhance constructs an External Environment Semantic Graph (EESG), which establishes a stable and analogous external environment for homologous functions by using different inter-function semantic relations (e.g., call, location, data-co-use). After the construction of EESG, we utilize the embeddings generated by existing internal code semantic models to initialize nodes of EESG. Finally, we design a Semantic Enhancement Model (SEM) that uses Relational Graph Convolutional Networks (RGCNs) and a residual block to learn valuable external semantics on the EESG for generating the enhanced semantics embedding. In addition, BinEnhance utilizes data feature similarity to refine the cosine similarity of semantic embeddings. We conduct experiments under six different tasks (e.g., under function inlining scenario) and the results illustrate the performance and robustness of BinEnhance. The application of BinEnhance to HermesSim, Asm2vec, TREX, Gemini, and Asteria on two public datasets results in an improvement of Mean Average Precision (MAP) from 53.6% to 69.7%. Moreover, the efficiency increases fourfold.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。