From 18fd263cba2a78cf5a1c318e61a9c2c7f9cf4df9 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 10:10:30 -0500
Subject: [PATCH 1/7] New package: python3-virustotal-api-1.1.10

---
 srcpkgs/python3-virustotal-api/template | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 srcpkgs/python3-virustotal-api/template

diff --git a/srcpkgs/python3-virustotal-api/template b/srcpkgs/python3-virustotal-api/template
new file mode 100644
index 00000000000..fe38c1dc819
--- /dev/null
+++ b/srcpkgs/python3-virustotal-api/template
@@ -0,0 +1,20 @@
+# Template file for 'python3-virustotal-api'
+pkgname=python3-virustotal-api
+version=1.1.10
+revision=1
+archs=noarch
+wrksrc="virustotal-api-${version}"
+build_style=python3-module
+pycompile_module="virus_total_apis"
+hostmakedepends="python3-setuptools"
+depends="python3-requests"
+short_desc="Virus Total Public/Private/Intel API "
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="MIT"
+homepage="https://github.com/blacktop/virustotal-api"
+distfiles="${PYPI_SITE}/v/virustotal-api/virustotal-api-${version}.tar.gz"
+checksum=7705881533852e3d22f45a3e8f266c14f153aee79a6768cec36ff88dd5b625f8
+
+post_install() {
+	vlicense LICENSE
+}

From 065e3de73c448296fb314da12bac47a81abdcc44 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 10:15:24 -0500
Subject: [PATCH 2/7] New package: python3-yara-3.10.0

---
 .../python3-yara/patches/use-system-yara.patch    |  9 +++++++++
 srcpkgs/python3-yara/template                     | 15 +++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 srcpkgs/python3-yara/patches/use-system-yara.patch
 create mode 100644 srcpkgs/python3-yara/template

diff --git a/srcpkgs/python3-yara/patches/use-system-yara.patch b/srcpkgs/python3-yara/patches/use-system-yara.patch
new file mode 100644
index 00000000000..89b36bd567c
--- /dev/null
+++ b/srcpkgs/python3-yara/patches/use-system-yara.patch
@@ -0,0 +1,9 @@
+--- setup.py.orig	2019-05-02 17:34:46.000000000 +0800
++++ setup.py	2019-05-07 08:20:20.841022106 +0800
+@@ -325,5 +325,5 @@
+         'update': UpdateCommand},
+     ext_modules=[Extension(
+         name='yara',
+-        include_dirs=['yara/libyara/include', 'yara/libyara/', '.'],
++        libraries = ['yara'],
+         sources=['yara-python.c'])])
diff --git a/srcpkgs/python3-yara/template b/srcpkgs/python3-yara/template
new file mode 100644
index 00000000000..f7065a9d994
--- /dev/null
+++ b/srcpkgs/python3-yara/template
@@ -0,0 +1,15 @@
+# Template file for 'python3-yara'
+pkgname=python3-yara
+version=3.10.0
+revision=1
+wrksrc="yara-python-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+makedepends="yara-devel python3-devel"
+depends="python3"
+short_desc="Python3 interface for YARA"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="Apache-2.0"
+homepage="http://virustotal.github.io/yara/"
+distfiles="https://github.com/VirusTotal/yara-python/archive/v${version}.tar.gz"
+checksum=14ae284b3963eaaea280895647cce9860e3c97d747edb5b9269c78710ee21c2b

From 1754d4ce4951a7c9b05de3a51b76b89dbdd31657 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 10:42:29 -0500
Subject: [PATCH 3/7] New package: python3-easygui-0.98.1

---
 srcpkgs/python3-easygui/template | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/python3-easygui/template

diff --git a/srcpkgs/python3-easygui/template b/srcpkgs/python3-easygui/template
new file mode 100644
index 00000000000..c1ec4767ae9
--- /dev/null
+++ b/srcpkgs/python3-easygui/template
@@ -0,0 +1,21 @@
+# Template file for 'python3-easygui'
+pkgname=python3-easygui
+version=0.98.1
+revision=1
+archs=noarch
+wrksrc="easygui-${version}"
+build_style=python3-module
+pycompile_module="easygui"
+hostmakedepends="python3-setuptools"
+depends="python3"
+short_desc="Simple, very easy GUI programming in Python"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://github.com/robertlugg/easygui"
+distfiles="${homepage}/archive/${version}.tar.gz"
+checksum=b46d1f06b85a2de2b15129906d21bb42bc66a6e800315fed57e634cf151fc083
+
+post_install() {
+	sed -n '29,74p' easygui/easygui.py > LICENSE
+	vlicense LICENSE
+}

From 2493c495b6a9c84fd0b94aa6d531f397c8155f3f Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 11:03:54 -0500
Subject: [PATCH 4/7] New package: python3-msoffcrypto-tool-4.10.0

---
 srcpkgs/msoffcrypto-tool                  |  1 +
 srcpkgs/python3-msoffcrypto-tool/template | 28 +++++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 120000 srcpkgs/msoffcrypto-tool
 create mode 100644 srcpkgs/python3-msoffcrypto-tool/template

diff --git a/srcpkgs/msoffcrypto-tool b/srcpkgs/msoffcrypto-tool
new file mode 120000
index 00000000000..031b67bb674
--- /dev/null
+++ b/srcpkgs/msoffcrypto-tool
@@ -0,0 +1 @@
+python3-msoffcrypto-tool
\ No newline at end of file
diff --git a/srcpkgs/python3-msoffcrypto-tool/template b/srcpkgs/python3-msoffcrypto-tool/template
new file mode 100644
index 00000000000..201bb68256d
--- /dev/null
+++ b/srcpkgs/python3-msoffcrypto-tool/template
@@ -0,0 +1,28 @@
+# Template file for 'python3-msoffcrypto-tool'
+pkgname=python3-msoffcrypto-tool
+version=4.10.0
+revision=1
+archs=noarch
+wrksrc="msoffcrypto-tool-${version}"
+build_style=python3-module
+pycompile_module="msoffcrypto"
+hostmakedepends="python3-setuptools"
+depends="python3-olefile python3-cryptography"
+short_desc="Python3 library for decrypting MS Office files"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="MIT"
+homepage="https://github.com/nolze/msoffcrypto-tool"
+distfiles="${homepage}/archive/v${version}.tar.gz"
+checksum=546a97e991e00e8c39d90b334f738ff7a8e23e2450c0ba0aafeff0a24258ce7f
+
+post_install() {
+	vlicense LICENSE.txt
+}
+
+msoffcrypto-tool_package() {
+	short_desc="${short_desc/library/tool}"
+	depends="${sourcepkg}>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin
+	}
+}

From f44924c71174a8072f11d7ad0c6d531576a5fd80 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 11:14:28 -0500
Subject: [PATCH 5/7] New package: python3-pcodedmp-1.2.5

---
 srcpkgs/pcodedmp                  |  1 +
 srcpkgs/python3-pcodedmp/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/pcodedmp
 create mode 100644 srcpkgs/python3-pcodedmp/template

diff --git a/srcpkgs/pcodedmp b/srcpkgs/pcodedmp
new file mode 120000
index 00000000000..d75eccabce3
--- /dev/null
+++ b/srcpkgs/pcodedmp
@@ -0,0 +1 @@
+python3-pcodedmp
\ No newline at end of file
diff --git a/srcpkgs/python3-pcodedmp/template b/srcpkgs/python3-pcodedmp/template
new file mode 100644
index 00000000000..63c54ec8ab3
--- /dev/null
+++ b/srcpkgs/python3-pcodedmp/template
@@ -0,0 +1,24 @@
+# Template file for 'python3-pcodedmp'
+pkgname=python3-pcodedmp
+version=1.2.5
+revision=1
+archs=noarch
+wrksrc="pcodedmp-${version}"
+build_style=python3-module
+pycompile_module="pcodedmp"
+hostmakedepends="python3-setuptools"
+depends="python3"
+short_desc="VBA p-code disassembler library for Python3"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="GPL-3.0-only"
+homepage="https://github.com/bontchev/pcodedmp"
+distfiles="${homepage}/archive/v${version}.tar.gz"
+checksum=da73d7ffe9decb2d2dcdbfc6d98ac554985f801c9183b954fa91d20f26bc5728
+
+pcodedmp_package() {
+	short_desc="${short_desc/library/tool}"
+	depends="${sourcepkg}>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin
+	}
+}

From da800320619eb9d1ff44dfdd6742e0e024e50696 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 11:20:18 -0500
Subject: [PATCH 6/7] New package: python3-oletools-0.54.2b

---
 srcpkgs/oletools                  |  1 +
 srcpkgs/python3-oletools/template | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 120000 srcpkgs/oletools
 create mode 100644 srcpkgs/python3-oletools/template

diff --git a/srcpkgs/oletools b/srcpkgs/oletools
new file mode 120000
index 00000000000..9de9eb786e5
--- /dev/null
+++ b/srcpkgs/oletools
@@ -0,0 +1 @@
+python3-oletools
\ No newline at end of file
diff --git a/srcpkgs/python3-oletools/template b/srcpkgs/python3-oletools/template
new file mode 100644
index 00000000000..af9a91ff273
--- /dev/null
+++ b/srcpkgs/python3-oletools/template
@@ -0,0 +1,29 @@
+# Template file for 'python3-oletools'
+pkgname=python3-oletools
+version=0.54.2b
+revision=1
+archs=noarch
+wrksrc="oletools-${version}"
+build_style=python3-module
+pycompile_module="oletools"
+hostmakedepends="python3-setuptools"
+depends="python3-parsing python3-olefile python3-colorclass python3-easygui
+ python3-msoffcrypto-tool python3-pcodedmp"
+short_desc="Python3 library to analyze MS OLE2 and Office files"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="MIT"
+homepage="https://github.com/decalage2/oletools"
+distfiles="${homepage}/archive/v${version}.tar.gz"
+checksum=967a88161064df1a5b1e0ff7c5092d5148555e4ae0a25c87898b078131b567da
+
+post_install() {
+	vlicense oletools/LICENSE.txt
+}
+
+oletools_package() {
+	short_desc="${short_desc/library/tools}"
+	depends="${sourcepkg}>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/bin
+	}
+}

From e939df2acee01903095ca1500fc2d455c3aef027 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Tue, 18 Jun 2019 11:44:36 -0500
Subject: [PATCH 7/7] [WIP] peframe: update to 6.0.1

Waiting for resolution to https://github.com/guelfoweb/peframe/issues/21.
---
 srcpkgs/peframe/patches/fix-path.patch | 16 ++++++++++++
 srcpkgs/peframe/template               | 34 ++++++++++++++------------
 2 files changed, 34 insertions(+), 16 deletions(-)
 create mode 100644 srcpkgs/peframe/patches/fix-path.patch

diff --git a/srcpkgs/peframe/patches/fix-path.patch b/srcpkgs/peframe/patches/fix-path.patch
new file mode 100644
index 00000000000..73ae81c22fa
--- /dev/null
+++ b/srcpkgs/peframe/patches/fix-path.patch
@@ -0,0 +1,16 @@
+--- peframe-cli.py.orig
++++ peframe-cli.py
+@@ -3,9 +3,13 @@
+ 
+ # by Gianni 'guelfoweb' Amato
+ 
++
+ import os
+ import sys
+ import json
++
++sys.path.append("/usr/share/peframe")
++
+ import peframe
+ import readline
+ import argparse
diff --git a/srcpkgs/peframe/template b/srcpkgs/peframe/template
index 633281255ae..ecbe7947eff 100644
--- a/srcpkgs/peframe/template
+++ b/srcpkgs/peframe/template
@@ -1,25 +1,27 @@
 # Template file for 'peframe'
 pkgname=peframe
-version=5.0.1
-revision=2
+version=6.0.1
+revision=1
 archs=noarch
-_gitver=b8f46740d6870c4e3d60a1f157773af9221c2f67
-wrksrc="${pkgname}-${_gitver}"
-build_style=python2-module
-pycompile_module="peframe"
-hostmakedepends="python-setuptools"
-depends="python-setuptools python-simplejson"
+pycompile_dirs="usr/share/peframe"
+depends="python3-pefile python3-magic python3-M2Crypto python3-virustotal-api
+ python3-yara python3-oletools"
 short_desc="Perform static analysis on Portable Executables"
 maintainer="Andrew Benson <abenson+void@gmail.com>"
-license="MIT"
+license="MIT, GPL-2.0-only"
 homepage="https://github.com/guelfoweb/peframe"
-distfiles="https://github.com/guelfoweb/peframe/archive/${_gitver}.tar.gz"
-checksum=74cfdc51e999a4b86102dd383e7bf5e170da70f796a7cedb341e5c81774c7891
+distfiles="https://github.com/guelfoweb/peframe/archive/${version}.tar.gz"
+checksum=afb54d8daf9dcc0dedb9a1f0a56178c39941f94c08b0a4e808ebda0f3acb6164
+python_version="3"
+pycompile_version="$py3_ver"
 
-pre_configure() {
-	sed -n '5,24p' peframe/peframe.py > LICENSE
-}
+do_install() {
+	vmkdir usr/share/peframe
+	for i in config modules signatures peframe.py; do
+		vcopy $i usr/share/peframe
+	done
+
+	vbin peframe-cli.py peframe
 
-post_install() {
-	vlicense LICENSE
+	#vlicense LICENSE
 }
