From d04bdf2e841fa6706c16bbba1cb6f6c73d647767 Mon Sep 17 00:00:00 2001 From: Huanyao Rong Date: Fri, 21 Jun 2024 21:03:37 -0700 Subject: Implement AFLRun References: https://github.com/Mem2019/AFLRun/commit/f5bb87f78ef1 References: https://github.com/Mem2019/AFLRun/commit/3af5f11b5644 --- custom_mutators/afl/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 custom_mutators/afl/Makefile (limited to 'custom_mutators/afl/Makefile') diff --git a/custom_mutators/afl/Makefile b/custom_mutators/afl/Makefile new file mode 100644 index 00000000..fc656e8e --- /dev/null +++ b/custom_mutators/afl/Makefile @@ -0,0 +1,28 @@ +PREFIX ?= /usr/local +BIN_PATH = $(PREFIX)/bin +HELPER_PATH = $(PREFIX)/lib/afl +DOC_PATH = $(PREFIX)/share/doc/afl + +CFLAGS ?= -O3 -funroll-loops +CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \ + -DAFL_PATH=\"$(HELPER_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" \ + -DBIN_PATH=\"$(BIN_PATH)\" + +ifneq "$(filter Linux GNU%,$(shell uname))" "" + LDFLAGS += -ldl -lm +endif + +COMM_HDR = alloc-inl.h config.h debug.h types.h + +all: afl-mutator.so havoc +clean: + rm -rf *.o *.so havoc + +afl-mutator.so.o: afl-mutator.so.c $(COMM_HDR) + $(CC) -fPIC $(CFLAGS) -c afl-mutator.so.c -o $@ + +afl-mutator.so: afl-mutator.so.o + $(CC) -shared -fPIC $(CFLAGS) $@.o -o $@ $(LDFLAGS) + +havoc: havoc.c $(COMM_HDR) afl-mutator.so.o + $(CC) $(CFLAGS) $@.c afl-mutator.so.o -o $@ $(LDFLAGS) \ No newline at end of file -- cgit v1.2.3