Skip to content

chenx6/baby_obfuscator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Baby obfuscator

Using LLVM Pass to obfuscate programs.

Write up (in Chinese):

Features

Feature Enable Flag
Obfuscate constant string -obfstr
Add bogus control flow -boguscf
Instruction Substitution -subobf
Call graph flattening -flattening

Requirement

llvm-9 and llvm-9-dev
cmake >= 3.10
gcc / clang

Build

mkdir build && cd build
# You should modify the DLLVM_DIR option to fit your environment
cmake .. -DLLVM_DIR=/usr/lib/llvm-9/lib/cmake/llvm/
cmake --build . -- -j$(nproc)

How to use

# You should assign ${fullname} and ${basename} as your program's name
# Example: fullname=test.c; basename=test
# Compile origin program
clang-9 -emit-llvm -S ${fullname} -o ${basename}.ll
# Load obfuscator to obfuscate program
# You can change -obfstr option to other options
opt-9 -load /part/to/libObfuscator.so \
      -obfstr ${basename}.ll \
      -o ${basename}_obfuscated.bc
# If you are using ObfuscateString Pass, you should link encrypt.c with your program
# Compile to target platform
clang-9 ${basename}_obfuscated.bc -o ${basename}

Acknowledgement

The project has "borrow" some code from these projects:

obfuscator-llvm/obfuscator

License

MIT License

About

Using LLVM Pass to obfuscate program

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published