From cae3e48e3dd82e257cdc1739cc713b058c390b05 Mon Sep 17 00:00:00 2001 From: Anh <zenpoems@gmail.com> Date: Wed, 16 Jan 2019 18:02:35 -0800 Subject: [PATCH] Do not include afl config.h directly --- include/libzafl.hpp | 2 -- src/libzafl.c | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/libzafl.hpp b/include/libzafl.hpp index a130525..e2041cf 100644 --- a/include/libzafl.hpp +++ b/include/libzafl.hpp @@ -5,8 +5,6 @@ extern "C" { // config.h is a header from the afl distro // make sure afl has been downloaded and AFL_PATH is set properly -#include "config.h" - extern void zafl_initAflForkServer(); extern void zafl_bbInstrument(unsigned short id); diff --git a/src/libzafl.c b/src/libzafl.c index dccfd2d..7c2016f 100644 --- a/src/libzafl.c +++ b/src/libzafl.c @@ -20,6 +20,7 @@ #include <stdlib.h> +#include <stdint.h> #include <unistd.h> #include <sys/types.h> #include <sys/shm.h> @@ -27,7 +28,13 @@ #include <stdio.h> #include <string.h> -#include "config.h" +// these must match config.h in AFL source code +#define SHM_ENV_VAR "__AFL_SHM_ID" +#define FORKSRV_FD 198 +#define MAP_SIZE_POW2 16 +#define MAP_SIZE (1 << MAP_SIZE_POW2) +typedef uint8_t u8; +typedef int32_t s32; // externally visible so that Zipr transformations can access directly u8* zafl_trace_map = NULL; -- GitLab