ADVobfuscator Documentation
repository·main·Indexed 23 days ago
https://github.com/andrivet/advobfuscatorA C++20 library providing compile-time obfuscation and encryption for strings, byte blocks, and function calls. It leverages constexpr capabilities to protect sensitive data and code logic without requiring external tools or compiler modifications. Key features include AES-128 encryption, compile-time random number generation, and finite state machines for function call obfuscation. Requires a C++20 compatible compiler and Release builds for active obfuscation.
What's inside ADVobfuscator
- ADVobfuscator is a C++20 library designed to generate obfuscated data and code at compile time. It allows for the obfuscation or encryption of strings and blocks of data during compilation, which are then decoded at runtime. It does not require external tools or modifications to the compiler.
Important: Obfuscation requires Release builds
mainADVobfuscator is not compatible with Debug builds.
Because compilers often ignore
inlineorconstexprstatements and disable optimizations in Debug mode to facilitate debugging, the obfuscation logic will not function correctly. If you compile in Debug mode, strings and data will not be obfuscated. To ensure obfuscation is active, you must use Release builds.Build using GCC in Docker
mainYou can use Docker to build and run an environment with GCC:
docker build -t advobfuscator-gcc -f docker/gcc.docker . docker run --rm -it advobfuscator-gcc:latestBuild on Windows using Visual Studio
mainFor Windows users, you can build the project by opening theADVobfuscator.slnsolution file in Visual Studio.Requirements for ADVobfuscator
mainTo use ADVobfuscator, ensure your environment meets the following requirements:
- A C++20 compatible compiler.
- Support for the C++20 Standard Library (note: some embedded environments may have exceptions).
- CMake 3.14 (optional, only required if you wish to build the provided examples using CMake).
Build examples on Linux and macOS using CMake
mainTo build the examples on Linux or macOS, use the following commands to create a build directory and compile the project:
mkdir -p BUILD cd BUILD cmake -DCMAKE_BUILD_TYPE=Release .. cmake --build .Each example is located in its own subdirectory within the
BUILDfolder (e.g.,./example/demo).Build using Clang in Docker
mainYou can use Docker to build and run an environment with Clang:
docker build -t advobfuscator-clang -f docker/clang.docker . docker run --rm -it advobfuscator-clang:latestReference: ADVobfuscator Library Headers
mainThe following headers are available in the
include/advobfuscatordirectory for different obfuscation tasks:Header Description aes.hObfuscation using AES-128 compile time encryption aes_string.hObfuscated strings using AES-128 compile time encryption bytes.hObfuscated blocks of bytes fsm.hCompile time finite state machine to obfuscate function calls obj.hObfuscation random.hGenerate random numbers at compile time string.hObfuscated strings format.hstd::formatFormatting of strings