diff options
author | vanhauser-thc <vh@thc.org> | 2021-07-26 10:23:00 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2021-07-26 10:29:47 +0200 |
commit | 30679edc1a3c04f386bfb96af33c65c0b818e9b8 (patch) | |
tree | 01de82855b855446b8ea79367297faccf28f8b4e | |
parent | dc16d8d998a8fb3a2c6942858cca3b326c28154a (diff) | |
download | afl++-30679edc1a3c04f386bfb96af33c65c0b818e9b8.tar.gz |
fix gramatron
-rwxr-xr-x | custom_mutators/gramatron/build_gramatron_mutator.sh | 29 | ||||
-rw-r--r-- | custom_mutators/gramatron/gramfuzz.c | 2 |
2 files changed, 20 insertions, 11 deletions
diff --git a/custom_mutators/gramatron/build_gramatron_mutator.sh b/custom_mutators/gramatron/build_gramatron_mutator.sh index c1cdf0e7..b6654632 100755 --- a/custom_mutators/gramatron/build_gramatron_mutator.sh +++ b/custom_mutators/gramatron/build_gramatron_mutator.sh @@ -49,6 +49,13 @@ if [ ! -f "../../config.h" ]; then fi +if [ ! -f "../../src/afl-performance.o" ]; then + + echo "[-] Error: you must build afl-fuzz first and not do a \"make clean\"" + exit 1 + +fi + PYTHONBIN=`command -v python3 || command -v python || command -v python2 || echo python3` MAKECMD=make TARCMD=tar @@ -121,20 +128,22 @@ fi test -d json-c || { echo "[-] not checked out, please install git or check your internet connection." ; exit 1 ; } echo "[+] Got json-c." -cd "json-c" || exit 1 -echo "[*] Checking out $JSONC_VERSION" -sh -c 'git stash && git stash drop' 1>/dev/null 2>/dev/null -git checkout "$JSONC_VERSION" || exit 1 -sh autogen.sh || exit 1 -export CFLAGS=-fPIC -./configure --disable-shared || exit 1 -make || exit 1 -cd .. +test -e json-c/.libs/libjson-c.a || { + cd "json-c" || exit 1 + echo "[*] Checking out $JSONC_VERSION" + sh -c 'git stash && git stash drop' 1>/dev/null 2>/dev/null + git checkout "$JSONC_VERSION" || exit 1 + sh autogen.sh || exit 1 + export CFLAGS=-fPIC + ./configure --disable-shared || exit 1 + make || exit 1 + cd .. +} echo echo echo "[+] Json-c successfully prepared!" echo "[+] Builing gramatron now." -$CC -O3 -g -fPIC -Wno-unused-result -Wl,--allow-multiple-definition -I../../include -o gramatron.so -shared -I. -I/prg/dev/include gramfuzz.c gramfuzz-helpers.c gramfuzz-mutators.c gramfuzz-util.c hashmap.c json-c/.libs/libjson-c.a || exit 1 +$CC -O3 -g -fPIC -Wno-unused-result -Wl,--allow-multiple-definition -I../../include -o gramatron.so -shared -I. -I/prg/dev/include gramfuzz.c gramfuzz-helpers.c gramfuzz-mutators.c gramfuzz-util.c hashmap.c ../../src/afl-performance.o json-c/.libs/libjson-c.a || exit 1 echo echo "[+] gramatron successfully built!" diff --git a/custom_mutators/gramatron/gramfuzz.c b/custom_mutators/gramatron/gramfuzz.c index d64d2fa9..5f6906bd 100644 --- a/custom_mutators/gramatron/gramfuzz.c +++ b/custom_mutators/gramatron/gramfuzz.c @@ -168,7 +168,7 @@ my_mutator_t *afl_custom_init(afl_state_t *afl, unsigned int seed) { fprintf(stderr, "\nError: GrammaTron needs an automation json file set in " - "AFL_GRAMATRON_AUTOMATON\n"); + "GRAMATRON_AUTOMATION\n"); exit(-1); } |