about summary refs log tree commit diff
path: root/loft
diff options
context:
space:
mode:
Diffstat (limited to 'loft')
-rw-r--r--loft/bugs.scm15
-rw-r--r--loft/fuzzing.scm54
-rw-r--r--loft/patching.scm74
-rw-r--r--loft/synthesis.scm32
4 files changed, 175 insertions, 0 deletions
diff --git a/loft/bugs.scm b/loft/bugs.scm
new file mode 100644
index 0000000..62cdfbd
--- /dev/null
+++ b/loft/bugs.scm
@@ -0,0 +1,15 @@
+(use-modules (gnu packages base)
+             (guix packages))
+
+(define-public binutils-2.29
+  (package
+    (inherit binutils-2.33)
+    (version "2.29")
+    (source (origin
+              (inherit (package-source binutils))
+              (uri (string-append "mirror://gnu/binutils/binutils-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "1gqfyksdnj3iir5gzyvlp785mnk60g1pll6zbzbslfchhr4rb8i9"))
+              (patches '())))))
diff --git a/loft/fuzzing.scm b/loft/fuzzing.scm
new file mode 100644
index 0000000..d8bde9e
--- /dev/null
+++ b/loft/fuzzing.scm
@@ -0,0 +1,54 @@
+(use-modules (gnu packages instrumentation)
+             (gnu packages man)
+             (gnu packages m4)
+             (guix build-system gnu)
+             (guix download)
+             (guix git-download)
+             ((guix licenses) #:prefix license:)
+             (guix packages))
+
+(define-public afl++
+  (let ((commit "42fc9acf5bdd512608e3590a78749c2cd95ee5f3")
+        (revision "0"))
+    (package
+      (inherit aflplusplus)
+      (name "afl++")
+      (version (git-version "4.22a" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                       (url "https://github.com/AFLplusplus/AFLplusplus")
+                       (commit commit)))
+                (sha256
+                 (base32
+                  "149f5r341v921lfmdr4s9yap4qrqzc41vc7rx5xlgb78m5lwprx8"))
+               (patches (search-patches "afl++-keep-all-crashes.patch")))))))
+
+(define-public afl-dyninst
+  (package
+    (name "afl-dyninst")
+    (version "1.0.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://trong.loang.net/~cnx/afl-dyninst/snapshot/afl-dyninst-"
+               version ".tar.gz"))
+        (sha256
+          (base32 "13gxrsn2fwh5qazqy142v6g7mxhwfpq4f07h05fd1w4r46yh1v00"))))
+    (build-system gnu-build-system)
+    (arguments
+      (list #:make-flags
+            #~(list (string-append "DYNINST_LIB="
+                                   (assoc-ref %build-inputs "dyninst")
+                                   "/lib")
+                    (string-append "PREFIX=" #$output))
+            #:phases #~(modify-phases %standard-phases
+                         (delete 'configure)
+                         (delete 'check))))
+    (native-inputs (list m4 help2man))
+    (inputs (list afl++ dyninst))
+    (synopsis "Dyninst integration for AFL++")
+    (description "Dyninst integration for AFL++")
+    (home-page "https://trong.loang.net/~cnx/afl-dyninst")
+    (license (list license:agpl3+ license:asl2.0))))
diff --git a/loft/patching.scm b/loft/patching.scm
new file mode 100644
index 0000000..747dadf
--- /dev/null
+++ b/loft/patching.scm
@@ -0,0 +1,74 @@
+(use-modules (gnu packages compression)
+             (gnu packages elf)
+             (gnu packages engineering)
+             (gnu packages markup)
+             (gnu packages vim)
+             (guix build-system gnu)
+             (guix git-download)
+             ((guix licenses) #:prefix license:)
+             (guix packages))
+
+(define-public e9patch
+  (let ((commit "b4e7175abb8bd49ebbb6d09c7057aa43ddacac10")
+        (revision "0"))
+    (package
+      (name "e9patch")
+      (version (git-version "1.0.0-dev" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                     (url "https://github.com/GJDuck/e9patch")
+                     (commit commit)))
+                (sha256
+                 (base32
+                  "0a9s7h43ryyl4bvn0sid0dq78v24bnbcf271smj1a8wvffsih0jy"))
+                (file-name (git-file-name name version))
+                (patches (search-patches
+                           ;; https://github.com/GJDuck/e9patch/pull/94
+                           "e9patch-devendor.patch"
+                           ;; https://github.com/GJDuck/e9patch/pull/99
+                           "e9patch-plugin-api-headers.patch"
+                           ;; https://github.com/GJDuck/e9patch/pull/92
+                           "e9patch-check.patch"
+                           ;; https://github.com/GJDuck/e9patch/pull/95
+                           "e9patch-check-intel-format.patch"
+                           ;; https://github.com/GJDuck/e9patch/pull/88
+                           "e9patch-check-mode.patch"
+                           ;; https://github.com/GJDuck/e9patch/pull/93
+                           "e9patch-check-mov-imm.patch"
+                           ;; https://github.com/GJDuck/e9patch/issues/96
+                           "e9patch-check-rflags.patch"
+                           ;; https://github.com/GJDuck/e9patch/pull/97
+                           "e9patch-check-same_op_2.patch"))))
+      (build-system gnu-build-system)
+      (arguments (list #:modules `((ice-9 string-fun) ; string-replace-substring
+                                   ,@%default-gnu-modules)
+                       #:phases
+                       #~(modify-phases %standard-phases
+                           (add-after 'unpack 'fix-prefix
+                             (lambda _
+                               (substitute* "Makefile"
+                                 ;; https://github.com/GJDuck/e9patch/pull/87
+                                 (("\\\\/usr")
+                                  (string-replace-substring #$output "/" "\\/"))
+                                 (("/usr") #$output))))
+                           (delete 'configure))))
+      (native-inputs (list markdown xxd))
+      (inputs (list elfutils zycore zydis zlib))
+      (home-page "https://github.com/GJDuck/e9patch")
+      (synopsis "Static binary rewriting tool")
+      (description
+       "E9Patch is a static binary rewriting tool for x86-64 ELF binaries.
+E9Patch is:
+@itemize
+@item Scalable: E9Patch can reliably rewrite large/complex binaries
+      including web browsers (>100MB in size).
+@item Compatible: The rewritten binary is a drop-in replacement of the original,
+      with no additional dependencies.
+@item Fast: E9Patch can rewrite most binaries in a few seconds.
+@item Low Overheads: Both performance and memory.
+@item Programmable: E9Patch is designed so that it can be easily integrated
+      into other projects.
+@end itemize")
+      (license (list license:expat ;src/e9patch/e9loader_*.cpp
+                     license:gpl3+))))) ;rest
diff --git a/loft/synthesis.scm b/loft/synthesis.scm
new file mode 100644
index 0000000..be62654
--- /dev/null
+++ b/loft/synthesis.scm
@@ -0,0 +1,32 @@
+(use-modules (gnu packages python)
+             (gnu packages python-build)
+             (gnu packages python-xyz)
+             (guix build-system pyproject)
+             (guix download)
+             ((guix licenses) #:prefix license:)
+             (guix packages))
+
+(define-public python-pacfix
+  (package
+    (name "python-pacfix")
+    (version "0.0.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "pacfix" version))
+        (sha256
+          (base32 "1111111111111111111111111111111111111111111111111111"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-flit-core))
+    (propagated-inputs (list python-pysmt))
+    (arguments '(#:phases
+                 (modify-phases %standard-phases
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (invoke "python" "-m" "unittest" "-v")))))))
+    (home-page "https://github.com/hsh814/pacfix-python")
+    (synopsis "PAC-learning-based program systhesizer")
+    (description "Pacfix systhesizes predicate expressions for program repair
+from values in possitive and negative examples using a PAC learning algorithm.")
+    (license license:expat)))