arrow
Return

Identifying Compiler and Optimization Level in Binary Code From Multiple Architectures

delete2021-01-01
delete11
delete
OA
AI
D
Davide Pizzolotto *
K
Katsuro Inoue
DOI:10.1109/ACCESS.2021.3132950delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
While compiling a native application, different compiler flags or optimization levels can be configured. This choice depends on the different requirements. For example, if the application binary is intended for final release, the flags and optimization settings should be set for execution speed and efficiency. Alternatively, if the application is to be used for debugging purposes, debug flags should be configured accordingly, usually involving minor or no code optimization. However, this information cannot be easily extracted from a compiled binary. Nonetheless, ensuring the same compiler and compilation flags is particularly important when comparing different binary files, to avoid inaccurate or unreliable analyses. Unfortunately, to understand which flags and optimizations have been used, a deep knowledge of the target architecture and the compiler used is required. In this study, we present two deep learning models used to detect both compiler and optimization level in a compiled binary. The optimization levels we study are O0, O1, O2, O3, and Os in the x86_64, AArch64, RISC-V, SPARC, PowerPC, MIPS, and ARM architectures. In addition, for the x86_64 and AArch64 architectures, we also determine whether the compiler is GCC or Clang. We created a dataset of more than 76000 binaries and used it for training. Our experiments showed over 99.95% accuracy in detecting the compiler and between 92% to 98%, depending on the architecture, in detecting the optimization level. Furthermore, we analyzed the change in accuracy when the amount of data was extremely limited. Our study shows that it is possible to accurately detect both compiler flag settings and optimization levels with function-level granularity.
Keywords:
Optimization
Codes
Convolutional neural networks
Binary codes
Libraries
Computer architecture
Training
Compilers
deep learning
static code analysis
reverse engineering

Journal

IEEE Access cover
IEEE Access
IF:
3.6
Papers:
9.8W
Citations:
36.3W

Organization

T
The University of Osaka
Scholars:
1.2K
Papers: 383
Citations: 5.2K
Cited Papers

Cited Papers

Effects of titanium and tantalum adhesion layers on the properties of sol-gel derived SrBi2Ta2O9 thin films
err2002-08-01
err0
PREAI
errChing-Chich Leu; Hung-Tao Lin; Chen-Ti Hu; Chao-Hsin Chien; Ming-Jui Yang; Ming-Che Yang; Tiao-Yuan Huang
errShare
errSave
A Survey on Compiler Autotuning using Machine Learning
err2018-09-18
err123
errOAAI
errAshouri, Amir H.; Killian, William; Cavazos, John; Palermo, Gianluca; Silvano, Cristina
errShare
errSave
Case Report: Aperiodic Fluctuations of Neural Activity in the Ictal MEG of a Child With Drug-Resistant Fronto-Temporal Epilepsy
err2021-03-04
err0
errOAAI
errSaskia van Heumen; Jeremy T. Moreau; Elisabeth Simard-Tremblay; Steffen Albrecht; Roy WR. Dudley; Sylvain Baillet
errShare
errSave
Machine Learning in Compiler Optimization
err2018-11-01
err110
errOAAI
errWang, Zheng; O'Boyle, Michael
errShare
errSave
researcher View more