summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiretza2017-09-10 21:25:44 +0200
committerxiretza2017-09-10 21:25:44 +0200
commitaa70429a1727cfb5661f7d77292b0ab3b11b1002 (patch)
tree13082d68b2a2116a47d46694fce47ab16fbf8b84
downloadaur-aa70429a1727cfb5661f7d77292b0ab3b11b1002.tar.gz
initial commit
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD45
-rw-r--r--sandsifter-git.patch33
3 files changed, 97 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d248a39e0b7a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = sandsifter-git
+ pkgdesc = The x86 processor fuzzer
+ pkgver = r1.dff6324
+ pkgrel = 1
+ url = https://github.com/xoreaxeaxeax/sandsifter
+ arch = i686
+ arch = x86_64
+ license = unknown
+ makedepends = git
+ depends = python2-capstone
+ provides = sandsifter
+ conflicts = sandsifter
+ source = sandsifter::git+https://github.com/xoreaxeaxeax/sandsifter
+ source = sandsifter-git.patch
+ sha256sums = SKIP
+ sha256sums = ee35e3e5d6a6c018e5a138af388d78d0dce3b1605b53ddfe1241cfdef9daa18a
+
+pkgname = sandsifter-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cac14c65356e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: xiretza <xiretza+aur@gmail.com>
+_pkgname=sandsifter
+pkgname="${_pkgname}-git"
+pkgver=r1.dff6324
+pkgrel=1
+pkgdesc="The x86 processor fuzzer"
+arch=("i686" "x86_64")
+url="https://github.com/xoreaxeaxeax/${_pkgname}"
+# see https://github.com/xoreaxeaxeax/sandsifter/issues/13
+license=("unknown")
+groups=()
+depends=(python2-capstone)
+makedepends=('git')
+provides=("${_pkgname}")
+conflicts=("${_pkgname}")
+source=("${_pkgname}::git+${url}"
+ "${pkgname}.patch")
+sha256sums=('SKIP'
+ 'ee35e3e5d6a6c018e5a138af388d78d0dce3b1605b53ddfe1241cfdef9daa18a')
+
+pkgver() {
+ cd "$srcdir/${_pkgname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$srcdir/${_pkgname}"
+ patch -p1 -i "${srcdir}/${pkgname}.patch"
+ #sed -i -E 's~(#!/usr/bin/)python~\1env python2~' *.py
+ #sed -i -E "s~(INJECTOR = \")./(injector\")~\1/opt/${_pkgname}/\2~" sifter.py
+ #sed -i -E "s~(OUTPUT = \")./(data/\")~\1/opt/${_pkgname}/\2~" sifter.py
+}
+
+build() {
+ cd "$srcdir/${_pkgname}"
+ make CFLAGS="-no-pie"
+}
+
+package() {
+ cd "$srcdir/${_pkgname}"
+ install -Dm 644 -t "${pkgdir}/opt/${_pkgname}" mutator.py
+ install -Dm 655 -t "${pkgdir}/opt/${_pkgname}" summarize.py injector
+ cp -r disas gui pyutil "${pkgdir}/opt/${_pkgname}/"
+ install -Dm 655 -t "${pkgdir}/usr/bin/" sifter.py
+}
diff --git a/sandsifter-git.patch b/sandsifter-git.patch
new file mode 100644
index 000000000000..305a8869a0dc
--- /dev/null
+++ b/sandsifter-git.patch
@@ -0,0 +1,33 @@
+diff --git a/sifter.py b/sifter.py
+index 856b607..47d2d88 100755
+--- a/sifter.py
++++ b/sifter.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python2
+
+ # instruction injector frontend
+
+@@ -27,10 +27,10 @@ import code
+ import copy
+ from ctypes import *
+
+-INJECTOR = "./injector"
++INJECTOR = "/opt/sandsifter/injector"
+ arch = ""
+
+-OUTPUT = "./data/"
++OUTPUT = "/opt/sandsifter/data/"
+ LOG = OUTPUT + "log"
+ SYNC = OUTPUT + "sync"
+ TICK = OUTPUT + "tick"
+diff --git a/summarize.py b/summarize.py
+index 44d524f..014b58d 100755
+--- a/summarize.py
++++ b/summarize.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python2
+
+ # we had a much more automated and intelligent approach to reducing the log, but
+ # could not come up with a reasonable way to differentiate between a modr/m byte