arrow
Return

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
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

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.
Keywords:
Code Similarity Detection
Representation learning
Cross-modal code matching

Journal

Neurocomputing cover
Neurocomputing
IF:
6.5
Papers:
2.5W
Citations:
6.5W

Organization

C
Communication University of China
Scholars:
1.1K
Papers: 820
Citations: 326
Cited Papers

Cited Papers

err
IF0
err
err0
PREAI
err
errShare
errSave
errShare
errSave
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
errShare
errSave
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
errShare
errSave
Deep learning application on code clone detection: A review of current knowledge
err2022-02-01
err29
PREAI
errLei, Maggie; Li, Hao; Li, Ji; Aundhkar, Namrata; Kim, Dae-Kyoo
errShare
errSave
errShare
errSave
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
errShare
errSave
Enhancing code summarization with action word prediction
err2024-01-01
err5
PREAI
errLi, Mingchen; Yu, Huiqun; Fan, Guisheng; Zhou, Ziyi; Huang, Zijie
errShare
errSave
researcher View more