LLVM New Pass Manager plugin with obfuscation transforms (instruction substitution, MBA, bogus control flow, control-flow flattening, string encryption, and others). Built against LLVM 20.
IDA demo (Hex-Rays): clean · obfuscated
- CMake ≥ 3.20, Ninja (or another generator)
- LLVM 20 development packages (e.g.
llvm-20-dev,clang-20,opt-20on Debian/Ubuntu) - Adjust
LLVM_DIRbelow if your install path differs
mkdir -p build && cd build
cmake -G Ninja -DLLVM_DIR=/usr/lib/llvm-20/lib/cmake/llvm ..
ninjaThis produces build/passes/obfuscator.so, a loadable pass plugin for opt / clang.
For a standalone .so that does not link libLLVM (for -Z llvm-plugins with rustc), add -DOBFUSCATOR_STANDALONE_MODULE=ON to the CMake line above. Prebuilt obfuscator-x86_64-unknown-linux-gnu.so is on GitHub Releases. See rust-integration/README.md and rust-integration/example-crate/.
Quick setup: from the repo root run bash rust-integration/setup.sh (Linux/WSL) or .\rust-integration\setup.ps1 on Windows (downloads the plugin; run cargo from WSL or Linux).
Rust obfuscation needs Linux x86_64 or WSL and a nightly whose LLVM matches the plugin (LLVM 20 today). Stock Windows rustup usually cannot load the plugin; build obfuscated Rust from Linux/WSL.
Windows DLL for opt: same CMake with MSVC, -DOBFUSCATOR_STANDALONE_MODULE=ON; output is obfuscator.dll under passes/ (or passes/Release/). Example: opt --load-pass-plugin=obfuscator.dll --passes=instsub -S in.ll -o out.ll. Prebuilt obfuscator-x86_64-pc-windows-msvc.dll may be on Releases.
From the repo root after building:
./tests/run_tests.shOr use CMake’s test runner:
cd build && ctestWith the default build layout:
./scripts/obfuscate.sh path/to/source.cUse -p to pick passes (comma-separated); run ./scripts/obfuscate.sh -h for options.