diff options
| author | van Hauser <vh@thc.org> | 2021-11-09 09:49:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-09 09:49:09 +0100 |
| commit | 3d9b2b459fb96bb724c9529935b1e2232249d201 (patch) | |
| tree | 85d1c242ca03f5066b82b66b89b601a5f2bf7855 /frida_mode/src/cmplog | |
| parent | 33f9af976be98b14ea185c1415e25d39acc0595a (diff) | |
| parent | b834f934d0e6a33f675a30402475c7bc816a37ee (diff) | |
| download | afl++-3d9b2b459fb96bb724c9529935b1e2232249d201.tar.gz | |
Merge pull request #1150 from WorksButNotTested/perf-final
Perf final
Diffstat (limited to 'frida_mode/src/cmplog')
| -rw-r--r-- | frida_mode/src/cmplog/cmplog_arm64.c | 6 | ||||
| -rw-r--r-- | frida_mode/src/cmplog/cmplog_x64.c | 6 | ||||
| -rw-r--r-- | frida_mode/src/cmplog/cmplog_x86.c | 6 |
3 files changed, 6 insertions, 12 deletions
diff --git a/frida_mode/src/cmplog/cmplog_arm64.c b/frida_mode/src/cmplog/cmplog_arm64.c index ccc8e89e..c6590bb4 100644 --- a/frida_mode/src/cmplog/cmplog_arm64.c +++ b/frida_mode/src/cmplog/cmplog_arm64.c @@ -5,6 +5,7 @@ #include "ctx.h" #include "frida_cmplog.h" +#include "instrument.h" #include "util.h" #if defined(__aarch64__) @@ -111,10 +112,7 @@ static void cmplog_call_callout(GumCpuContext *context, gpointer user_data) { void *ptr1 = GSIZE_TO_POINTER(x0); void *ptr2 = GSIZE_TO_POINTER(x1); - uintptr_t k = address; - - k = (k >> 4) ^ (k << 8); - k &= CMP_MAP_W - 1; + guint64 k = instrument_get_offset_hash(GUM_ADDRESS(address)); if (__afl_cmp_map->headers[k].type != CMP_TYPE_RTN) { diff --git a/frida_mode/src/cmplog/cmplog_x64.c b/frida_mode/src/cmplog/cmplog_x64.c index 5319f727..7fbcf408 100644 --- a/frida_mode/src/cmplog/cmplog_x64.c +++ b/frida_mode/src/cmplog/cmplog_x64.c @@ -5,6 +5,7 @@ #include "ctx.h" #include "frida_cmplog.h" +#include "instrument.h" #include "util.h" #if defined(__x86_64__) @@ -106,10 +107,7 @@ static void cmplog_call_callout(GumCpuContext *context, gpointer user_data) { void *ptr1 = GSIZE_TO_POINTER(rdi); void *ptr2 = GSIZE_TO_POINTER(rsi); - uintptr_t k = address; - - k = (k >> 4) ^ (k << 8); - k &= CMP_MAP_W - 1; + guint64 k = instrument_get_offset_hash(GUM_ADDRESS(address)); if (__afl_cmp_map->headers[k].type != CMP_TYPE_RTN) { diff --git a/frida_mode/src/cmplog/cmplog_x86.c b/frida_mode/src/cmplog/cmplog_x86.c index 27d06720..bdd1af4e 100644 --- a/frida_mode/src/cmplog/cmplog_x86.c +++ b/frida_mode/src/cmplog/cmplog_x86.c @@ -5,6 +5,7 @@ #include "ctx.h" #include "frida_cmplog.h" +#include "instrument.h" #include "util.h" #if defined(__i386__) @@ -111,10 +112,7 @@ static void cmplog_call_callout(GumCpuContext *context, gpointer user_data) { void *ptr1 = GSIZE_TO_POINTER(arg1); void *ptr2 = GSIZE_TO_POINTER(arg2); - uintptr_t k = address; - - k = (k >> 4) ^ (k << 8); - k &= CMP_MAP_W - 1; + guint64 k = instrument_get_offset_hash(GUM_ADDRESS(address)); if (__afl_cmp_map->headers[k].type != CMP_TYPE_RTN) { |
