about summary refs log tree commit diff
path: root/qemu_mode/unsigaction
diff options
context:
space:
mode:
Diffstat (limited to 'qemu_mode/unsigaction')
-rw-r--r--qemu_mode/unsigaction/Makefile34
-rw-r--r--qemu_mode/unsigaction/README.md7
-rw-r--r--qemu_mode/unsigaction/unsigaction.c3
3 files changed, 44 insertions, 0 deletions
diff --git a/qemu_mode/unsigaction/Makefile b/qemu_mode/unsigaction/Makefile
new file mode 100644
index 00000000..9aa96330
--- /dev/null
+++ b/qemu_mode/unsigaction/Makefile
@@ -0,0 +1,34 @@
+#
+# american fuzzy lop - unsigaction
+# --------------------------------
+#
+# Written by Andrea Fioraldi <andreafioraldi@gmail.com>
+#
+# Copyright 2019 Andrea Fioraldi. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+
+ifndef AFL_NO_X86
+
+all: lib_i386 lib_amd64
+
+lib_i386:
+	$(CC) -m32 -fPIC -shared unsigaction.c -o unsigaction32.so
+
+lib_amd64:
+	$(CC) -fPIC -shared unsigaction.c -o unsigaction64.so
+
+clean:
+	rm -f unsigaction32.so unsigaction64.so
+
+else
+
+all:
+	@echo "[!] Note: skipping compilation of unsigaction (AFL_NO_X86 set)."
+
+endif
diff --git a/qemu_mode/unsigaction/README.md b/qemu_mode/unsigaction/README.md
new file mode 100644
index 00000000..0f3707fd
--- /dev/null
+++ b/qemu_mode/unsigaction/README.md
@@ -0,0 +1,7 @@
+# unsigation
+
+This library disable sigaction when preloaded.
+
+Mainly needed by Wine mode but can be used as a separate tool.
+
+A similar solution can be found in is [preeny](https://github.com/zardus/preeny).
diff --git a/qemu_mode/unsigaction/unsigaction.c b/qemu_mode/unsigaction/unsigaction.c
new file mode 100644
index 00000000..004084f9
--- /dev/null
+++ b/qemu_mode/unsigaction/unsigaction.c
@@ -0,0 +1,3 @@
+int sigaction(int signum, void *act, void *oldact) {
+  return 0;
+}