Skip to content

Instantly share code, notes, and snippets.

@realoriginal
Created December 25, 2023 10:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save realoriginal/a32938e379a99dfa5be50fb8591a1443 to your computer and use it in GitHub Desktop.
Save realoriginal/a32938e379a99dfa5be50fb8591a1443 to your computer and use it in GitHub Desktop.
A 'Dockerfile' for constructing the "Pluto Obfusactor" an apparent derivative of O-LLVM for mingw-w64 targeting the x86_64/x86_32 architecture on Linux for Windows
FROM alpine:latest as build-pluto
# set the working directory to root
WORKDIR /root
# install the dependencies and add the tool sources
RUN apk add --no-cache git python3 cmake gcc g++ ninja
# build pluto-obfuscator:0e4fe5f08c75cb8a964cdf1b9f79b25b8f6f2306
RUN git clone https://github.com/bluesadi/pluto && \
mkdir -p pluto/build && cd pluto/build && \
cmake -G Ninja \
-DCMAKE_C_FLAGS="-D_LARGEFILE64_SOURCE" \
-DCMAKE_CXX_FLAGS="-include cstdint -D_LARGEFILE64_SOURCE" \
-DLLVM_ENABLE_PROJECTS="clang" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DBUILD_SHARED_LIBS=On \
-DLLVM_ENABLE_LIBCXX=On \
-DCMAKE_INSTALL_PREFIX=/root/tools-bin ../llvm && \
ninja && ninja install
# downlaod the mingw-w64 compilers and extract them to the tools directory
RUN wget https://musl.cc/x86_64-w64-mingw32-cross.tgz && \
wget https://musl.cc/i686-w64-mingw32-cross.tgz && \
tar -xvf x86_64-w64-mingw32-cross.tgz -C /root/tools-bin --strip-components=1 && \
tar -xvf i686-w64-mingw32-cross.tgz -C /root/tools-bin --strip-components=1
# download and setup wclang
RUN git clone https://github.com/tpoechtrager/wclang && \
cd wclang && PATH=$PATH:/root/tools-bin cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=/root/tools-bin . && \
ninja && ninja install
# Pull from the latest base image
FROM alpine:latest
# install the libstdc++ for clang
RUN apk add --no-cache libstdc++
# copy the build artifact from the other container
COPY --from=build-pluto /root/tools-bin/ /usr/local/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment