Compilation

O-MVLL relies on the following dependencies:

  1. LLVM (version depending on the toolchain version)
  2. CPython (3.10.7)
  3. spdlog (1.10.0)
  4. Pybind11 (2.10.0)

As a first step, let’s consider that we compiled all the dependencies. O-MVLL is a C++17 out-of-tree LLVM pass so we don’t need to compile LLVM for each build.

The CMake configuration step can be invoked as follows:

$ git clone https://github.com/open-obfuscator/o-mvll.git
$ mkdir o-mvll/src/build && cd o-mvll/src/build
On Linux
export NDK_STAGE1=${LLVM_ROOT}/out/stage1-install
export NDK_STAGE2=${LLVM_ROOT}/out/stage2

$ cmake -GNinja ..                                              \
        -DCMAKE_BUILD_TYPE=Release                              \
        -DCMAKE_CXX_COMPILER=${NDK_STAGE1}/bin/clang++          \
        -DCMAKE_C_COMPILER=${NDK_STAGE1}/bin/clang              \
        -DCMAKE_CXX_FLAGS="-stdlib=libc++"                      \
        -DPython3_ROOT_DIR=${PYTHON_ROOT}                       \
        -DPython3_LIBRARY=${PYTHON_ROOT}/lib/libpython3.10.a    \
        -DPython3_INCLUDE_DIR=${PYTHON_ROOT}/include/python3.10 \
        -Dpybind11_DIR=${PYBIND11_ROOT}/share/cmake/pybind11    \
        -Dspdlog_DIR=${SPDLOG_ROOT}/lib/cmake/spdlog            \
        -DLLVM_DIR=${NDK_STAGE2}/lib64/cmake/llvm
$ ninja
On OSX
$ cmake   -GNinja                                                 \
          -S src                                                  \
          -B build                                                \
          -DCMAKE_C_COMPILER=$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang              \
          -DCMAKE_CXX_COMPILER=$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++            \
          -DCMAKE_OSX_DEPLOYMENT_TARGET="14.5"                    \
          -DPython3_ROOT_DIR=${PYTHON_ROOT}                       \
          -DPython3_LIBRARY=${PYTHON_ROOT}/lib/libpython3.10.a    \
          -DPython3_INCLUDE_DIR=${PYTHON_ROOT}/include/python3.10 \
          -Dpybind11_DIR=${PYBIND11_ROOT}/share/cmake/pybind11    \
          -Dspdlog_DIR=${SPDLOG_ROOT}/lib/cmake/spdlog            \
          -DLLVM_DIR=${LLVM_ROOT}/lib/cmake/llvm                  \
          -DPYBIND11_NOPYTHON=1                                   \
$ ninja -C build

Since the dependencies of O-MVLL are fixed for a given version of the NDK/Xcode, you can download the pre-compiled binaries:

NDK

VersionURL
r25chttps://open-obfuscator.build38.io/static/omvll-deps-ndk-r25c.tar
r26dhttps://open-obfuscator.build38.io/static/omvll-deps-ndk-r26d.tar

Xcode

VersionURL
14.1https://open-obfuscator.build38.io/static/omvll-deps-xcode-14_1.tar
15.2https://open-obfuscator.build38.io/static/omvll-deps-xcode-15_2.tar
Compilation Time
Since O-MVLL is an out-of-tree plugin, it takes about 2 minutes to fully compile the obfuscator (using the pre-compiled dependencies).

Generate NDK deps

O-MVLL dependencies can be generated easily using the same repository:

# Make sure you have expected ANDROID_HOME variable is already satisfied
ANDROID_HOME="sdk folder installation"
# Install ndk version used by the project
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'ndk;25.2.9519653'
git clone https://github.com/open-obfuscator/o-mvll.git o-mvll && cd o-mvll
./scripts/deps/generate_deps.sh -p ndk -o output.tar.gz

# output.tar.gz will be generated with all the required dependencies.

Generate XCode deps

Manually generating the LLVM deps for Xcode is no longer supported. Please consider using the prebuilt dependencies instead.

Docker Build

To ease the compilation of O-MVLL, we provide Docker images with the correct environment to compile O-MVLL for both Android NDK and the Xcode toolchain.

Android NDK

$ docker pull openobfuscator/omvll-ndk
$ git clone https://github.com/open-obfuscator/o-mvll

$ curl -LO https://open-obfuscator.build38.io/static/omvll-deps-ndk-r26d.tar
$ mkdir -p ./third-party
$ tar xvf omvll-deps-ndk-r26d.tar -C ./third-party
$ docker run --rm                           \
         -v $(pwd)/o-mvll:/o-mvll           \
         -v $(pwd)/third-party:/third-party \
         openobfuscator/omvll-ndk sh /o-mvll/scripts/docker/ndk_r26d_compile.sh

Xcode

$ docker pull openobfuscator/omvll-xcode
$ git clone https://github.com/open-obfuscator/o-mvll

$ curl -LO https://open-obfuscator.build38.io/static/omvll-deps-xcode-15_2.tar
$ mkdir -p ./third-party
$ tar xvf omvll-deps-xcode-15_2.tar -C ./third-party
$ docker run --rm                           \
         -v $(pwd)/o-mvll:/o-mvll           \
         -v $(pwd)/third-party:/third-party \
         openobfuscator/omvll-xcode sh /o-mvll/scripts/docker/xcode_15_compile.sh