fix frida mode
MODIFY
frida_mode/GNUmakefile
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)

MODIFY
frida_mode/include/persistent.h
frida_mode/include/persistent.h
-#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

MODIFY
frida_mode/src/lib.c
frida_mode/src/lib.c
#include <elf.h>
#include <fcntl.h>
-#include <linux/limits.h>
+#include <limits.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>

MODIFY
frida_mode/src/persistent/persistent.c
frida_mode/src/persistent/persistent.c
#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) {

fix frida mode