一个不依赖 GPL 的 C/C++ 混淆器(基于 LLVM 17,白名单驱动)
每个混淆处理阶段都使用白名单。只有已知安全的指令才会被混淆,从而有助于保持构建和程序的稳定性。
该项目在开发过程中未使用 GPL、AGPL 或其他可能限制商业使用的许可证。

基本块流程图(Ghidra)
# download obfuscator
curl -LO https://github.com/HimitsuShell/HimitsuObfuscator/releases/download/v2.1.0/himitsu_obfuscator.tar
tar -xvf himitsu_obfuscator.tar
# create sample source
vim main.c
-----------------------------
#include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
}
-----------------------------
# build and run (x86_64-linux-gnu)
apt install -y build-essential
./bin/clang --target=x86_64-linux-gnu -mllvm -sobf main.c -o main
./main
# supported targets: x86_64-linux-musl, aarch64-linux-gnu, aarch64-linux-musl, etc.
- fla # control flow flattening
- bcf # bogus control flow (slow build, larger binary)
- bcf_prob # probability (1–100, default: 30)
- bcf_loop # number of iterations (default: 1)
- sub # instruction substitution (add/and/sub/or/xor)
- sub_loop # number of iterations (default: 1)
- sobf # string encryption
- split # basic block splitting
- split_num # number of splits (default: 2)
# selective obfuscation ('no' prefix disables)
void test1() __attribute__((annotate("sobf"), annotate("nobcf")));
void test1() { printf("Hello World!"); }
# planned options: indirect branches, indirect calls, indirect global variable
-bcf 时,请勿使用 -g 进行编译(调试信息会跳过混淆)。[HimitsuShell CE] 声明仅适用于 HimitsuShell,不适用于 HimitsuObfuscator。