From a2c222a0107419e07cb3f10bfc4dc46e17dcdf73 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Sun, 31 May 2020 12:18:31 -0500 Subject: [PATCH 1/4] keystone: enable python3 bindings --- srcpkgs/keystone-python3 | 1 + srcpkgs/keystone/patches/fix-lib-name.patch | 11 +++++++++++ srcpkgs/keystone/template | 19 ++++++++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 120000 srcpkgs/keystone-python3 create mode 100644 srcpkgs/keystone/patches/fix-lib-name.patch diff --git a/srcpkgs/keystone-python3 b/srcpkgs/keystone-python3 new file mode 120000 index 00000000000..54e10b1b46c --- /dev/null +++ b/srcpkgs/keystone-python3 @@ -0,0 +1 @@ +keystone \ No newline at end of file diff --git a/srcpkgs/keystone/patches/fix-lib-name.patch b/srcpkgs/keystone/patches/fix-lib-name.patch new file mode 100644 index 00000000000..57fe882e5be --- /dev/null +++ b/srcpkgs/keystone/patches/fix-lib-name.patch @@ -0,0 +1,11 @@ +--- bindings/python/keystone/keystone.py.orig ++++ bindings/python/keystone/keystone.py +@@ -20,7 +20,7 @@ + __file__ = inspect.getfile(inspect.currentframe()) + + _lib_path = split(__file__)[0] +-_all_libs = ('keystone.dll', 'libkeystone.so', 'libkeystone.dylib') ++_all_libs = ('keystone.dll', 'libkeystone.so.0', 'libkeystone.dylib') + _found = False + + for _lib in _all_libs: diff --git a/srcpkgs/keystone/template b/srcpkgs/keystone/template index 9615d6bbb02..3eda8329ada 100644 --- a/srcpkgs/keystone/template +++ b/srcpkgs/keystone/template @@ -1,17 +1,22 @@ # Template file for 'keystone' pkgname=keystone version=0.9.1 -revision=1 +revision=2 build_style=cmake configure_args='-DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD=all' -hostmakedepends="python" +hostmakedepends="python3" +makedepends="python3-devel" short_desc="Lightweight multi-platform, multi-architecture assembler framework" maintainer="Orphaned " -license="GPL-2" +license="GPL-2.0-only" homepage="http://www.keystone-engine.org/" distfiles="https://github.com/keystone-engine/keystone/archive/${version}.tar.gz" checksum=e9d706cd0c19c49a6524b77db8158449b9c434b415fbf94a073968b68cf8a9f0 +post_install() { + cd bindings/python && DESTDIR=${DESTDIR} make install3 +} + keystone-devel_package() { short_desc+=" - development files" depends="${sourcepkg}>=${version}_${revision}" @@ -21,3 +26,11 @@ keystone-devel_package() { vmove usr/lib/pkgconfig } } + +keystone-python3_package() { + short_desc+=" - Python3 bindings" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove "$py3_lib" + } +} From 971fdd2286cef5b19767d9c22b00dee90cb50c5c Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Sun, 31 May 2020 12:18:41 -0500 Subject: [PATCH 2/4] New package: python3-filebytes-0.10.2 --- srcpkgs/python3-filebytes/template | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 srcpkgs/python3-filebytes/template diff --git a/srcpkgs/python3-filebytes/template b/srcpkgs/python3-filebytes/template new file mode 100644 index 00000000000..af7c3c96f55 --- /dev/null +++ b/srcpkgs/python3-filebytes/template @@ -0,0 +1,18 @@ +# Template file for 'python3-filebytes' +pkgname=python3-filebytes +version=0.10.2 +revision=1 +wrksrc="filebytes-${version}" +archs="noarch" +build_style=python3-module +hostmakedepends="python3-setuptools" +short_desc="Library to read and edit ELF, PE, and other files" +maintainer="Andrew Benson " +license="BSD-3-Clause" +homepage="https://scoding.de/filebytes-introduction" +distfiles="https://github.com/sashs/filebytes/archive/v${version}.tar.gz" +checksum=6a22a6cec9065c96143f7e3acb0acaffd5eb0d2419749361cb73e40d7e10c2d4 + +post_install() { + vlicense COPYING +} From 06b5349a5dd9d0409060bd171ca755991f97aae9 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Sun, 31 May 2020 12:19:11 -0500 Subject: [PATCH 3/4] New package: python3-Ropper-1.13.5 --- srcpkgs/python3-Ropper/template | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 srcpkgs/python3-Ropper/template diff --git a/srcpkgs/python3-Ropper/template b/srcpkgs/python3-Ropper/template new file mode 100644 index 00000000000..1137a9a6b36 --- /dev/null +++ b/srcpkgs/python3-Ropper/template @@ -0,0 +1,19 @@ +# Template file for 'python3-Ropper' +pkgname=python3-Ropper +version=1.13.5 +revision=1 +archs="noarch" +build_style=python3-module +wrksrc="Ropper-${version}" +hostmakedepends="python3-setuptools" +depends="capstone-python3 python3-filebytes keystone-python3" +short_desc="Find gadgets to build rop chains for different architectures" +maintainer="Andrew Benson " +license="BSD-3-Clause" +homepage="https://scoding.de/ropper/" +distfiles="https://github.com/sashs/Ropper/archive/v${version}.tar.gz" +checksum=b32329495645a6e0a8c1b2c4f4e330295a05b82eb8a5965051ad5c73e89bf371 + +post_install() { + vlicense COPYING +} From 0dba683d6b7f4c4afd23555d54c9d02a0eac09f8 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Sun, 31 May 2020 12:46:17 -0500 Subject: [PATCH 4/4] [WIP] New package: gef-2020.03.1 Closes #22226. --- srcpkgs/gef/template | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 srcpkgs/gef/template diff --git a/srcpkgs/gef/template b/srcpkgs/gef/template new file mode 100644 index 00000000000..34b169e78d7 --- /dev/null +++ b/srcpkgs/gef/template @@ -0,0 +1,22 @@ +# Template file for 'gef' +pkgname=gef +_version=2020.03-1 +version="${_version//-/.}" +revision=1 +archs="noarch" +wrksrc="${pkgname}-${_version}" +pycompile_dirs="usr/share/gef" +depends="keystone-python3 capstone-python3 unicorn-python3 python3-Ropper" +short_desc="GDB Enhanced Features for exploit devs & reversers" +maintainer="Andrew Benson " +license="MIT" +homepage="https://gef.readthedocs.io/en/master/" +distfiles="https://github.com/hugsy/gef/archive/${_version}.tar.gz" +checksum=ab303d4e3b5a0bee8785409f59b0b2ab025d862a1aeac3d8d6c4ff2fe0209ded +python_version="3" + +do_install() { + vlicense LICENSE + vmkdir usr/share/gef + vcopy gef.py usr/share/gef +}