about summary refs log tree commit diff
path: root/src/afl-common.c
diff options
context:
space:
mode:
authorrealmadsci <71108352+realmadsci@users.noreply.github.com>2021-03-15 11:45:58 -0400
committerrealmadsci <71108352+realmadsci@users.noreply.github.com>2021-03-15 13:03:16 -0700
commit01ad7610beaf772063c9011daae5fa3a3232494c (patch)
treed8718a1a23521964af1bfcbba767c1d1af8e251b /src/afl-common.c
parent01ad0f3c6a45e28eb99e7076f97af2e2a9516c45 (diff)
downloadafl++-01ad7610beaf772063c9011daae5fa3a3232494c.tar.gz
Remove AFL_PRELOAD and AFL_USE_QASAN handlers
These are now processed in afl-qemu-trace so that the "copy+paste" code
that is in all of the other AFL tools can be removed.

This also allows the AFL_USE_QASAN flag to work the same when used
with tools like afl-fuzz as it does with afl-qemu-trace. This is
important in situations where loading the QASAN library changes
the address of your desired entrypoint, or for crash validation
using the same environment that afl-fuzz was using.

With this change, the same set of environment variables can be used
in exactly the same way between afl-fuzz, afl-showmap, and
afl-qemu-trace, and you will get exactly the same guest environment.
Diffstat (limited to 'src/afl-common.c')
-rw-r--r--src/afl-common.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index 9f6eb564..5ac50595 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -338,66 +338,6 @@ char **get_wine_argv(u8 *own_loc, u8 **target_path_p, int argc, char **argv) {
 
 }
 
-/* Get libqasan path. */
-
-u8 *get_libqasan_path(u8 *own_loc) {
-
-  if (!unlikely(own_loc)) { FATAL("BUG: param own_loc is NULL"); }
-
-  u8 *tmp, *cp = NULL, *rsl, *own_copy;
-
-  tmp = getenv("AFL_PATH");
-
-  if (tmp) {
-
-    cp = alloc_printf("%s/libqasan.so", tmp);
-
-    if (access(cp, X_OK)) { FATAL("Unable to find '%s'", tmp); }
-
-    return cp;
-
-  }
-
-  own_copy = ck_strdup(own_loc);
-  rsl = strrchr(own_copy, '/');
-
-  if (rsl) {
-
-    *rsl = 0;
-
-    cp = alloc_printf("%s/libqasan.so", own_copy);
-    ck_free(own_copy);
-
-    if (!access(cp, X_OK)) { return cp; }
-
-  } else {
-
-    ck_free(own_copy);
-
-  }
-
-  if (!access(AFL_PATH "/libqasan.so", X_OK)) {
-
-    if (cp) { ck_free(cp); }
-
-    return ck_strdup(AFL_PATH "/libqasan.so");
-
-  }
-
-  SAYF("\n" cLRD "[-] " cRST
-       "Oops, unable to find the 'libqasan.so' binary. The binary must be "
-       "built\n"
-       "    separately by following the instructions in "
-       "qemu_mode/libqasan/README.md. "
-       "If you\n"
-       "    already have the binary installed, you may need to specify "
-       "AFL_PATH in the\n"
-       "    environment.\n");
-
-  FATAL("Failed to locate 'libqasan.so'.");
-
-}
-
 /* Find binary, used by analyze, showmap, tmin
    @returns the path, allocating the string */