Artifacts for our USENIX Security '24 paper: "Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection".
Based on repository activity, growth velocity and community engagement.
27
Growth2/30
Activity6/25
Popularity8/25
Trust12/20
86
Stars
High
Sentiment
Votes
86
README.md
HermesSim
This repository contains the code and the dataset for our USENIX Security '24 paper:
Haojie He, Xingwei Lin, Ziang Weng,
Ruijie Zhao, Shuitao Gan, Libo Chen, Yuede Ji, Jiashui Wang, and Zhi Xue. Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection. USENIX Security '24.
bin: binaries of external tools. The only external tool: gsat-1.0.jar.
dbs: contains description files and feature files (including the extracted graphs) of the datasets. Available at here.
inputs: contains the inputs for the neural network models (the outputs of the preprocessing step). Available at here.
outputs: contains the outputs of the neural network models (checkpoint files, inferred embeddings, log and configure files, and etc.) and the outputs of fast evaluation (summary_*.csv and *_MRR_Recall_max.csv files). Available at .
1. Lifting binary functions Pcode based representations.
Related folders: lifting, dbs, bin, binaries
If you are only interested in running experiments on the two datasets used in the paper, you can skip this step since we have provide all the intermediate results you need in the `dbs' folder.
The second step is graph normalization and encoding.
See preprocess/preprocess_all.sh for examples.
3. Model Training / Inferring
Related folders: model, dbs, inputs, outputs
The following example will run the representation part of our ablation study, including both training and inferring. The inferring step will output the embeddings of all functions in the testing dataset. More configure files can be found in model/configures.
By default, the model/main.py will put results in the outputs folder.
4. Result Analysis
Related folders: postprocess, outputs
4.1 Generate Testing Pairs
This step samples testing pairs from the whole testing dataset. The following example generates testing pairs for the XM task with 1000 query functions and 10000 negative functions per query. The script outputs a pos-*.csv file and a neg-*.csv file, which contain postives pairs and negative pairs, respectively.