about summary refs log tree commit diff
path: root/frida_mode/test/testinstr
diff options
context:
space:
mode:
authorWorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com>2021-05-17 20:14:40 +0100
committerGitHub <noreply@github.com>2021-05-17 21:14:40 +0200
commitd0af55e78f85427983ddafd0af07dff654b3ea65 (patch)
treeae5dc5fc0164df2d02972322ca25fa1fca6d3893 /frida_mode/test/testinstr
parente40c0c2da16f14dfddb5641f6f825903879534a9 (diff)
downloadafl++-d0af55e78f85427983ddafd0af07dff654b3ea65.tar.gz
Support for x86 (#920)
Co-authored-by: Your Name <you@example.com>
Diffstat (limited to 'frida_mode/test/testinstr')
-rw-r--r--frida_mode/test/testinstr/GNUmakefile15
-rw-r--r--frida_mode/test/testinstr/Makefile9
2 files changed, 20 insertions, 4 deletions
diff --git a/frida_mode/test/testinstr/GNUmakefile b/frida_mode/test/testinstr/GNUmakefile
index 4addbad8..a35073ab 100644
--- a/frida_mode/test/testinstr/GNUmakefile
+++ b/frida_mode/test/testinstr/GNUmakefile
@@ -10,11 +10,14 @@ TESTINSTSRC:=$(PWD)testinstr.c
 QEMU_OUT:=$(BUILD_DIR)qemu-out
 FRIDA_OUT:=$(BUILD_DIR)frida-out
 
-.PHONY: all clean qemu frida
+.PHONY: all 32 clean qemu frida
 
 all: $(TESTINSTBIN)
 	make -C $(ROOT)frida_mode/
 
+32:
+	CFLAGS="-m32" LDFLAGS="-m32" ARCH="x86" make all
+
 $(BUILD_DIR):
 	mkdir -p $@
 
@@ -25,7 +28,7 @@ $(TESTINSTR_DATA_FILE): | $(TESTINSTR_DATA_DIR)
 	echo -n "000" > $@
 
 $(TESTINSTBIN): $(TESTINSTSRC) | $(BUILD_DIR)
-	$(CC) -o $@ $<
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
 
 clean:
 	rm -rf $(BUILD_DIR)
@@ -47,4 +50,10 @@ frida: $(TESTINSTBIN) $(TESTINSTR_DATA_FILE)
 		-i $(TESTINSTR_DATA_DIR) \
 		-o $(FRIDA_OUT) \
 		-- \
-			$(TESTINSTBIN) @@
\ No newline at end of file
+			$(TESTINSTBIN) @@
+
+debug:
+	gdb \
+		--ex 'set environment LD_PRELOAD=$(ROOT)afl-frida-trace.so' \
+		--ex 'set disassembly-flavor intel' \
+		--args $(TESTINSTBIN) $(TESTINSTR_DATA_FILE)
diff --git a/frida_mode/test/testinstr/Makefile b/frida_mode/test/testinstr/Makefile
index f322d1f5..f843af19 100644
--- a/frida_mode/test/testinstr/Makefile
+++ b/frida_mode/test/testinstr/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
 
@@ -9,4 +13,7 @@ qemu:
 	@gmake qemu
 
 frida:
-	@gmake frida
\ No newline at end of file
+	@gmake frida
+
+debug:
+	@gmake debug