From cfbff436a58e6fe0d826ebb8b9cf0f148dffafcc Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 12 Aug 2021 17:42:11 +0100 Subject: Fix to setting of entry_reached --- frida_mode/src/entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frida_mode/src') diff --git a/frida_mode/src/entry.c b/frida_mode/src/entry.c index a0ffd028..0b5f61ec 100644 --- a/frida_mode/src/entry.c +++ b/frida_mode/src/entry.c @@ -21,6 +21,7 @@ static void entry_launch(void) { __afl_manual_init(); /* Child here */ + entry_reached = TRUE; instrument_on_fork(); stats_on_fork(); @@ -59,7 +60,6 @@ void entry_prologue(GumStalkerIterator *iterator, GumStalkerOutput *output) { if (persistent_start == 0) { - entry_reached = TRUE; ranges_exclude(); stalker_trust(); -- cgit 1.4.1 From d2d7585db553ca69830f7eadcc0f8a5c7feaf6d3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 12 Aug 2021 17:42:11 +0100 Subject: Changes to remove hard-coding of MAP_SIZE_POW2 when inline instrumentation is disabled --- frida_mode/src/instrument/instrument.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'frida_mode/src') diff --git a/frida_mode/src/instrument/instrument.c b/frida_mode/src/instrument/instrument.c index 67aafa5a..fddff19a 100644 --- a/frida_mode/src/instrument/instrument.c +++ b/frida_mode/src/instrument/instrument.c @@ -116,8 +116,8 @@ __attribute__((hot)) static void on_basic_block(GumCpuContext *context, } - instrument_previous_pc = - ((current_pc & (MAP_SIZE - 1) >> 1)) | ((current_pc & 0x1) << 15); + instrument_previous_pc = ((current_pc & (MAP_SIZE - 1) >> 1)) | + ((current_pc & 0x1) << (MAP_SIZE_POW2 - 1)); } -- cgit 1.4.1 From 11d62d51c51e837bdddb9016720c7a5b2d646157 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 12 Aug 2021 17:42:11 +0100 Subject: Don't print loads of debugging info about cmplog when it isn't enabled --- frida_mode/src/cmplog/cmplog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'frida_mode/src') diff --git a/frida_mode/src/cmplog/cmplog.c b/frida_mode/src/cmplog/cmplog.c index a2609c8e..ae3116eb 100644 --- a/frida_mode/src/cmplog/cmplog.c +++ b/frida_mode/src/cmplog/cmplog.c @@ -56,7 +56,9 @@ void cmplog_config(void) { void cmplog_init(void) { - if (__afl_cmp_map != NULL) { OKF("CMPLOG mode enabled"); } + OKF("CMPLOG - Enabled [%c]", __afl_cmp_map == NULL ? ' ' : 'X'); + + if (__afl_cmp_map == NULL) { return; } cmplog_get_ranges(); -- cgit 1.4.1