summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Cimarelli2021-06-02 03:01:53 +0200
committerSimone Cimarelli2021-06-02 03:02:27 +0200
commit765721f1081a560930786139c51d001a0a40cb4f (patch)
treec228ce4ad9d1b565f4dec000677a37a277e6cc40
downloadaur-765721f1081a560930786139c51d001a0a40cb4f.tar.gz
v2.1.0
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD45
-rw-r--r--install_dir.patch12
-rw-r--r--pthread.patch12
4 files changed, 101 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1d80108dfdb0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = pezor
+ pkgdesc = Open-Source PE Packer
+ pkgver = 2.1.0
+ pkgrel = 1
+ url = https://github.com/phra/PEzor
+ arch = x86_64
+ license = GPL3
+ license = Apache
+ makedepends = git
+ depends = capstone
+ depends = clang
+ depends = cowsay
+ depends = donut
+ depends = keystone
+ depends = mingw-w64-binutils
+ depends = mingw-w64-clang-git
+ depends = mingw-w64-crt
+ depends = mingw-w64-gcc
+ depends = mingw-w64-headers
+ depends = mingw-w64-winpthreads
+ depends = mono
+ depends = sgn
+ source = git+https://github.com/phra/PEzor.git#commit=d03563cd0c2994d911f9ffb7edb3987163a721fe
+ source = git+https://github.com/JustasMasiulis/inline_syscall.git#commit=24238544b510d8f85ca38de3a43bc41fa8cfe380
+ source = install_dir.patch
+ source = pthread.patch
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = 30f614b1c17d54ab96509d8f411c836d89d41a56696545c89e56f358c04aee2c8fe97cba5e53cd08abb2b950f9b4fbebd45954045b8d1def1553649d547c33ff
+ sha512sums = d0a2488cd5f8d700762c897335a0933dfe4a74fab2d62626ee30c1aa8faa766097c0e581b855c8e741f6918d8b51affd28b656ebda01a638cdcaa901e33219bb
+
+pkgname = pezor
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c1e81a84662e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Simone Cimarelli <aquilairreale@ymail.com>
+
+pkgname=pezor
+pkgver=2.1.0
+pkgrel=1
+pkgdesc='Open-Source PE Packer'
+arch=(x86_64)
+url='https://github.com/phra/PEzor'
+license=(GPL3 Apache)
+makedepends=(git)
+depends=(capstone clang cowsay donut keystone mingw-w64-binutils mingw-w64-clang-git mingw-w64-crt mingw-w64-gcc mingw-w64-headers mingw-w64-winpthreads mono sgn)
+source=('git+https://github.com/phra/PEzor.git#commit=d03563cd0c2994d911f9ffb7edb3987163a721fe'
+ 'git+https://github.com/JustasMasiulis/inline_syscall.git#commit=24238544b510d8f85ca38de3a43bc41fa8cfe380'
+ 'install_dir.patch'
+ 'pthread.patch')
+sha512sums=('SKIP'
+ 'SKIP'
+ '30f614b1c17d54ab96509d8f411c836d89d41a56696545c89e56f358c04aee2c8fe97cba5e53cd08abb2b950f9b4fbebd45954045b8d1def1553649d547c33ff'
+ 'd0a2488cd5f8d700762c897335a0933dfe4a74fab2d62626ee30c1aa8faa766097c0e581b855c8e741f6918d8b51affd28b656ebda01a638cdcaa901e33219bb')
+
+prepare() {
+ cd PEzor
+ patch -Np1 -i "$srcdir/install_dir.patch"
+ patch -Np1 -i "$srcdir/pthread.patch"
+ mkdir -p deps
+ ln -sTf "$srcdir/inline_syscall" deps/inline_syscall
+ sed -i '/#include <intrin\.h>/d' deps/inline_syscall/include/in_memory_init.hpp
+}
+
+package() {
+ mkdir -p "$pkgdir/opt"
+ find -L PEzor \( \
+ -path '*/.git*' \
+ -o -path '*/.vscode*' \
+ -o -path PEzor/install.sh \
+ -o -path PEzor/install.test.sh \
+ -o -path PEzor/docker.sh \
+ -o -name LICENSE \
+ -o -name README.md \
+ \) -prune -o -type d -o -print0 \
+ | xargs -0 cp -r --parents -t "$pkgdir/opt"
+ chmod +x "$pkgdir/opt/PEzor/PEzor.sh"
+ mkdir -p "$pkgdir/usr/bin"
+ ln -s /opt/PEzor/PEzor.sh "$pkgdir/usr/bin/pezor"
+}
diff --git a/install_dir.patch b/install_dir.patch
new file mode 100644
index 000000000000..ec49a5ed5377
--- /dev/null
+++ b/install_dir.patch
@@ -0,0 +1,12 @@
+diff -ur a/PEzor.sh b/PEzor.sh
+--- a/PEzor.sh 2021-06-02 02:42:40.407590509 +0200
++++ b/PEzor.sh 2021-06-02 02:42:56.194032668 +0200
+@@ -16,7 +16,7 @@
+ echo '---------------------------------------------------------------------------'
+
+ CURRENT_DIR=`pwd`
+-INSTALL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
++INSTALL_DIR=/opt/PEzor
+ TMP_DIR=/tmp
+ SGN=false
+ BLOB=false
diff --git a/pthread.patch b/pthread.patch
new file mode 100644
index 000000000000..1e7da1752a0e
--- /dev/null
+++ b/pthread.patch
@@ -0,0 +1,12 @@
+diff -ur a/PEzor.sh b/PEzor.sh
+--- a/PEzor.sh 2021-06-02 02:56:56.131038224 +0200
++++ b/PEzor.sh 2021-06-02 02:57:25.403936433 +0200
+@@ -387,7 +387,7 @@
+ SOURCES="$SOURCES $TMP_DIR/ApiSetMap.o $TMP_DIR/loader.o"
+ fi
+
+- $CXX $CPPFLAGS $CXXFLAGS $INSTALL_DIR/*.cpp $TMP_DIR/{shellcode,sleep}.cpp $SOURCES -o $BLOB.packed.$OUTPUT_EXTENSION &&
++ $CXX $CPPFLAGS $CXXFLAGS -pthread $INSTALL_DIR/*.cpp $TMP_DIR/{shellcode,sleep}.cpp $SOURCES -lpthread -o $BLOB.packed.$OUTPUT_EXTENSION &&
+ strip $BLOB.packed.$OUTPUT_EXTENSION || exit 1
+ ;;
+ dotnet*)