Skip to content

psolvx/obfuscator-llvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obfuscation via LLVM

Configuration information

clang version 18.1.6 
cmake version 3.29.3

CC=/usr/bin/clang-18 
CXX=/usr/bin/clang++-18

Instructions to apply passes

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

One-liners

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •