Brythzz / cfg-flattening-pass

Control-flow graph flattening LLVM pass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CFG Flattening LLVM Pass

Control-flow Graph Flattening pass for LLVM 17

Build the pass

$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..

Run the pass

# 1 iteration (default)
$ clang -fpass-plugin=`echo build/pass/FlattenCFGPass.*` something.c

# 3 iterations
$ clang -fplugin=`echo build/pass/FlattenCFGPass.*` -fpass-plugin=`echo build/pass/FlattenCFGPass.*` something.c -mllvm -iterations=3

Examples

Original CFG One iteration Two iterations

About

Control-flow graph flattening LLVM pass

License:MIT License


Languages

Language:C++ 77.4%Language:CMake 12.2%Language:Makefile 6.9%Language:C 3.5%