clang version 18.1.6
cmake version 3.29.3
CC=/usr/bin/clang-18
CXX=/usr/bin/clang++-18
Build passes:
cd build && cmake [--fresh] .. && make
Compile a test program to llvm IR:
clang [-fPIC] -O0 -S -std=c17 -emit-llvm test.c -o test.ll
Run obfuscation passes:
opt [--disable-verify] -load-pass-plugin ../build/Flatten/libLLVMFlatten.so -load-pass-plugin ../build/Split/libLLVMSplit.so -passes=split,flatten test.ll -o test_obf && llvm-dis test_obf
Compile obfuscated program:
llc [--disable-verify] [-relocation-model=pic] -filetype=obj test_obf.ll -o test_obf.o && clang test_obf.o -o test_obf.out
Only Flatten pass:
clang -fPIC -O0 -S -std=c17 -emit-llvm test.c -o test.ll && \
opt -load-pass-plugin ../build/Flatten/libLLVMFlatten.so -passes=flatten test.ll -o test_obf && \
llvm-dis test_obf && \
llc -relocation-model=pic -filetype=obj test_obf.ll -o test_obf.o && \
clang test_obf.o -o test_obf.out
Only Collatz pass:
clang -fPIC -O0 -S -std=c17 -emit-llvm test.c -o test.ll && \
opt --disable-verify -load-pass-plugin ../build/Collatz/libLLVMCollatz.so -passes=collatz test.ll -o test_obf && \
llvm-dis test_obf && \
llc --disable-verify -relocation-model=pic -filetype=obj test_obf.ll -o test_obf.o && \
clang test_obf.o -o test_obf.out
Only Dead(code) pass:
clang -fPIC -O0 -S -std=c17 -emit-llvm test.c -o test.ll && \
opt --disable-verify -load-pass-plugin ../build/Dead/libLLVMDead.so -passes=dead test.ll -o test_obf && \
llvm-dis test_obf && \
llc --disable-verify -relocation-model=pic -filetype=obj test_obf.ll -o test_obf.o && \
clang test_obf.o -o test_obf.out