open-obfuscator / o-mvll

:electron: O-MVLL is a LLVM-based obfuscator for native code (Android & iOS)
https://obfuscator.re/omvll
Apache License 2.0
600 stars 64 forks source link

Standalone obfuscation. #54

Open calperxd opened 1 month ago

calperxd commented 1 month ago

Hello everyone,

I’ve been trying to obfuscate a simple C++ code, but despite numerous attempts, I haven’t been successful. Below is the structure of my project:

. ├── docker-compose.yaml ├── Dockerfile ├── main.cpp ├── obfuscate.sh ├── omvll_ndk_r26d.so ├── Python-3.10.7 ├── README └── omvll.yml.py The docker-compose.yaml and Dockerfile aren't relevant at this stage because my priority is to first obfuscate the application. I’ll focus on creating a Dockerfile later on.

To obfuscate the code, I run:

./obfuscate.sh And to clean the build, I use:

./obfuscate.sh clean In the sh file, I’ve defined some variables:

# Get the username of the system
USER=$(whoami)

# Define the NDK version, Android version, and compiler version as variables
NDK_VERSION="23.1.7779620"
ANDROID_VERSION="27" # Android API level
COMPILER_VERSION="aarch64-linux-android$ANDROID_VERSION-clang++"

# Get the directory of the current script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

These are my default configurations. The issue is that I’m not able to obfuscate the C++ program in this example even when I pass the following line to the compiler:

/home/$USER/Android/Sdk/ndk/$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/$COMPILER_VERSION \
    -fpass-plugin=omvll_ndk_r26d.so main.cpp -o main_obfuscated -lc++

My question is: how do you guys run a standalone example? Do you have a very simple example where I can successfully run the obfuscation plugin?

Attchments. obfuscation.tar.gz

PS: I had to remove the Python-3.10.7 to attach the file here in this issue due to the size.

marcobrador commented 2 weeks ago

Hello @calperxd ,

Thanks for reporting this. Could you try invoking the generic clang instead of the target-triple-specific one?

Please check the example here: https://obfuscator.re/omvll/introduction/getting-started/#android-ndk

Thanks, Marc