Fix broken test configuration
MODIFY
frida_mode/test/freetype2/GNUmakefile
frida_mode/test/freetype2/GNUmakefile
@@ -47,6 +47,7 @@ endif
TEST_DATA_DIR:=$(BUILD_DIR)in/
TEST_DATA_FILE:=$(TEST_DATA_DIR)default_seed
+AFLPP_DRIVER_DUMMY_INPUT:=$(BUILD_DIR)dummy.dat
FRIDA_OUT:=$(BUILD_DIR)frida-out
QEMU_OUT:=$(BUILD_DIR)qemu-out
@@ -154,6 +155,9 @@ $(TEST_DATA_DIR): | $(TRT_DIR)
cp $(TRT_DIR)fonts/TestGLYFOne.ttf $@
$(TEST_DATA_FILE): | $(TEST_DATA_DIR)
+ echo "hi" > $@
+
+$(AFLPP_DRIVER_DUMMY_INPUT): | $(BUILD_DIR)
dd if=/dev/zero bs=1048576 count=1 of=$@
###### TEST DATA #######
@@ -161,7 +165,7 @@ $(TEST_DATA_FILE): | $(TEST_DATA_DIR)
clean:
rm -rf $(BUILD_DIR)
-frida: $(TEST_BIN) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE)
+frida: $(TEST_BIN) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(AFLPP_DRIVER_DUMMY_INPUT)
AFL_FRIDA_PERSISTENT_CNT=1000000 \
AFL_FRIDA_PERSISTENT_HOOK=$(AFLPP_FRIDA_DRIVER_HOOK_OBJ) \
AFL_FRIDA_PERSISTENT_ADDR=$(AFL_FRIDA_PERSISTENT_ADDR) \
@@ -174,9 +178,9 @@ frida: $(TEST_BIN) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE)
-O \
-V 30 \
-- \
- $(TEST_BIN) $(TEST_DATA_FILE)
+ $(TEST_BIN) $(AFLPP_DRIVER_DUMMY_INPUT)
-qemu: $(TEST_BIN) $(AFLPP_QEMU_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE)
+qemu: $(TEST_BIN) $(AFLPP_QEMU_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(AFLPP_DRIVER_DUMMY_INPUT)
AFL_QEMU_PERSISTENT_CNT=1000000 \
AFL_QEMU_PERSISTENT_HOOK=$(AFLPP_QEMU_DRIVER_HOOK_OBJ) \
AFL_QEMU_PERSISTENT_ADDR=$(AFL_QEMU_PERSISTENT_ADDR) \
@@ -189,4 +193,4 @@ qemu: $(TEST_BIN) $(AFLPP_QEMU_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE)
-Q \
-V 30 \
-- \
- $(TEST_BIN) $(TEST_DATA_FILE)
+ $(TEST_BIN) $(AFLPP_DRIVER_DUMMY_INPUT)

MODIFY
frida_mode/test/libxml/GNUmakefile
frida_mode/test/libxml/GNUmakefile
@@ -134,7 +134,7 @@ $(TEST_DATA_DIR): | $(BUILD_DIR)
mkdir -p $@
$(TEST_DATA_FILE): | $(TEST_DATA_DIR)
- dd if=/dev/zero bs=1048576 count=1 of=$@
+ echo "hi" > $@
###### #######

MODIFY
frida_mode/test/perf/GNUmakefile
frida_mode/test/perf/GNUmakefile
@@ -14,6 +14,10 @@ FRIDA_OUT:=$(BUILD_DIR)frida-out
AFLPP_FRIDA_DRIVER_HOOK_OBJ=$(ROOT)frida_mode/build/frida_hook.so
AFLPP_QEMU_DRIVER_HOOK_OBJ=$(ROOT)frida_mode/build/qemu_hook.so
+AFLPP_DRIVER_DUMMY_INPUT:=$(BUILD_DIR)dummy.dat
+QEMU_OUT:=$(BUILD_DIR)qemu-out
+FRIDA_OUT:=$(BUILD_DIR)frida-out
+
ifndef ARCH
ARCH=$(shell uname -m)
@@ -70,10 +74,13 @@ $(TEST_DATA_DIR): | $(BUILD_DIR)
mkdir -p $@
$(TEST_DATA_FILE): | $(TEST_DATA_DIR)
+ echo "hi" > $@
+
+$(AFLPP_DRIVER_DUMMY_INPUT): | $(BUILD_DIR)
dd if=/dev/zero bs=1048576 count=1 of=$@
-qemu: $(TEST_BIN) $(TEST_DATA_FILE)
+qemu: $(TEST_BIN) $(TEST_DATA_FILE) $(AFLPP_DRIVER_DUMMY_INPUT)
AFL_QEMU_PERSISTENT_CNT=1000000 \
AFL_QEMU_PERSISTENT_HOOK=$(AFLPP_QEMU_DRIVER_HOOK_OBJ) \
AFL_QEMU_PERSISTENT_ADDR=$(AFL_QEMU_PERSISTENT_ADDR) \
@@ -86,9 +93,9 @@ qemu: $(TEST_BIN) $(TEST_DATA_FILE)
-o $(QEMU_OUT) \
-V 10 \
-- \
- $(TEST_BIN) $(TEST_DATA_FILE)
+ $(TEST_BIN) $(AFLPP_DRIVER_DUMMY_INPUT)
-frida: $(TEST_BIN) $(TEST_DATA_FILE)
+frida: $(TEST_BIN) $(TEST_DATA_FILE) $(AFLPP_DRIVER_DUMMY_INPUT)
AFL_FRIDA_PERSISTENT_CNT=1000000 \
AFL_FRIDA_PERSISTENT_HOOK=$(AFLPP_FRIDA_DRIVER_HOOK_OBJ) \
AFL_FRIDA_PERSISTENT_ADDR=$(AFL_FRIDA_PERSISTENT_ADDR) \
@@ -98,9 +105,9 @@ frida: $(TEST_BIN) $(TEST_DATA_FILE)
-O \
-i $(TEST_DATA_DIR) \
-o $(FRIDA_OUT) \
- -V 10 \
+ -t 1000+ \
-- \
- $(TEST_BIN) $(TEST_DATA_FILE)
+ $(TEST_BIN) $(AFLPP_DRIVER_DUMMY_INPUT)
debug:
echo $(AFL_FRIDA_PERSISTENT_ADDR)

MODIFY
frida_mode/test/vorbis/GNUmakefile
frida_mode/test/vorbis/GNUmakefile
@@ -36,8 +36,8 @@ endif
TEST_DATA_DIR:=$(BUILD_DIR)in/
TEST_DATA_SRC:=https://github.com/google/fuzzbench/blob/master/benchmarks/vorbis-2017-12-11/seeds/sound.ogg?raw=true
TEST_DATA_FILE:=$(TEST_DATA_DIR)sound.ogg
-DUMMY_DATA_FILE:=$(BUILD_DIR)default_seed
+AFLPP_DRIVER_DUMMY_INPUT:=$(BUILD_DIR)dummy.dat
FRIDA_OUT:=$(BUILD_DIR)frida-out
QEMU_OUT:=$(BUILD_DIR)qemu-out
@@ -158,18 +158,18 @@ $(TEST_BIN): $(VORBIS_LIB) $(OGG_LIB) $(HARNESS_OBJ) $(DECODE_OBJ)
$(TEST_DATA_DIR): | $(BUILD_DIR)
mkdir -p $@
-$(DUMMY_DATA_FILE): | $(TEST_DATA_DIR)
+$(AFLPP_DRIVER_DUMMY_INPUT): | $(BUILD_DIR)
dd if=/dev/zero bs=1048576 count=1 of=$@
###### TEST DATA #######
-$(TEST_DATA_FILE):
+$(TEST_DATA_FILE): $(TEST_DATA_DIR)
wget -O $@ $(TEST_DATA_SRC)
clean:
rm -rf $(BUILD_DIR)
-frida: $(TEST_BIN) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(DUMMY_DATA_FILE)
+frida: $(TEST_BIN) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(AFLPP_DRIVER_DUMMY_INPUT)
AFL_FRIDA_PERSISTENT_CNT=1000000 \
AFL_FRIDA_PERSISTENT_HOOK=$(AFLPP_FRIDA_DRIVER_HOOK_OBJ) \
AFL_FRIDA_PERSISTENT_ADDR=$(AFL_FRIDA_PERSISTENT_ADDR) \
@@ -182,9 +182,9 @@ frida: $(TEST_BIN) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(DUMMY_DATA
-O \
-V 30 \
-- \
- $(TEST_BIN) $(DUMMY_DATA_FILE)
+ $(TEST_BIN) $(AFLPP_DRIVER_DUMMY_INPUT)
-qemu: $(TEST_BIN) $(AFLPP_QEMU_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(DUMMY_DATA_FILE)
+qemu: $(TEST_BIN) $(AFLPP_QEMU_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(AFLPP_DRIVER_DUMMY_INPUT)
AFL_QEMU_PERSISTENT_CNT=1000000 \
AFL_QEMU_PERSISTENT_HOOK=$(AFLPP_QEMU_DRIVER_HOOK_OBJ) \
AFL_QEMU_PERSISTENT_ADDR=$(AFL_QEMU_PERSISTENT_ADDR) \
@@ -197,4 +197,4 @@ qemu: $(TEST_BIN) $(AFLPP_QEMU_DRIVER_HOOK_OBJ) $(TEST_DATA_FILE) $(DUMMY_DATA_F
-Q \
-V 30 \
-- \
- $(TEST_BIN) $(DUMMY_DATA_FILE)
+ $(TEST_BIN) $(AFLPP_DRIVER_DUMMY_INPUT)

Fix broken test configuration