arrow
返回

CrossCode2Vec: A unified representation across source and binary functions for code similarity detection

delete2025-03-01
delete0
PRE
AI
G
Gaoqing Yu
J
Jing An
L
Lyu, Jiuyang
W
Wei Huang
W
Wenqing Fan
Y
Yixuan Cheng
A
Aina Sui *
DOI:10.1016/j.neucom.2024.129238delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code similarity detection identifies code by analyzing similarities in syntax, semantics, and structure, which includes types of tasks: source-to-source, binary-to-binary, and source-to-binary. Due to encoding and representation disparities between source and binary code, existing methods have mainly focused on individual tasks, without providing a universal solution. Additionally, current source-to-binary tasks only achieve one-to-one matching between source code and binary functions, neglecting the one-to-many relationship inherent between source code and its cross-compiled binaries. In this paper, we propose CrossCode2Vec, a unified framework for representing code in both source and binary functions, which aims to bridge the gap in original coding features and provide a standardized similarity measurement across three code similarity detection tasks. For source code and its corresponding compiled binary, we first design an enhanced Abstract Path Context data preprocessing method, construct an abstract syntax tree (AST) from both source code functions and decompiled binary functions, and implement the function embedding followed by the pre-trained Word2vec model. Then we propose a task-specific data sampling strategy. We establish a one-to-one correspondence between source and binary functions through symbol tables and create a one-to-many relationship between source functions and their cross-compiled binaries based on sampling rules. Finally, we employ a hierarchical LSTM-attention network to facilitate the representation and similarity measurement of functions. We conduct both extrinsic and intrinsic evaluations to confirm the effectiveness of CrossCode2Vec in code representation and code similarity tasks, validating its superiority in model architecture and data processing methods. CrossCode2Vec demonstrates stable and exceptional performance across multiple experiments, reinforcing its ability to bridge the gap between source and binary code representations while effectively measuring their similarities.
Keyword:
Code Similarity Detection
Representation learning
Cross-modal code matching

期刊

Neurocomputing 封面图
Neurocomputing
IF:
6.5
论文数:
2.5W
被引数:
6.5W

机构

C
Communication University of China
学者数:
1.1K
论文数: 820
被引数: 326
引用论文

引用论文

err
IF0
err
err0
PREAI
err
err分享
err收藏
err分享
err收藏
Semantic Learning and Emulation Based Cross-Platform Binary Vulnerability Seeker
err2021-11-01
err15
errOAAI
errGao, Jian; Jiang, Yu; Liu, Zhe; Yang, Xin; Wang, Cong; Jiao, Xun; Yang, Zijiang; Sun, Jiaguang
err分享
err收藏
LibAM: An Area Matching Framework for Detecting Third-Party Libraries in Binaries
err2023-12-23
err2
errOAAI
errLi, Siyuan; Wang, Yongpan; Dong, Chaopeng; Yang, Shouguo; Li, Hong; Sun, Hao; Lang, Zhe; Chen, Zuxin; Wang, Weijie; Zhu, Hongsong; Sun, Limin
err分享
err收藏
err分享
err收藏
B2SMatcher: fine-Grained version identification of open-Source software in binary files
err2021-08-02
err8
errOAAI
errBan, Gu; Xu, Lili; Xiao, Yang; Li, Xinhua; Yuan, Zimu; Huo, Wei
err分享
err收藏
Enhancing code summarization with action word prediction用动作词预测增强代码摘要
err2024-01-01
err5
PREAI
errLi, Mingchen; Yu, Huiqun; Fan, Guisheng; Zhou, Ziyi; Huang, Zijie
err分享
err收藏
学者 查看更多内容