C++ enables us to provide seamless data obfuscation PROTEKKT has released a C++ SDK called POL (PROTEKKT Obfuscated Library) that provides seamless data obfuscation to harden applications against reverse engineering, supporting C++17 and automatically upgrading for C++20/23/26. The library offers low-level C APIs for runtime value obfuscation, advanced integer obfuscation with operations on encrypted data, runtime data obfuscation, and static data obfuscation using marker bytes, with higher-level C++ types encapsulating these functions. Introduction In our previous article Hardening Against AI Reverse Engineering: Making Computers Struggle hardening-against-ai-reverse-engineering.html , we focused on what most code virtualization products disregarded over the years: Why data obfuscation is just as important as code obfuscation to us and why we want to provide a wider range of possibilities than what code obfuscators usually offer basic string encryption utilities . Now we'd like to take you through our SDK, its features and usage examples. We are still finalizing the product so at the time of release certain functionalities may be named or performed differently, but what we are presenting here is pretty much what it will look like. In this post we'll go through our C++ implementation named POL PROTEKKT Obfuscated Library , but we plan on expanding our SDK to other popular programming languages as well. We are aware that many projects take longer to upgrade their toolset and C++ standard used, so the library is written to support C++17. If C++20 or C++23 are used, the SDK will automatically switch to a more efficient implementation or enable functionality that is not possible to implement without newer standards. When it becomes widely available, C++26 support in major compilers will allow us to implement even easier interfaces and new features. Low-Level API At its core, everything is based on a low-level C API. The obfuscation process automatically replaces all instances and references to these functions with randomly generated encryption/decryption stubs implementing the logic behind them. This allows us to implement higher-level concepts in most programming languages that allow interaction with C libraries. The API can be split into a few groups: 1. Runtime Value Obfuscation Basic integer obfuscation for runtime values. Suitable for places where performance matters. // runtime value obfuscation uint8 t protekkt rvo set8 uint8 t ; uint16 t protekkt rvo set16 uint16 t ; uint32 t protekkt rvo set32 uint32 t ; uint64 t protekkt rvo set64 uint64 t ; uint8 t protekkt rvo get8 uint8 t ; uint16 t protekkt rvo get16 uint16 t ; uint32 t protekkt rvo get32 uint32 t ; uint64 t protekkt rvo get64 uint64 t ; 2. Advanced Integer Obfuscation Complex integer obfuscation, supports standard operations without ever decoding complete values in plaintext form. // number obfuscation void protekkt num init u8 void base ; void protekkt num init u16 void base ; // ... void protekkt num add void dst, void const src ; void protekkt num sub void dst, void const src ; void protekkt num mul void dst, void const src ; void protekkt num xor void dst, void const src ; void protekkt num and void dst, void const src ; // ... 3. Runtime Data Obfuscation Used for obfuscating runtime data. // runtime data obfuscation void protekkt rdo init void base ; void protekkt rdo decode void const base, size t offset, void dst, size t size ; void protekkt rdo encode void base, size t offset, void const src, size t size ; 4. Static Data Obfuscation Used for encrypting compile-time constants and any compile-time initialized data. Data is inserted between marker bytes to allow the obfuscator to locate data that needs to be obfuscated/encrypted. // static data obfuscation void protekkt sdo decode void const base, size t offset, void dst, size t size ; // static data obfuscation markers define PTKT SDO BEG MARKER { 'P', 'T', 'K', 'T', 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 'B', 'E', 'G', 0x00 } define PTKT SDO END MARKER { 'P', 'T', 'K', 'T', 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 'E', 'N', 'D', 0x00 } // runtime data obfuscation prefix size define PTKT RDO MARKER SIZE 16 Core C++ Types Types encapsulating the low-level C API, providing an intuitive way for initialization, reads and modification of obfuscated data. They are intended to be used directly, but are also the building blocks of more complex data structures. Constructors, destructors and methods provided by these types are "force inline" to ensure unique obfuscations for different variables/objects instead of having a single point in the compiled binary that allows interception of all obfuscated values. 1. Runtime Value Obfuscation A wrapper for integral/enum/boolean types and pointers. Provides overloaded operators to act as a drop-in replacement for any of them assignment, retrieval, comparisons, arithmetic and bitwise operations, etc . RVO provides data encryption/decryption where performance matters more. // protekkt/pol/rvo.hpp template