aboutsummaryrefslogtreecommitdiff
path: root/frida_mode/src/asan/asan.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-08-01 08:10:45 +0100
committerYour Name <you@example.com>2022-08-05 20:57:54 +0100
commit608ea5f8abbfce9c309d452e2ee3dbb014dc511a (patch)
treeff645a8bd0a5d81e3f6f825efebf87845b463436 /frida_mode/src/asan/asan.c
parent00b5d3792de4a7867da9cb5abd08de9fca484db1 (diff)
downloadafl++-608ea5f8abbfce9c309d452e2ee3dbb014dc511a.tar.gz
Add support for Android SHM
Diffstat (limited to 'frida_mode/src/asan/asan.c')
-rw-r--r--frida_mode/src/asan/asan.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/frida_mode/src/asan/asan.c b/frida_mode/src/asan/asan.c
index 3a672d31..bd4062be 100644
--- a/frida_mode/src/asan/asan.c
+++ b/frida_mode/src/asan/asan.c
@@ -8,23 +8,17 @@ static gboolean asan_enabled = FALSE;
gboolean asan_initialized = FALSE;
void asan_config(void) {
-
if (getenv("AFL_USE_FASAN") != NULL) { asan_enabled = TRUE; }
-
}
void asan_init(void) {
-
FOKF(cBLU "Instrumentation" cRST " - " cGRN "asan:" cYEL " [%c]",
asan_enabled ? 'X' : ' ');
if (asan_enabled) {
-
asan_arch_init();
asan_initialized = TRUE;
-
}
-
}
static gboolean asan_exclude_module(const GumModuleDetails *details,
@@ -36,14 +30,17 @@ static gboolean asan_exclude_module(const GumModuleDetails *details,
address = gum_module_find_export_by_name(details->name, symbol_name);
if (address == 0) { return TRUE; }
+ /* If the reported address of the symbol is outside of the range of the module
+ * then ignore it */
+ if (address < details->range->base_address) { return TRUE; }
+ if (address > (details->range->base_address + details->range->size)) {
+ return TRUE;
+ }
+
ranges_add_exclude((GumMemoryRange *)details->range);
return FALSE;
-
}
void asan_exclude_module_by_symbol(gchar *symbol_name) {
-
gum_process_enumerate_modules(asan_exclude_module, symbol_name);
-
}
-