about summary refs log tree commit diff
path: root/frida_mode/test/fasan
diff options
context:
space:
mode:
Diffstat (limited to 'frida_mode/test/fasan')
-rw-r--r--frida_mode/test/fasan/GNUmakefile9
-rw-r--r--frida_mode/test/fasan/Makefile6
-rw-r--r--frida_mode/test/fasan/test.c5
3 files changed, 16 insertions, 4 deletions
diff --git a/frida_mode/test/fasan/GNUmakefile b/frida_mode/test/fasan/GNUmakefile
index 22689395..08b271de 100644
--- a/frida_mode/test/fasan/GNUmakefile
+++ b/frida_mode/test/fasan/GNUmakefile
@@ -42,7 +42,7 @@ ifeq "$(ARCH)" "x86"
 LIBASAN_FILE:=libclang_rt.asan-i386.so
 endif
 
-ifeq "$(ARCH)" "x64"
+ifeq "$(ARCH)" "x86_64"
 LIBASAN_FILE:=libclang_rt.asan-x86_64.so
 endif
 
@@ -85,12 +85,15 @@ else
 endif
 
 
-.PHONY: all clean format frida-noasan frida debug run
+.PHONY: all 32 clean format frida-noasan frida debug run
 
 ############################## ALL #############################################
 
 all: $(TEST_BIN)
 
+32:
+	CFLAGS="-m32" LDFLAGS="-m32" ARCH="x86" make all
+
 $(TEST_BIN): $(TEST_SRC) GNUmakefile | $(BUILD_DIR)
 	$(CC) \
 		$(CFLAGS) \
@@ -120,7 +123,7 @@ frida-noasan: $(TEST_BIN) $(TEST_DATA_FILE)
 
 
 frida: $(TEST_BIN) $(TEST_DATA_FILE)
-	AFL_PRELOAD=/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.so \
+	AFL_PRELOAD=$(LIBASAN) \
 	AFL_USE_FASAN=1 \
 	$(ROOT)afl-fuzz \
 		-D \
diff --git a/frida_mode/test/fasan/Makefile b/frida_mode/test/fasan/Makefile
index a7bf44c7..3b4c71db 100644
--- a/frida_mode/test/fasan/Makefile
+++ b/frida_mode/test/fasan/Makefile
@@ -2,6 +2,10 @@ all:
 	@echo trying to use GNU make...
 	@gmake all || echo please install GNUmake
 
+32:
+	@echo trying to use GNU make...
+	@gmake 32 || echo please install GNUmake
+
 clean:
 	@gmake clean
 
@@ -15,4 +19,4 @@ debug:
 	@gmake debug
 
 run:
-	@gmake run
\ No newline at end of file
+	@gmake run
diff --git a/frida_mode/test/fasan/test.c b/frida_mode/test/fasan/test.c
index a7d03017..b9a119e6 100644
--- a/frida_mode/test/fasan/test.c
+++ b/frida_mode/test/fasan/test.c
@@ -5,6 +5,8 @@
 #include <string.h>
 #include <unistd.h>
 
+#define UNUSED_PARAMETER(x) (void)(x)
+
 #define LOG(x)                              \
   do {                                      \
                                             \
@@ -67,6 +69,9 @@ void test(char data) {
 
 int main(int argc, char **argv) {
 
+  UNUSED_PARAMETER(argc);
+  UNUSED_PARAMETER(argv);
+
   char input = '\0';
 
   if (read(STDIN_FILENO, &input, 1) < 0) {