diff options
Diffstat (limited to 'qemu_mode')
-rwxr-xr-x | qemu_mode/build_qemu_support.sh | 28 | ||||
-rw-r--r-- | qemu_mode/patches/afl-qemu-tcg-runtime-inl.h | 4 |
2 files changed, 22 insertions, 10 deletions
diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh index 09c04e7f..bd42c58e 100755 --- a/qemu_mode/build_qemu_support.sh +++ b/qemu_mode/build_qemu_support.sh @@ -62,15 +62,15 @@ if [ ! -f "../afl-showmap" ]; then fi +PREREQ_NOTFOUND= +for i in libtool wget python automake autoconf sha384sum bison flex iconv patch pkg-config; do -for i in libtool wget python automake autoconf sha384sum bison iconv; do - - T=`which "$i" 2>/dev/null` + T=`command -v "$i" 2>/dev/null` if [ "$T" = "" ]; then echo "[-] Error: '$i' not found, please install first." - exit 1 + PREREQ_NOTFOUND=1 fi @@ -79,17 +79,21 @@ done if [ ! -d "/usr/include/glib-2.0/" -a ! -d "/usr/local/include/glib-2.0/" ]; then echo "[-] Error: devel version of 'glib2' not found, please install first." - exit 1 + PREREQ_NOTFOUND=1 fi if echo "$CC" | grep -qF /afl-; then echo "[-] Error: do not use afl-gcc or afl-clang to compile this tool." - exit 1 + PREREQ_NOTFOUND=1 fi +if [ "$PREREQ_NOTFOUND" = "1" ]; then + exit 1 +fi + echo "[+] All checks passed!" ARCHIVE="`basename -- "$QEMU_URL"`" @@ -139,8 +143,16 @@ echo "[*] Configuring QEMU for $CPU_TARGET..." ORIG_CPU_TARGET="$CPU_TARGET" -test "$CPU_TARGET" = "" && CPU_TARGET="`uname -m`" -test "$CPU_TARGET" = "i686" && CPU_TARGET="i386" +if [ "$ORIG_CPU_TARGET" = "" ]; then + CPU_TARGET="`uname -m`" + test "$CPU_TARGET" = "i686" && CPU_TARGET="i386" + test "$CPU_TARGET" = "arm64v8" && CPU_TARGET="aarch64" + case "$CPU_TARGET" in + *arm*) + CPU_TARGET="arm" + ;; + esac +fi cd qemu-$VERSION || exit 1 diff --git a/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h b/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h index b7cd71bb..1526f09c 100644 --- a/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h +++ b/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h @@ -185,8 +185,8 @@ void HELPER(afl_cmplog_rtn)(CPUArchState *env) { if (!area_is_mapped(stack, sizeof(target_ulong) * 2)) return; // when this hook is executed, the retaddr is not on stack yet - void *ptr1 = g2h(stack[0]); - void *ptr2 = g2h(stack[1]); + void * ptr1 = g2h(stack[0]); + void * ptr2 = g2h(stack[1]); #else |