Understand Code Style: Efficient CNN-Based Compiler Optimization Recognition System
Authors:
- Shouguo YangSYShouguo Yang
- Zhiqiang ShiZSZhiqiang Shi
- Guodong ZhangGZGuodong Zhang
- Mingxuan LiMLMingxuan Li
- Yuan MaYMYuan Ma
- Limin SunLSLimin Sun
- 1 May 2019
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 1-6
Abstract
Compiler optimization level recognition can be applied to vulnerability discovery and binary analysis. Due to the exists of many different compilation optimization options, the difference in the contents of the binary file is very complicated. There are thousands of compiler optimization algorithms and multiple different processor architectures, so it is very difficult to manually analyze binary files and recognize its compiler optimization level with rules. This paper first proposes a CNN-based compiler optimization level recognition model: BinEye. The system extracts semantic and structural differences and automatically recognize the compiler optimization levels. The model is designed to be very suitable for binary file processing and is easy to understand. We built a dataset containing 80028 binary files for the model training and testing. Our proposed model achieves an accuracy of over 97%. At the same time, BinEye is a fully CNN-based system and it has a faster forward calculation speed, at least 8 times faster than the normal RNN-based model. Through our analysis of the model output, we successfully found the difference in assembly codes caused by the different compiler optimization level. This means that the model we proposed is interpretable. Based on our model, we propose a method to analyze the code differences caused by different compiler optimization levels, which has great guiding significance for analyzing closed source compilers and binary security analysis.Keywords
All Related Versions
This publication has 7 references indexed in Scilit:
- IoTFuzzer: Discovering Memory Corruptions in IoT Through App-based Fuzzing2018
- Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection2017
- Similarity of binaries through re-optimization2017
- The Correctness-Security Gap in Compiler Optimization2015
- Towards optimization-safe systems2013
- A Backpropagation Neural Network for Computer Network SecurityJournal of Computer Science, 2006
- Using compiler optimization techniques to detect equivalent mutantsSoftware Testing, Verification and Reliability, 1994