jTrans: Jump-Aware Transformer for Binary Code Similarity

Hao Wang, Wenjie Qu, Gilad Katz, Wenyu Zhu, Zeyu Gao +3 more
5/25/2022
258 citations
cs.CRcs.SE
transformer-attention

Official code: vul337/jTrans (196 stars, Python, MIT, last commit 2025-04-10).

Abstract

Binary code similarity detection (BCSD) has important applications in various fields such as vulnerability 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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

vul337/jTransOfficial100%
MIT

Official code of jTrans: Jump-Aware Transformer for Binary Code Similarity Detection

19627Python, ShellMay 25, 20221 years agoMIT

Similar Papers

Cite this paper

@article{wang2022jtrans,
  title  = {jTrans: Jump-Aware Transformer for Binary Code Similarity},
  author = {Hao Wang and Wenjie Qu and Gilad Katz and Wenyu Zhu and Zeyu Gao and Han Qiu and Jianwei Zhuge and Chao Zhang},
  year   = {2022},
  eprint = {2205.12713},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.12713}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.12713.svg)](https://codeofpaper.com/paper/2205.12713)

Discussion