about summary refs log tree commit diff
path: root/frida_mode/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-08-12 18:55:40 +0200
committerGitHub <noreply@github.com>2021-08-12 18:55:40 +0200
commitb8fd0a1463fe5805d22f323777b65b7b2e2fcf46 (patch)
tree119ab732665da26bf8e72f3c0f82147041df2087 /frida_mode/src
parent20815d68502f288d3939a39b91f6de1e58220e18 (diff)
parentcacee58fb70e11fe463598077fe362ba76cd2101 (diff)
downloadafl++-b8fd0a1463fe5805d22f323777b65b7b2e2fcf46.tar.gz
Merge pull request #1065 from WorksButNotTested/fixes
Fixes
Diffstat (limited to 'frida_mode/src')
-rw-r--r--frida_mode/src/cmplog/cmplog.c4
-rw-r--r--frida_mode/src/entry.c2
-rw-r--r--frida_mode/src/instrument/instrument.c4
3 files changed, 6 insertions, 4 deletions
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();
 
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();
 
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));
 
 }