obfuscator-llvm / obfuscator

3.93k stars 1.18k forks source link

how to obfuscate C cmake project ? #138

Open Arvinzhu opened 5 years ago

Arvinzhu commented 5 years ago

The wiki documentation is like this, but I have a few more questions.

$ CC=path_to_the/build/bin/clang
$ CFLAGS+="-mllvm -fla" or CXXFLAGS+="-mllvm -fla" (or any other obfuscation-related flags)
$ ./configure
$ make

What does CC and CFLAGS mean?

For example.I have a C cmake project.The steps to compile this project are cmake .. and make. Can you tell me how to use ollvm compile this project ?

wustwg commented 5 years ago

I guss just like this:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

这个问题网上肯定有,干嘛不查一下再问。。。

skyel1u commented 5 years ago

example:

➜ cat orig.c   
#include <stdio.h>
int main(int argc, char const *argv[])
{
    int x = 0;
    if (x > 0) {
        printf("%s", "tigger.");
    } 
    else
    {
        printf("%s", "Hello, world.");
    }
    return 0;
}

➜ ./../work/ollvm-build/bin/clang -O0 orig.c -mllvm -fla -o test.elf
➜ ./test.elf                                                        
Hello, world.

snipaste_20190514_160017