Binary code similarity detection can identify homologous functions in software, thereby locating critical modules. When attackers apply this technology to reverse engineering, posing significant risks to software security. Code obfuscation can increase software complexity and enhance its resistance to detection. Traditional code obfuscation techniques are primarily implemented within a single function, often resulting in substantial space and runtime overhead. To address this, a code obfuscation method based on function splitting to counteract binary code similarity detection is proposed in this paper. The proposed method is operated at the intermediate representation level of the program. First, the basic block set of the original function is partitioned into multiple subsets based on the dominator tree. Second, data dependencies between subsets are identified through def-use chains. Subsequently, control variables are introduced to repair the control flow among these subsets. Finally, sub-functions are generated via code rewriting. Experimental results demonstrate that after applying function-splitting obfuscation, the recall rate of binary similarity detection models drops to as low as 1.3% (with a function pool size of 1 024), while the code bloating ratio is 2.06 times that of the original model.
CHANDRAMOHANM, XUEY X, XUZ Z, et al. BinGo: cross-architecture cross-OS binary search[C]//Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering. New York, USA: ACM, 2016:678-689.
[2]
DAVIDY, PARTUSHN, YAHAVE. Statistical similarity of binaries[C]//Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation. New York, USA: ACM, 2016:266-280.
[3]
HUX, CHIUEHT C, SHINK G. Large-scale malware indexing using function-call graphs[C]//Proceedings of the 16th ACM Conference on Computer and Communications Security. New York, USA: ACM, 2009:611-620.
[4]
POLYCHRONAKISM, ANAGNOSTAKISK, MARKATOSE. Detection of intrusions and malware & vulnerability assessment[C]//Proceedings of the Third International Conference on Detection of Intrusions and Malware & Vulnerability Assessment. Cham, Switzerland: Springer, 2006:54-73.
[5]
WANGZ, PIERCEK, MCFARLINGS. Bmat:a binary matching tool for stale profile propagation[J]. The Journal of Instruction-Level Parallelism, 2000,2:1-20.
[6]
ESCHWEILERS, YAKDANK, GERHARDS-PADILLAE. DiscovRE: efficient cross-architecture identification of bugs in binary code[C]//Proceedings of the 2016 Network and Distributed System Security Symposium. San Diego, CA: Internet Society, 2016:58-79.
[7]
FENGQ, WANGM H, ZHANGM, et al. Extracting conditional formulas for cross-platform bug search[C]//Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security. New York, USA: ACM, 2017:346-359.
[8]
KARGÉNU, SHAHMEHRIN. Towards robust instruction-level trace alignment of binary code[C]//Proceedings of the 2017 32nd IEEE/ACM International Conference on Automated Software Engineering. Piscataway, USA: IEEE, 2017:342-352.
[9]
HUANGH, YOUSSEFA M, DEBBABIM. BinSequence: fast, accurate and scalable binary code reuse detection[C]//Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security. New York, USA: ACM, 2017:155-166.
WANGC X, HILLJ, KNIGHTJ, et al. Software tamper resistance: obstructing static analysis of programs[R]. Charlottesville,USA: University of Virginia, 2000:1-18.
[12]
JUNODP, RINALDINIJ, WEHRLIJ, et al. Obfuscator-LLVM–software protection for the masses[C]//Proceedings of the 2015 IEEE/ACM 1st International Workshop on Software Protection. Piscataway, USA: IEEE, 2015:3-9.
[13]
HAQI U, CABALLEROJ. A survey of binary code similarity[J]. ACM Computing Surveys, 2021,54(3):1-38.
[14]
LATTNERC, ADVEV. LLVM: a compilation framework for lifelong program analysis & transformation[C]//Proceedings of the International Symposium on Code Generation and Optimization, 2004. Piscataway, USA: IEEE, 2004:75-86.
[15]
GRAHAMS L, LENGAUERT, TARJANR E. A fast algorithm for finding dominators in a flowgraph[J]. ACM Transactions on Programming Languages and Systems, 1979,1(1):121-141.
WANGH, QUW J, KATZG, et al. jTrans: jump-aware transformer for binary code similarity detection[C]//Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis. New York, USA: ACM, 2022:1-13.
[18]
MASSARELLIL, DI LUNAG A, PETRONIF, et al. SAFE: self-attentive function embeddings for binary similarity[C]//International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment. Cham, Switzerland: Springer, 2019:309-329.
[19]
DINGS H H, FUNGB C M, CHARLANDP. Asm2Vec: boosting static representation robustness for binary clone search against code obfuscation and compiler optimization[C]//Proceedings of the 2019 IEEE Symposium on Security and Privacy. Piscataway, USA: IEEE, 2019:472-489.
[20]
XUX J, LIUC, FENGQ, et al. Neural network-based graph embedding for cross-platform binary code similarity detection[C]//Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security. New York, USA: ACM, 2017:363-376.
[21]
MASSARELLIL, DI LUNAG A, PETRONIF, et al. Investigating graph embedding neural networks with unsupervised features extraction for binary analysis[C]//Proceedings of the 2019 Workshop on Binary Analysis Research. CA, USA:Internet Society,2019. DOI:10.14722/bar.2019.23020 .
[22]
FENGQ, ZHOUR D, XUC C, et al. Scalable graph-based bug search for firmware images[C]//Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. New York, USA: ACM, 2016:480-491.