aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-04-28 12:57:29 +0200
committervanhauser-thc <vh@thc.org>2021-04-28 12:57:29 +0200
commitda65eef57279dae7b652c40bdb31bc6cd749f63d (patch)
tree53fc32895fc73d0d742805006077220dd5971ce5
parentdde0538b484df627dac14ff030dd09f55c78558e (diff)
downloadafl++-da65eef57279dae7b652c40bdb31bc6cd749f63d.tar.gz
fix frida mode
-rw-r--r--frida_mode/GNUmakefile6
-rw-r--r--frida_mode/include/persistent.h7
-rw-r--r--frida_mode/src/lib.c2
-rw-r--r--frida_mode/src/persistent/persistent.c3
4 files changed, 10 insertions, 8 deletions
diff --git a/frida_mode/GNUmakefile b/frida_mode/GNUmakefile
index 51107910..6b193806 100644
--- a/frida_mode/GNUmakefile
+++ b/frida_mode/GNUmakefile
@@ -5,7 +5,7 @@ SRC_DIR:=$(PWD)src/
INCLUDES:=$(wildcard $(INC_DIR)*.h)
SOURCES:=$(wildcard $(SRC_DIR)**/*.c) $(wildcard $(SRC_DIR)*.c)
BUILD_DIR:=$(PWD)build/
-CFLAGS+=-fPIC -D_GNU_SOURCE -Wno-prio-ctor-dtor
+CFLAGS+=-fPIC -D_GNU_SOURCE -Wno-prio-ctor-dtor -fcommon -Wl,--allow-multiple-definition
FRIDA_BUILD_DIR:=$(BUILD_DIR)frida/
FRIDA_TRACE:=$(BUILD_DIR)afl-frida-trace.so
@@ -71,8 +71,8 @@ $(FRIDA_TRACE): $(GUM_DEVIT_LIBRARY) $(GUM_DEVIT_HEADER) $(SOURCES) $(QEMU_INC_A
-I $(ROOT) \
-I $(ROOT)include \
-I $(INC_DIR) \
- $(ROOT)instrumentation/afl-compiler-rt.o.c \
- -lpthread -ldl -lresolv -lelf
+ $(ROOT)instrumentation/afl-compiler-rt.o.c
+# -lpthread -ldl -lresolv -lelf
cp -v $(FRIDA_TRACE) $(ROOT)
diff --git a/frida_mode/include/persistent.h b/frida_mode/include/persistent.h
index 14c8a268..017c26c7 100644
--- a/frida_mode/include/persistent.h
+++ b/frida_mode/include/persistent.h
@@ -1,5 +1,9 @@
-#include "frida-gum.h"
+#ifndef _PERSISTENT_H
+
+#define _PERSISTENT_H
+
+#include "frida-gum.h"
#include "config.h"
typedef struct arch_api_regs api_regs;
@@ -24,3 +28,4 @@ gboolean persistent_is_supported(void);
void persistent_prologue(GumStalkerOutput *output);
+#endif
diff --git a/frida_mode/src/lib.c b/frida_mode/src/lib.c
index 326d4819..6e27c170 100644
--- a/frida_mode/src/lib.c
+++ b/frida_mode/src/lib.c
@@ -1,6 +1,6 @@
#include <elf.h>
#include <fcntl.h>
-#include <linux/limits.h>
+#include <limits.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
diff --git a/frida_mode/src/persistent/persistent.c b/frida_mode/src/persistent/persistent.c
index fe3a1d20..34e4093e 100644
--- a/frida_mode/src/persistent/persistent.c
+++ b/frida_mode/src/persistent/persistent.c
@@ -9,9 +9,6 @@
#include "util.h"
int __afl_sharedmem_fuzzing = 0;
-afl_persistent_hook_fn hook = NULL;
-guint64 persistent_start = 0;
-guint64 persistent_count = 0;
void persistent_init(void) {