frida mode fix on x86_64 archs
MODIFY
frida_mode/GNUmakefile
frida_mode/GNUmakefile
@@ -30,9 +30,7 @@ AFL_CFLAGS:=-Wno-unused-parameter \
LDFLAGS+=-shared \
-lpthread \
- -lresolv \
- -ldl \
- -lrt
+ -lresolv
ifdef DEBUG
CFLAGS+=-Werror \
@@ -72,7 +70,9 @@ ifdef DEBUG
endif
LDFLAGS+= -z noexecstack \
-Wl,--gc-sections \
- -Wl,--exclude-libs,ALL
+ -Wl,--exclude-libs,ALL \
+ -ldl \
+ -lrt
LDSCRIPT:=-Wl,--version-script=$(PWD)frida.map
endif

MODIFY
frida_mode/src/instrument/instrument_arm32.c
frida_mode/src/instrument/instrument_arm32.c
@@ -22,6 +22,10 @@ void instrument_coverage_optimize(const cs_insn * instr,
}
+void instrument_coverage_optimize_init(void) {
+ WARNF("Optimized coverage not supported on this architecture");
+}
+
void instrument_flush(GumStalkerOutput *output) {
gum_arm_writer_flush(output->writer.arm);

MODIFY
frida_mode/src/instrument/instrument_arm64.c
frida_mode/src/instrument/instrument_arm64.c
@@ -95,6 +95,9 @@ void instrument_coverage_optimize(const cs_insn * instr,
}
+void instrument_coverage_optimize_init(void) {
+}
+
void instrument_flush(GumStalkerOutput *output) {
gum_arm64_writer_flush(output->writer.arm64);

MODIFY
frida_mode/src/instrument/instrument_x64.c
frida_mode/src/instrument/instrument_x64.c
#include <fcntl.h>
#include <stddef.h>
-#include <asm/prctl.h>
#include <sys/mman.h>
-#include <sys/syscall.h>
#include <sys/shm.h>
+#if defined(__linux__)
+#include <asm/prctl.h>
+#include <sys/syscall.h>
+#endif
+
#include "frida-gumjs.h"
#include "config.h"

MODIFY
frida_mode/src/instrument/instrument_x86.c
frida_mode/src/instrument/instrument_x86.c
@@ -83,6 +83,9 @@ void instrument_coverage_optimize(const cs_insn * instr,
}
+void instrument_coverage_optimize_init(void) {
+}
+
void instrument_flush(GumStalkerOutput *output) {
gum_x86_writer_flush(output->writer.x86);

frida mode fix on x86_64 archs