Binary code obfuscation through C++ template metaprogramming



Defending programs against illegitimate use and tampering has become both a field of study and a large industry. Code obfuscation is one of several strategies to stop, or slow down, malicious attackers from gaining knowledge about the internal workings of a program.

Binary code obfuscation tools often come in two (sometimes overlapping) flavors. On the one hand there are ``binary protectors'', tools outside of the development chain that translate a compiled binary into another, less intelligible one. On the other hand there are software development kits that require a significant effort from the developer to ensure the program is adequately obfuscated.

In this paper, we present obfuscation methods that are easily integrated into the development chain of C++ programs, by using the compiler itself to perform the obfuscated code generation. This is accomplished by using advanced C++ techniques, such as operator overloading, template metaprogramming, expression templates, and more. We achieve obfuscated code featuring randomization, opaque predicates and data masking. We evaluate our obfuscating transformations in terms of potency, resilience, stealth, and cost.

Related Project

TRONE: Trustworthy and Resilient Operations in a Network Environment (CMU-PT/RNQ/0015/2009)


4º Simpósio de Informática - INForum 2012, September 2012

PDF File

Cited by

Year 2013 : 1 citations

 Zalán Sz?gyi, Tamás Cséri and Zoltán Porkoláb, Random number generator for C++ template metaprograms. 13th Symposium on Programming Languages and Software Tools (SPLST 2013), Kos, Greece