move libdislocator, libtokencap and qbdi_mode to utils/
diff --git a/GNUmakefile b/GNUmakefile
index 309a7d4..de398ed 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -493,8 +493,6 @@
code-format:
./.custom-format.py -i src/*.c
./.custom-format.py -i include/*.h
- ./.custom-format.py -i libdislocator/*.c
- ./.custom-format.py -i libtokencap/*.c
./.custom-format.py -i instrumentation/*.h
./.custom-format.py -i instrumentation/*.cc
./.custom-format.py -i instrumentation/*.c
@@ -545,8 +543,8 @@
rm -f $(PROGS) libradamsa.so afl-fuzz-document afl-as as afl-g++ afl-clang afl-clang++ *.o src/*.o *~ a.out core core.[1-9][0-9]* *.stackdump .test .test1 .test2 test-instr .test-instr0 .test-instr1 afl-qemu-trace afl-gcc-fast afl-gcc-pass.so afl-g++-fast ld *.so *.8 test/unittests/*.o test/unittests/unit_maybe_alloc test/unittests/preallocable .afl-* afl-gcc afl-g++ afl-clang afl-clang++ test/unittests/unit_hash test/unittests/unit_rand
-$(MAKE) -f GNUmakefile.llvm clean
-$(MAKE) -f GNUmakefile.gcc_plugin clean
- $(MAKE) -C libdislocator clean
- $(MAKE) -C libtokencap clean
+ $(MAKE) -C utils/libdislocator clean
+ $(MAKE) -C utils/libtokencap clean
$(MAKE) -C utils/afl_network_proxy clean
$(MAKE) -C utils/socket_fuzzing clean
$(MAKE) -C utils/argv_fuzzing clean
@@ -570,8 +568,8 @@
distrib: all
-$(MAKE) -f GNUmakefile.llvm
-$(MAKE) -f GNUmakefile.gcc_plugin
- $(MAKE) -C libdislocator
- $(MAKE) -C libtokencap
+ $(MAKE) -C utils/libdislocator
+ $(MAKE) -C utils/libtokencap
$(MAKE) -C utils/aflpp_driver
$(MAKE) -C utils/afl_network_proxy
$(MAKE) -C utils/socket_fuzzing
@@ -581,8 +579,8 @@
.PHONY: binary-only
binary-only: all
- $(MAKE) -C libdislocator
- $(MAKE) -C libtokencap
+ $(MAKE) -C utils/libdislocator
+ $(MAKE) -C utils/libtokencap
$(MAKE) -C utils/afl_network_proxy
$(MAKE) -C utils/socket_fuzzing
$(MAKE) -C utils/argv_fuzzing
@@ -593,8 +591,8 @@
source-only: all
-$(MAKE) -f GNUmakefile.llvm
-$(MAKE) -f GNUmakefile.gcc_plugin
- $(MAKE) -C libdislocator
- $(MAKE) -C libtokencap
+ $(MAKE) -C utils/libdislocator
+ $(MAKE) -C utils/libtokencap
$(MAKE) -C utils/aflpp_driver
%.8: %
diff --git a/README.md b/README.md
index 94d5008..16c85e2 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,7 @@
editing config.h for TESTCASE_CACHE or by specifying the env variable
`AFL_TESTCACHE_SIZE` (in MB). Good values are between 50-500 (default: 50).
* examples/ got renamed to utils/
+ * libtokencap/ libdislocator/ and qdbi_mode/ were moved to utils/
## Contents
@@ -547,7 +548,7 @@
that dictionary by adding `-x dictionaries/FORMAT.dict`. With afl-clang-lto
you have an autodictionary generation for which you need to do nothing except
to use afl-clang-lto as the compiler. You also have the option to generate
-a dictionary yourself, see [libtokencap/README.md](libtokencap/README.md).
+a dictionary yourself, see [utils/libtokencap/README.md](utils/libtokencap/README.md).
afl-fuzz has a variety of options that help to workaround target quirks like
specific locations for the input file (`-f`), not performing deterministic
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 5201eb8..1a47d18 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -12,6 +12,7 @@
### Version ++3.00a (develop)
- llvm_mode/ and gcc_plugin/ moved to instrumentation/
- examples/ renamed to utils/
+ - moved libdislocator, libtokencap and qdbi_mode to utils/
- all compilers combined to afl-cc which emulates the previous ones
- afl-llvm/gcc-rt.o merged into afl-compiler-rt.o
- afl-fuzz
diff --git a/docs/life_pro_tips.md b/docs/life_pro_tips.md
index 77845c6..50ad75d 100644
--- a/docs/life_pro_tips.md
+++ b/docs/life_pro_tips.md
@@ -13,7 +13,7 @@
## Improve the odds of spotting memory corruption bugs with libdislocator.so!
-It's easy. Consult [libdislocator/README.md](../libdislocator/README.md) for usage tips.
+It's easy. Consult [utils/libdislocator/README.md](../utils/libdislocator/README.md) for usage tips.
## Want to understand how your target parses a particular input file?
diff --git a/docs/notes_for_asan.md b/docs/notes_for_asan.md
index f08ae3f..2b3bc02 100644
--- a/docs/notes_for_asan.md
+++ b/docs/notes_for_asan.md
@@ -35,7 +35,7 @@
There is also the option of generating a corpus using a non-ASAN binary, and
then feeding it to an ASAN-instrumented one to check for bugs. This is faster,
and can give you somewhat comparable results. You can also try using
-libdislocator (see libdislocator/README.dislocator.md in the parent directory) as a
+libdislocator (see [utils/libdislocator/README.dislocator.md](../utils/libdislocator/README.dislocator.md) in the parent directory) as a
lightweight and hassle-free (but less thorough) alternative.
## 2) Long version
diff --git a/libdislocator/Makefile b/utils/libdislocator/Makefile
similarity index 72%
rename from libdislocator/Makefile
rename to utils/libdislocator/Makefile
index 1c2fcaa..2942c3c 100644
--- a/libdislocator/Makefile
+++ b/utils/libdislocator/Makefile
@@ -16,28 +16,28 @@
PREFIX ?= /usr/local
HELPER_PATH = $(PREFIX)/lib/afl
-VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
+VERSION = $(shell grep '^\#define VERSION ' ../../config.h | cut -d '"' -f2)
CFLAGS ?= -O3 -funroll-loops -D_FORTIFY_SOURCE=2
-CFLAGS += -I ../include/ -Wall -g -Wno-pointer-sign
+CFLAGS += -I ../../include/ -Wall -g -Wno-pointer-sign
CFLAGS_ADD=$(USEHUGEPAGE:1=-DUSEHUGEPAGE)
CFLAGS += $(CFLAGS_ADD)
all: libdislocator.so
-VPATH = ..
-libdislocator.so: libdislocator.so.c ../config.h
- $(CC) $(CFLAGS) $(CPPFLAGS) -shared -fPIC libdislocator.so.c -o ../$@ $(LDFLAGS)
+libdislocator.so: libdislocator.so.c ../../config.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -shared -fPIC libdislocator.so.c -o $@ $(LDFLAGS)
+ cp -fv libdislocator.so ../../
.NOTPARALLEL: clean
clean:
rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
- rm -f ../libdislocator.so
+ rm -f ../../libdislocator.so
install: all
install -m 755 -d $${DESTDIR}$(HELPER_PATH)
- install -m 755 ../libdislocator.so $${DESTDIR}$(HELPER_PATH)
+ install -m 755 ../../libdislocator.so $${DESTDIR}$(HELPER_PATH)
install -m 644 -T README.md $${DESTDIR}$(HELPER_PATH)/README.dislocator.md
diff --git a/libdislocator/README.md b/utils/libdislocator/README.md
similarity index 100%
rename from libdislocator/README.md
rename to utils/libdislocator/README.md
diff --git a/libdislocator/libdislocator.so.c b/utils/libdislocator/libdislocator.so.c
similarity index 100%
rename from libdislocator/libdislocator.so.c
rename to utils/libdislocator/libdislocator.so.c
diff --git a/libtokencap/Makefile b/utils/libtokencap/Makefile
similarity index 87%
rename from libtokencap/Makefile
rename to utils/libtokencap/Makefile
index 2343125..8bbdc25 100644
--- a/libtokencap/Makefile
+++ b/utils/libtokencap/Makefile
@@ -18,10 +18,10 @@
DOC_PATH ?= $(PREFIX)/share/doc/afl
MAN_PATH ?= $(PREFIX)/share/man/man8
-VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
+VERSION = $(shell grep '^\#define VERSION ' ../../config.h | cut -d '"' -f2)
CFLAGS ?= -O3 -funroll-loops -D_FORTIFY_SOURCE=2
-CFLAGS += -I ../include/ -Wall -g -Wno-pointer-sign
+CFLAGS += -I ../../include/ -Wall -g -Wno-pointer-sign
UNAME_S =$(shell uname -s)# GNU make
@@ -68,9 +68,9 @@
#endif
all: $(TARGETS)
-VPATH = ..
-libtokencap.so: libtokencap.so.c ../config.h
- $(CC) $(CFLAGS) $(CPPFLAGS) -shared -fPIC $< -o ../$@ $(LDFLAGS)
+libtokencap.so: libtokencap.so.c ../../config.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -shared -fPIC $< -o $@ $(LDFLAGS)
+ cp -f libtokencap.so ../../
.NOTPARALLEL: clean
@@ -86,9 +86,9 @@
clean:
rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
- rm -f ../libtokencap.so
+ rm -fv ../../libtokencap.so
install: all
install -m 755 -d $${DESTDIR}$(HELPER_PATH)
- install -m 755 ../libtokencap.so $${DESTDIR}$(HELPER_PATH)
+ install -m 755 ../../libtokencap.so $${DESTDIR}$(HELPER_PATH)
install -m 644 -T README.md $${DESTDIR}$(DOC_PATH)/README.tokencap.md
diff --git a/libtokencap/README.md b/utils/libtokencap/README.md
similarity index 100%
rename from libtokencap/README.md
rename to utils/libtokencap/README.md
diff --git a/libtokencap/libtokencap.so.c b/utils/libtokencap/libtokencap.so.c
similarity index 100%
rename from libtokencap/libtokencap.so.c
rename to utils/libtokencap/libtokencap.so.c
diff --git a/qbdi_mode/README.md b/utils/qbdi_mode/README.md
similarity index 100%
rename from qbdi_mode/README.md
rename to utils/qbdi_mode/README.md
diff --git a/qbdi_mode/assets/screen1.png b/utils/qbdi_mode/assets/screen1.png
similarity index 100%
rename from qbdi_mode/assets/screen1.png
rename to utils/qbdi_mode/assets/screen1.png
Binary files differ
diff --git a/qbdi_mode/build.sh b/utils/qbdi_mode/build.sh
similarity index 96%
rename from qbdi_mode/build.sh
rename to utils/qbdi_mode/build.sh
index b10971d..2527bd2 100755
--- a/qbdi_mode/build.sh
+++ b/utils/qbdi_mode/build.sh
@@ -51,7 +51,7 @@
echo "[+] Building afl-fuzz for Android"
# build afl-fuzz
-cd ..
-${compiler_prefix}${CC} -DANDROID_DISABLE_FANCY=1 -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -I include/ -DAFL_PATH=\"/usr/local/lib/afl\" -DBIN_PATH=\"/usr/local/bin\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -Wno-unused-function src/afl-fuzz-*.c src/afl-fuzz.c src/afl-common.c src/afl-sharedmem.c src/afl-forkserver.c -o qbdi_mode/afl-fuzz -ldl -w
+cd ../..
+${compiler_prefix}${CC} -DANDROID_DISABLE_FANCY=1 -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -I include/ -DAFL_PATH=\"/usr/local/lib/afl\" -DBIN_PATH=\"/usr/local/bin\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -Wno-unused-function src/afl-fuzz-*.c src/afl-fuzz.c src/afl-common.c src/afl-sharedmem.c src/afl-forkserver.c -o utils/qbdi_mode/afl-fuzz -ldl -w
echo "[+] All done. Enjoy!"
diff --git a/qbdi_mode/demo-so.c b/utils/qbdi_mode/demo-so.c
similarity index 100%
rename from qbdi_mode/demo-so.c
rename to utils/qbdi_mode/demo-so.c
diff --git a/qbdi_mode/template.cpp b/utils/qbdi_mode/template.cpp
similarity index 100%
rename from qbdi_mode/template.cpp
rename to utils/qbdi_mode/template.cpp