diff options
author | llzmb <46303940+llzmb@users.noreply.github.com> | 2021-08-31 21:19:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 21:19:04 +0200 |
commit | 9747ac42213126ec99fe8ea47f1320be54135bd1 (patch) | |
tree | 677b0cf3143a1964134a67a1922b70dc20f6be19 /frida_mode/src/entry.c | |
parent | ec4cae448b10acc0a8c84fc75f298bfaed88195a (diff) | |
parent | fe5b2c355f097705bf0bd7b35b0484b16f87964f (diff) | |
download | afl++-9747ac42213126ec99fe8ea47f1320be54135bd1.tar.gz |
Merge branch 'dev' into docs_edit_readme_move_content_to_docs
Diffstat (limited to 'frida_mode/src/entry.c')
-rw-r--r-- | frida_mode/src/entry.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/frida_mode/src/entry.c b/frida_mode/src/entry.c index 0b5f61ec..186ddd3a 100644 --- a/frida_mode/src/entry.c +++ b/frida_mode/src/entry.c @@ -1,3 +1,5 @@ +#include <dlfcn.h> + #include "frida-gumjs.h" #include "debug.h" @@ -6,6 +8,7 @@ #include "instrument.h" #include "persistent.h" #include "ranges.h" +#include "seccomp.h" #include "stalker.h" #include "stats.h" #include "util.h" @@ -13,7 +16,8 @@ extern void __afl_manual_init(); guint64 entry_point = 0; -gboolean entry_reached = FALSE; +gboolean entry_compiled = FALSE; +gboolean entry_run = FALSE; static void entry_launch(void) { @@ -21,8 +25,9 @@ static void entry_launch(void) { __afl_manual_init(); /* Child here */ - entry_reached = TRUE; + entry_run = TRUE; instrument_on_fork(); + seccomp_on_fork(); stats_on_fork(); } @@ -37,6 +42,8 @@ void entry_init(void) { OKF("entry_point: 0x%016" G_GINT64_MODIFIER "X", entry_point); + if (dlopen(NULL, RTLD_NOW) == NULL) { FATAL("Failed to dlopen: %d", errno); } + } void entry_start(void) { @@ -49,6 +56,7 @@ static void entry_callout(GumCpuContext *cpu_context, gpointer user_data) { UNUSED_PARAMETER(cpu_context); UNUSED_PARAMETER(user_data); + entry_compiled = TRUE; entry_launch(); } |