mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 17:21:33 +00:00
Fixes to exclude ASAN DSO
This commit is contained in:
parent
7514565858
commit
67a6481b36
@ -9,6 +9,7 @@ void asan_config(void);
|
||||
void asan_init(void);
|
||||
void asan_arch_init(void);
|
||||
void asan_instrument(const cs_insn *instr, GumStalkerIterator *iterator);
|
||||
void asan_exclude_module_by_symbol(gchar *symbol_name);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "frida-gumjs.h"
|
||||
|
||||
#include "asan.h"
|
||||
#include "ranges.h"
|
||||
#include "util.h"
|
||||
|
||||
static gboolean asan_enabled = FALSE;
|
||||
@ -32,3 +33,34 @@ void asan_init(void) {
|
||||
|
||||
}
|
||||
|
||||
gboolean asan_exclude_range(const GumRangeDetails *details,
|
||||
gpointer user_data) {
|
||||
|
||||
UNUSED_PARAMETER(user_data);
|
||||
|
||||
FOKF("Exclude ASAN: 0x%016lx-0x%016lx", details->range->base_address,
|
||||
details->range->base_address + details->range->size);
|
||||
|
||||
ranges_add_exclude((GumMemoryRange *)details->range);
|
||||
|
||||
}
|
||||
|
||||
static gboolean asan_exclude_module(const GumModuleDetails *details,
|
||||
gpointer user_data) {
|
||||
|
||||
gchar * symbol_name = (gchar *)user_data;
|
||||
GumAddress address;
|
||||
|
||||
address = gum_module_find_export_by_name(details->name, symbol_name);
|
||||
if (address == 0) { return TRUE; }
|
||||
|
||||
gum_process_enumerate_ranges(GUM_PAGE_NO_ACCESS, asan_exclude_range, NULL);
|
||||
|
||||
}
|
||||
|
||||
void asan_exclude_module_by_symbol(gchar *symbol_name) {
|
||||
|
||||
gum_process_enumerate_modules(asan_exclude_module, "__asan_loadN");
|
||||
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,8 @@ void asan_arch_init(void) {
|
||||
|
||||
}
|
||||
|
||||
asan_exclude_module_by_symbol("__asan_loadN");
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -85,6 +85,8 @@ void asan_arch_init(void) {
|
||||
|
||||
}
|
||||
|
||||
asan_exclude_module_by_symbol("__asan_loadN");
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -85,6 +85,8 @@ void asan_arch_init(void) {
|
||||
|
||||
}
|
||||
|
||||
asan_exclude_module_by_symbol("__asan_loadN");
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user