aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/afl_frida/afl-frida.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/afl_frida/afl-frida.c b/examples/afl_frida/afl-frida.c
index 76732aeb..7038e1bd 100644
--- a/examples/afl_frida/afl-frida.c
+++ b/examples/afl_frida/afl-frida.c
@@ -127,6 +127,7 @@ void __afl_manual_init();
// Because we do our own logging.
extern uint8_t *__afl_area_ptr;
+ static __thread guint64 previous_pc;
// Frida stuff below.
typedef struct {
@@ -138,9 +139,7 @@ typedef struct {
inline static void afl_maybe_log(guint64 current_pc) {
- static __thread guint64 previous_pc;
-
- // fprintf(stderr, "PC: %p\n", current_pc);
+ // fprintf(stderr, "PC: %p ^ %p\n", current_pc, previous_pc);
current_pc = (current_pc >> 4) ^ (current_pc << 8);
current_pc &= MAP_SIZE - 1;
@@ -502,6 +501,8 @@ int main() {
while (__afl_persistent_loop(UINT32_MAX) != 0) {
+ previous_pc = 0; // Required!
+
#ifdef _DEBUG
fprintf(stderr, "CLIENT crc: %016llx len: %u\n", hash64(__afl_fuzz_ptr, *__a
fprintf(stderr, "RECV:");