An LLVM pass designed to obfuscate the names of identifiers in LLVM Intermediate Representation (IR) code
- Function Name Mangling: Renames function identifiers with randomly generated strings to replace original names.
- Global Variable Name Mangling: Renames global variable identifiers with randomly generated strings.
- Struct Name Mangling: Renames struct type identifiers with randomly generated strings.
- Clone this repository
git clone https://github.com/Ily455/IM-LLVM-Pass.git
- Compile the Pass
mkdir build cd build cmake .. make
-
Compile your C/C++ code to LLVM IR using Clang
clang -S -emit-llvm input.c -o input.ll
-
Run the Identifier Mangling Pass on the LLVM IR code using the
opt
tool.opt -load-pass-plugin /path/to/ManglePass.so -passes=manglepass < input.ll > -o output.ll
This produces bitcode.
opt -S -load-pass-plugin /path/to/ManglePass.so -passes=manglepass < input.ll > -o output.ll
This produces readable IR.
-
The output LLVM IR code (
output.ll
) will have the function names, global variable names, and struct type names mangled with randomly generated strings.
See example
The Identifier Mangling Pass is licensed under the MIT License.