среда, 8 июля 2020 г.

Build OpenVPN with XOR-patch (Scramble)

Task: It is necessary to compile the current version of OpenVPN for 32 bits with the XOR patch.

1. Download and install cygwin https://cygwin.com/install.html
During installation, you need to install the following packages -
autoconf, automake, diffutils, git, libtool, m4, make, mingw64-i686-binutils, mingw64-i686-gcc-core, mingw64-i686-headers, mingw64-i686-pthreads, mingw64-i686-runtime, mingw64-x86_64-binutils, mingw64-x86_64-gcc-core, mingw64-x86_64-headers, mingw64-x86_64-pthreads, mingw64-x86_64-runtime, patch, patchutils, perl, unzip, wget

2. After run cygwin -
cp `which true` /usr/bin/man2html                                           

3. Download OpenVPN Builds https://github.com/OpenVPN/openvpn-build
wget https://github.com/OpenVPN/openvpn-build/archive/master.zip
unzip master.zip
Go to the directory
cd openvpn-build-master/generic

4. Build (for the first time will get WITHOUT a patch)
IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 CBUILD=i686-pc-cygwin ./build

5. After the build of the version is completed, without a patch, we go to the source directory - there will be downloaded archives with the OpenVPN source codes and the necessary libraries.

6. We need to unpack the source OpenVPN
tar xvfz openvpn-2.4.9.tar.gz
rm openvpn-2.4.9.tar.gz
cd openvpn-2.4.9

7. Download and apply xor patch - https://github.com/clayface/openvpn_xorpatch
wget https://raw.githubusercontent.com/clayface/openvpn_xorpatch/master/openvpn_xor.patch
git apply openvpn_xor.patch
tar -czvf openvpn-2.4.9.tar.gz openvpn-2.4.9

And go back to the generic folder
cd ..

8. Starting the project build again -
IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 CBUILD=i686-pc-cygwin ./build

9. After finishing, you can goto the path  C:\cygwin\home\%YOURUSERNAME%\openvpn-build-master\generic\image-win32\openvpn\bin and test your own OpenVPN build

Комментариев нет:

Отправить комментарий