SemDiff: Binary similarity detection by diffing key-semantics graphs.
Zian Liu, Xiaoxi Meng, Viet Vo, Siqi Ma, Chao Chen, Dongxi Liu, Jun Zhang, Shigang Liu,
Swinburne University of Technology, 1 John Street, Melbourne, VIC, 3122, Australia; Data 61, CSIRO, Corner Vimiera &, Pembroke Rd, Sydney, NSW,2122, Australia. Electronic address: zianliu@swin.edu.au. · Swinburne University of Technology, 1 John Street, Melbourne, VIC, 3122, Australia.
Key points
From the paper's conclusion- We calculate the locality-sensitive hash value for all token lists and quantify their similarity.
Abstract
Binary similarity detection is a critical technique that has been applied in many real-world scenarios where source code is not available, e.g., bug search, malware analysis, and code plagiarism detection for executable binary code. Existing works are ineffective in detecting similar binaries in cases where different compiling optimizations, compilers, source code versions, or obfuscation are deployed. We observe that all the cases do not change a binary's key code behaviors although they significantly modify its syntax and structure. With this key observation, we extract a set of key instructions from a binary to capture its key code behaviors. By detecting the similarity between two binaries' key instructions, we can address well the ineffectiveness limitation of existing works. Specifically, we translate each extracted key instruction into a self-defined key expression, generating a key-semantics graph based on the binary's control flow. Each node in the key-semantics graph denotes a key instruction, and the node attribute is the key expression. To quantify the similarity between two given key-semantics graphs, we first serialize each graph into a sequence of key expressions by topological sort. Then, we tokenize and concatenate key expressions to generate token lists. We calculate the locality-sensitive hash value for all token lists and quantify their similarity. Our evaluation results show that overall, SemDiff outperforms state-of-the-art tools when detecting the similarity of binaries generated from different optimization levels, compilers, and obfuscations. SemDiff is also effective for library version search and finding similar vulnerabilities in firmware.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Fool Me If You Can: On the Robustness of Binary Code Similarity Detection Models against Semantics-Preserving TransformationsProceedings of the ACM on software engineering. · 2026
- Revisiting Graph Representations for ML-Based Binary Code Similarity Detection: A Systematic StudyProceedings of the ACM on Software Engineering · 2026
- From Similarity Ranking to Definitive Verdict: LLM-Enhanced Source-to-Binary Function LocalizationProceedings of the ACM on Programming Languages · 2026
- MicroSim: Contrastive Graph Neural Networks for Binary Code Similarity DetectionarXiv · 2026
- Learning Spectral Representations of Code through Latent Graph Learning for Generalizable Cross-Language Code Clone DetectionarXiv · 2026
- Revisiting Re-executability: Coverage-Guided Symbolic Feedback to Improve DecompilationarXiv · 2026