diff options
author | WorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com> | 2021-04-28 09:25:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 10:25:26 +0200 |
commit | 39ad3b89467d6de12cbb9d08ccd77d331c0d1f9e (patch) | |
tree | 18bdf509d47e0d971bd9d7faf56d27758b23b09c /frida_mode/src/stalker.c | |
parent | 8da5cba4012080afca5e7f7da9aaa6aa6e263f3e (diff) | |
download | afl++-39ad3b89467d6de12cbb9d08ccd77d331c0d1f9e.tar.gz |
Frida persistent (#880)
* Added x64 support for persistent mode (function call only), in-memory teest cases and complog * Review changes, fix NeverZero and code to parse the .text section of the main executable. Excluded ranges TBC * Various minor fixes and finished support for AFL_INST_LIBS * Review changes Co-authored-by: Your Name <you@example.com>
Diffstat (limited to 'frida_mode/src/stalker.c')
-rw-r--r-- | frida_mode/src/stalker.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/frida_mode/src/stalker.c b/frida_mode/src/stalker.c new file mode 100644 index 00000000..5ee519ba --- /dev/null +++ b/frida_mode/src/stalker.c @@ -0,0 +1,49 @@ +#include "debug.h" + +#include "instrument.h" +#include "stalker.h" + +static GumStalker *stalker = NULL; + +void stalker_init(void) { + + stalker = gum_stalker_new(); + if (stalker == NULL) { FATAL("Failed to initialize stalker"); } + + gum_stalker_set_trust_threshold(stalker, 0); + +} + +GumStalker *stalker_get(void) { + + if (stalker == NULL) { FATAL("Stalker uninitialized"); } + return stalker; + +} + +__attribute__((noinline)) static void stalker_activation(void) { + + asm volatile(""); + +} + +void stalker_start(void) { + + GumStalkerTransformer *transformer = instrument_get_transformer(); + gum_stalker_follow_me(stalker, transformer, NULL); + +} + +void stalker_pause(void) { + + gum_stalker_deactivate(stalker); + +} + +void stalker_resume(void) { + + gum_stalker_activate(stalker, stalker_activation); + stalker_activation(); + +} + |