fix gramatron
MODIFY
custom_mutators/gramatron/build_gramatron_mutator.sh
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,6 +128,7 @@ fi
test -d json-c || { echo "[-] not checked out, please install git or check your internet connection." ; exit 1 ; }
echo "[+] Got json-c."
+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
@@ -130,11 +138,12 @@ 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!"

MODIFY
custom_mutators/gramatron/gramfuzz.c
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);
}

fix gramatron