From 4987b1f16ced8222f8f58ad8936421037af946e8 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Sun, 23 Jul 2017 15:19:53 +0300 Subject: [PATCH] Support latest pyuv and crpytography --- client/android_sources/build.sh | 2 + client/sources-linux/buildenv.sh | 81 +++++++++++++++++++++++++++++--- client/sources/buildenv.sh | 2 +- 3 files changed, 77 insertions(+), 8 deletions(-) diff --git a/client/android_sources/build.sh b/client/android_sources/build.sh index fe7150c3..2f6faf57 100755 --- a/client/android_sources/build.sh +++ b/client/android_sources/build.sh @@ -1,4 +1,6 @@ #!/bin/sh +export PATH=$PATH:$HOME/.local/bin + pip install --user --upgrade git+https://github.com/kivy/buildozer [ -f buildozer.spec ] || ln -sf buildozer.spec.example buildozer.spec buildozer android release diff --git a/client/sources-linux/buildenv.sh b/client/sources-linux/buildenv.sh index b456bd86..71ce4d04 100755 --- a/client/sources-linux/buildenv.sh +++ b/client/sources-linux/buildenv.sh @@ -1,6 +1,6 @@ #!/bin/sh -export PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/sbin:/usr/local/sbin:$HOME/.local/bin +export PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/sbin:$HOME/.local/bin export XID=`id -u` # VERSIONS /MAY/ BE UPDATED (In case of vulnerabilites) @@ -65,6 +65,7 @@ cat /etc/resolv.conf >buildenv/lin32/etc/resolv.conf cat > buildenv/lin32/wrap.c < +#include static const struct utsname pupy_utsname = { @@ -82,6 +83,31 @@ int uname(struct utsname *buf) { } EOF +cat > buildenv/lin32/gccwrap < buildenv/lin32/deploy.sh exec 1>/log.txt @@ -118,7 +144,7 @@ cd /usr/src tar zxf make-3.82.tar.gz cd /usr/src/make-3.82 ./configure; make; make install -export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin/ +export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin/:/ /bin/sh -c "apt-get --force-yes -y remove make << /dev/null" cd /usr/src @@ -252,6 +278,7 @@ int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) { #endif __EOF__ +python -OO -m pip install --upgrade setuptools python -OO -m pip install pycparser==2.17 python -OO -m pip install -q six packaging appdirs python -OO -m pip install -q \ @@ -277,8 +304,11 @@ tar zxf automake-1.15.tar.gz cd /usr/src/automake-1.15 ./configure --prefix=/usr; make; make install -CFLAGS="-O2 -pipe -DCLOCK_MONOTONIC=1 -UHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC -U_FILE_OFFSET_BITS" \ - python -OO -m pip install -q pyuv==1.3.0 --no-binary :all: +CFLAGS_PYUV="-O2 -pipe -DCLOCK_MONOTONIC=1 -UHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC" +CFLAGS_PYUV="\$CFLAGS_PYUV -U_FILE_OFFSET_BITS -D_XOPEN_SOURCE=600 " +CFLAGS_PYUV="\$CFLAGS_PYUV -D_GNU_SOURCE -DS_ISSOCK(m)='(((m) & S_IFMT) == S_IFSOCK)'" + +CC=/gccwrap CFLAGS_FILTER="-D_FILE_OFFSET_BITS=64" CFLAGS="\$CFLAGS_PYUV" python -OO -m pip install -q pyuv --no-binary :all: cd /usr/lib/python2.7 find -name "*.py" | python -m compileall -qfi - @@ -327,6 +357,7 @@ cat /etc/resolv.conf >buildenv/lin64/etc/resolv.conf cat > buildenv/lin64/wrap.c < +#include static const struct utsname pupy_utsname = { @@ -344,6 +375,31 @@ int uname(struct utsname *buf) { } EOF +cat > buildenv/lin64/gccwrap < buildenv/lin64/deploy.sh exec 1>/log.txt @@ -366,6 +422,8 @@ echo /wrap.so >/etc/ld.so.preload mkdir /opt/static ln -sf /usr/lib/gcc/x86_64-linux-gnu/4.1.2/libgcc.a /opt/static +ln -sf /usr/lib/gcc/x86_64-linux-gnu/4.1.2/libssp.a /opt/static +ln -sf /usr/lib/gcc/x86_64-linux-gnu/4.1.2/libssp_nonshared.a /opt/static ln -sf /usr/lib/libffi.a /opt/static/ export CFLAGS="-Os -fPIC -pipe -L/opt/static" CXXFLAGS="-Os -fPIC -pipe" LDFLAGS="-s -O1 -fPIC -L/opt/static" @@ -375,7 +433,7 @@ cd /usr/src tar zxf make-3.82.tar.gz cd /usr/src/make-3.82 ./configure; make; make install -export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin/ +export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin/:/ /bin/sh -c "apt-get --force-yes -y remove make << /dev/null" cd /usr/src @@ -482,8 +540,16 @@ rm -f ./gi/.libs/_gi.la ./gi/_gobject/.libs/_gobject.la ./gi/_glib/.libs/_glib.l make -k make install +export CFLAGS="$CFLAGS -Os -pipe -U_FORTIFY_SOURCE" +export LDFLAGS="$LDFLAGS" + +python -OO -m pip install --upgrade setuptools python -OO -m pip install pycparser==2.17 -python -OO -m pip install -q six packaging appdirs +python -OO -m pip install -q six packaging appdirs cffi + +CC=/gccwrap CFLAGS_FILTER="-Wno-error=sign-conversion" \ + python -OO -m pip install -q cryptography --no-binary :all: + python -OO -m pip install -q \ rpyc pycryptodome pyaml rsa netaddr tinyec pyyaml ecdsa \ paramiko pylzma pydbus python-ptrace psutil scandir \ @@ -507,7 +573,8 @@ tar zxf automake-1.15.tar.gz cd /usr/src/automake-1.15 ./configure --prefix=/usr; make; make install -python -OO -m pip install -q pyuv==1.3.0 --no-binary :all: +CFLAGS="\$CFLAGS -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DS_ISSOCK(m)='(((m) & S_IFMT) == S_IFSOCK)'" \ + python -OO -m pip install -q pyuv --no-binary :all: cd /usr/lib/python2.7 find -name "*.py" | python -m compileall -qfi - diff --git a/client/sources/buildenv.sh b/client/sources/buildenv.sh index bc1f9a40..3b051977 100755 --- a/client/sources/buildenv.sh +++ b/client/sources/buildenv.sh @@ -20,7 +20,7 @@ WINETRICKS="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/w PACKAGES="rpyc rsa pefile rsa netaddr win_inet_pton netaddr tinyec pypiwin32" PACKAGES_BUILD="pycryptodome cryptography netifaces" -PACKAGES="$PACKAGES mss==2.0.22 pyaudio https://github.com/secdev/scapy/archive/master.zip pyOpenSSL colorama pyuv" +PACKAGES="$PACKAGES pyaudio https://github.com/secdev/scapy/archive/master.zip pyOpenSSL colorama pyuv" PACKAGES="$PACKAGES https://github.com/CoreSecurity/impacket/archive/master.zip" BUILDENV=${1:-`pwd`/buildenv}