include and src folders

This commit is contained in:
Andrea Fioraldi
2019-08-27 13:31:35 +02:00
parent d3d0682310
commit 0e59a59169
22 changed files with 37 additions and 37 deletions

View File

@ -17,7 +17,7 @@
#TEST_MMAP=1 #TEST_MMAP=1
PROGNAME = afl PROGNAME = afl
VERSION = $(shell grep '^\#define VERSION ' config.h | cut -d '"' -f2) VERSION = $(shell grep '^\#define VERSION ' include/config.h | cut -d '"' -f2)
PREFIX ?= /usr/local PREFIX ?= /usr/local
BIN_PATH = $(PREFIX)/bin BIN_PATH = $(PREFIX)/bin
@ -31,7 +31,7 @@ PROGS = afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze
SH_PROGS = afl-plot afl-cmin afl-whatsup afl-system-config SH_PROGS = afl-plot afl-cmin afl-whatsup afl-system-config
CFLAGS ?= -O3 -funroll-loops CFLAGS ?= -O3 -funroll-loops
CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \ CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -I include/ \
-DAFL_PATH=\"$(HELPER_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" \ -DAFL_PATH=\"$(HELPER_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" \
-DBIN_PATH=\"$(BIN_PATH)\" -DBIN_PATH=\"$(BIN_PATH)\"
@ -47,7 +47,7 @@ else
TEST_CC = afl-clang TEST_CC = afl-clang
endif endif
COMM_HDR = alloc-inl.h config.h debug.h types.h COMM_HDR = include/alloc-inl.h include/config.h include/debug.h include/types.h
ifeq "$(shell echo '\#include <Python.h>@int main() {return 0; }' | tr @ '\n' | $(CC) -x c - -o .test -I$(PYTHON_INCLUDE) -lpython2.7 2>/dev/null && echo 1 || echo 0 )" "1" ifeq "$(shell echo '\#include <Python.h>@int main() {return 0; }' | tr @ '\n' | $(CC) -x c - -o .test -I$(PYTHON_INCLUDE) -lpython2.7 2>/dev/null && echo 1 || echo 0 )" "1"
@ -123,37 +123,37 @@ endif
ready: ready:
@echo "[+] Everything seems to be working, ready to compile." @echo "[+] Everything seems to be working, ready to compile."
afl-gcc: afl-gcc.c $(COMM_HDR) | test_x86 afl-gcc: src/afl-gcc.c $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS) $(CC) $(CFLAGS) src/$@.c -o $@ $(LDFLAGS)
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $$i; done set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $$i; done
afl-as: afl-as.c afl-as.h $(COMM_HDR) | test_x86 afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS) $(CC) $(CFLAGS) src/$@.c -o $@ $(LDFLAGS)
ln -sf afl-as as ln -sf afl-as as
afl-common.o : afl-common.c afl-common.o : src/afl-common.c include/common.h
$(CC) $(CFLAGS) -c afl-common.c $(CC) $(CFLAGS) -c src/afl-common.c
afl-forkserver.o : afl-forkserver.c afl-forkserver.o : src/afl-forkserver.c include/forkserver.h
$(CC) $(CFLAGS) -c afl-forkserver.c $(CC) $(CFLAGS) -c src/afl-forkserver.c
afl-sharedmem.o : afl-sharedmem.c afl-sharedmem.o : src/afl-sharedmem.c include/sharedmem.h
$(CC) $(CFLAGS) -c afl-sharedmem.c $(CC) $(CFLAGS) -c src/afl-sharedmem.c
afl-fuzz: afl-fuzz.c afl-common.o afl-sharedmem.o afl-forkserver.o $(COMM_HDR) | test_x86 afl-fuzz: src/afl-fuzz.c afl-common.o afl-sharedmem.o afl-forkserver.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o afl-sharedmem.o afl-forkserver.o -o $@ $(LDFLAGS) $(PYFLAGS) $(CC) $(CFLAGS) src/$@.c afl-common.o afl-sharedmem.o afl-forkserver.o -o $@ $(LDFLAGS) $(PYFLAGS)
afl-showmap: afl-showmap.c afl-common.o afl-sharedmem.o $(COMM_HDR) | test_x86 afl-showmap: src/afl-showmap.c afl-common.o afl-sharedmem.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o afl-sharedmem.o -o $@ $(LDFLAGS) $(CC) $(CFLAGS) src/$@.c afl-common.o afl-sharedmem.o -o $@ $(LDFLAGS)
afl-tmin: afl-tmin.c afl-common.o afl-sharedmem.o afl-forkserver.o $(COMM_HDR) | test_x86 afl-tmin: src/afl-tmin.c afl-common.o afl-sharedmem.o afl-forkserver.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o afl-sharedmem.o afl-forkserver.o -o $@ $(LDFLAGS) $(CC) $(CFLAGS) src/$@.c afl-common.o afl-sharedmem.o afl-forkserver.o -o $@ $(LDFLAGS)
afl-analyze: afl-analyze.c afl-common.o afl-sharedmem.o $(COMM_HDR) | test_x86 afl-analyze: src/afl-analyze.c afl-common.o afl-sharedmem.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o afl-sharedmem.o -o $@ $(LDFLAGS) $(CC) $(CFLAGS) src/$@.c afl-common.o afl-sharedmem.o -o $@ $(LDFLAGS)
afl-gotcpu: afl-gotcpu.c $(COMM_HDR) | test_x86 afl-gotcpu: src/afl-gotcpu.c $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS) $(CC) $(CFLAGS) src/$@.c -o $@ $(LDFLAGS)
ifndef AFL_NO_X86 ifndef AFL_NO_X86

2
TODO
View File

@ -68,5 +68,5 @@ Problem: Average targets (tiff, jpeg, unrar) go through 1500 edges.
qemu_mode: qemu_mode:
- persistent mode patching the return address (WinAFL style) - persistent mode patching the return address (WinAFL style)
- instrument only comparison with immediate values by default when using compcov - instrument only comparison with immediate values by default when using compcov (done)

View File

@ -26,8 +26,8 @@
#include "debug.h" #include "debug.h"
#include "alloc-inl.h" #include "alloc-inl.h"
#include "hash.h" #include "hash.h"
#include "afl-sharedmem.h" #include "sharedmem.h"
#include "afl-common.h" #include "common.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -35,7 +35,7 @@
#include "debug.h" #include "debug.h"
#include "alloc-inl.h" #include "alloc-inl.h"
#include "afl-as.h" #include "as.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -1,7 +1,7 @@
#include "config.h" #include "config.h"
#include "types.h" #include "types.h"
#include "debug.h" #include "debug.h"
#include "afl-forkserver.h" #include "forkserver.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -33,9 +33,9 @@
#include "debug.h" #include "debug.h"
#include "alloc-inl.h" #include "alloc-inl.h"
#include "hash.h" #include "hash.h"
#include "afl-sharedmem.h" #include "sharedmem.h"
#include "afl-forkserver.h" #include "forkserver.h"
#include "afl-common.h" #include "common.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -9,7 +9,7 @@
#include "debug.h" #include "debug.h"
#include "alloc-inl.h" #include "alloc-inl.h"
#include "hash.h" #include "hash.h"
#include "afl-sharedmem.h" #include "sharedmem.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -28,8 +28,8 @@
#include "debug.h" #include "debug.h"
#include "alloc-inl.h" #include "alloc-inl.h"
#include "hash.h" #include "hash.h"
#include "afl-sharedmem.h" #include "sharedmem.h"
#include "afl-common.h" #include "common.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -27,9 +27,9 @@
#include "debug.h" #include "debug.h"
#include "alloc-inl.h" #include "alloc-inl.h"
#include "hash.h" #include "hash.h"
#include "afl-forkserver.h" #include "forkserver.h"
#include "afl-sharedmem.h" #include "sharedmem.h"
#include "afl-common.h" #include "common.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>