一句话:首个将控制流跳转信息嵌入 Transformer 的二进制代码相似性检测方法,并发布大规模数据集 BinaryCorp。
二进制代码相似性检测(BCSD)在漏洞检测、软件成分分析和逆向工程中应用广泛,近期研究表明深度神经网络可以从指令或控制流图(CFG)中学习表示以支持 BCSD。本文提出 jTrans,一种基于 Transformer 的二进制代码表示学习方法。它是首个将二进制代码的控制流信息嵌入 Transformer 语言模型的方案:通过对被分析二进制采用新的跳转感知(jump-aware)表示,把跳转指令与其目标地址的关系编码进指令序列,并设计了相应的预训练任务,使模型能在预训练阶段直接学习控制流语义。作者同时向社区发布了一个新构建的大规模二进制数据集 BinaryCorp,其多样性为目前之最。评估结果显示,jTrans 在这一更具挑战性的数据集上比 SOTA 方法提升 30.5%(从 32.0% 提升到 62.5%);在真实世界的已知漏洞搜索任务中,其召回率是现有 SOTA 基线的 2 倍。
Binary code similarity detection (BCSD) has important applications in various fields such as vulnerabilities detection, software component analysis, and reverse engineering. Recent studies have shown that deep neural networks (DNNs) can comprehend instructions or control-flow graphs (CFG) of binary code and support BCSD. In this study, we propose a novel Transformer-based approach, namely jTrans, to learn representations of binary code. It is the first solution that embeds control flow information of binary code into Transformer-based language models, by using a novel jump-aware representation of the analyzed binaries and a newly-designed pre-training task. Additionally, we release to the community a newly-created large dataset of binaries, BinaryCorp, which is the most diverse to date. Evaluation results show that jTrans outperforms state-of-the-art (SOTA) approaches on this more challenging dataset by 30.5% (i.e., from 32.0% to 62.5%). In a real-world task of known vulnerability searching, jTrans achieves a recall that is 2X higher than existing SOTA baselines.
@inproceedings{paperbot7380,
title = {jTrans: jump-aware transformer for binary code similarity detection},
author = {Hao Wang and Wenjie Qu and Gilad Katz and Wenyu Zhu and Zeyu Gao and Han Qiu and Jianwei Zhuge and Chao Zhang},
booktitle = {ISSTA},
year = {2022},
doi = {10.1145/3533767.3534367}
}