diff options
| author | vanhauser-thc <vh@thc.org> | 2021-07-19 10:58:19 +0200 |
|---|---|---|
| committer | vanhauser-thc <vh@thc.org> | 2021-07-19 10:58:19 +0200 |
| commit | 32a0d6ac31554a47dca591f8978982758fb87677 (patch) | |
| tree | be2ffd03f136dbecd408c73e4bc250ae249a4180 /frida_mode/src/entry.c | |
| parent | 815161827689c339d335233b7b232ac9b120b79b (diff) | |
| download | afl++-32a0d6ac31554a47dca591f8978982758fb87677.tar.gz | |
Revert "Merge branch 'release' into stable"
This reverts commit 815161827689c339d335233b7b232ac9b120b79b, reversing changes made to 9321a24e682b5c8bf6278961bd014cb883b87295.
Diffstat (limited to 'frida_mode/src/entry.c')
| -rw-r--r-- | frida_mode/src/entry.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/frida_mode/src/entry.c b/frida_mode/src/entry.c index e71386a0..a0ffd028 100644 --- a/frida_mode/src/entry.c +++ b/frida_mode/src/entry.c @@ -1,35 +1,46 @@ -#include "frida-gum.h" +#include "frida-gumjs.h" #include "debug.h" #include "entry.h" #include "instrument.h" +#include "persistent.h" +#include "ranges.h" #include "stalker.h" +#include "stats.h" #include "util.h" extern void __afl_manual_init(); -guint64 entry_start = 0; +guint64 entry_point = 0; +gboolean entry_reached = FALSE; static void entry_launch(void) { + OKF("Entry point reached"); __afl_manual_init(); /* Child here */ - previous_pc = 0; + instrument_on_fork(); + stats_on_fork(); + +} + +void entry_config(void) { + + entry_point = util_read_address("AFL_ENTRYPOINT"); } void entry_init(void) { - entry_start = util_read_address("AFL_ENTRYPOINT"); - OKF("entry_point: 0x%016" G_GINT64_MODIFIER "X", entry_start); + OKF("entry_point: 0x%016" G_GINT64_MODIFIER "X", entry_point); } -void entry_run(void) { +void entry_start(void) { - if (entry_start == 0) { entry_launch(); } + if (entry_point == 0) { entry_launch(); } } @@ -44,6 +55,16 @@ static void entry_callout(GumCpuContext *cpu_context, gpointer user_data) { void entry_prologue(GumStalkerIterator *iterator, GumStalkerOutput *output) { UNUSED_PARAMETER(output); + OKF("AFL_ENTRYPOINT reached"); + + if (persistent_start == 0) { + + entry_reached = TRUE; + ranges_exclude(); + stalker_trust(); + + } + gum_stalker_iterator_put_callout(iterator, entry_callout, NULL, NULL); } |
