aboutsummaryrefslogtreecommitdiff
path: root/frida_mode/src/instrument
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-01-20 16:17:08 +0100
committerGitHub <noreply@github.com>2022-01-20 16:17:08 +0100
commit7aced239e8a0855d87ecc921ba5691b29202ec1e (patch)
treea8e877a149495ea4ec48723d8af57426f8322a3a /frida_mode/src/instrument
parent9242e0db8ac8a0e82d78432af389108e74700f00 (diff)
parentd1de12d6175cd84357eadbf204e15b184b22ae42 (diff)
downloadafl++-7aced239e8a0855d87ecc921ba5691b29202ec1e.tar.gz
Merge pull request #1294 from AFLplusplus/dev
Push to stable
Diffstat (limited to 'frida_mode/src/instrument')
-rw-r--r--frida_mode/src/instrument/instrument.c6
-rw-r--r--frida_mode/src/instrument/instrument_x64.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/frida_mode/src/instrument/instrument.c b/frida_mode/src/instrument/instrument.c
index 46ed1a34..418b35e8 100644
--- a/frida_mode/src/instrument/instrument.c
+++ b/frida_mode/src/instrument/instrument.c
@@ -318,12 +318,6 @@ void instrument_init(void) {
if (instrument_unique) { instrument_tracing = TRUE; }
- if (__afl_map_size != 0x10000) {
-
- FATAL("Bad map size: 0x%08x", __afl_map_size);
-
- }
-
transformer = gum_stalker_transformer_make_from_callback(
instrument_basic_block, NULL, NULL);
diff --git a/frida_mode/src/instrument/instrument_x64.c b/frida_mode/src/instrument/instrument_x64.c
index 0ea4f7f0..fb84d6d2 100644
--- a/frida_mode/src/instrument/instrument_x64.c
+++ b/frida_mode/src/instrument/instrument_x64.c
@@ -216,6 +216,8 @@ static gboolean instrument_coverage_find_low(const GumRangeDetails *details,
static GumAddress last_limit = (64ULL << 10);
gpointer * address = (gpointer *)user_data;
+ last_limit = GUM_ALIGN_SIZE(last_limit, __afl_map_size);
+
if ((details->range->base_address - last_limit) > __afl_map_size) {
*address = GSIZE_TO_POINTER(last_limit);
@@ -235,7 +237,7 @@ static gboolean instrument_coverage_find_low(const GumRangeDetails *details,
* current block ID.
*/
last_limit = GUM_ALIGN_SIZE(
- details->range->base_address + details->range->size, (64ULL << 10));
+ details->range->base_address + details->range->size, __afl_map_size);
return TRUE;
}
@@ -326,7 +328,7 @@ void instrument_coverage_optimize_init(void) {
FVERBOSE("Low address: %p", low_address);
if (low_address == 0 ||
- GPOINTER_TO_SIZE(low_address) > ((2UL << 20) - __afl_map_size)) {
+ GPOINTER_TO_SIZE(low_address) > ((2UL << 30) - __afl_map_size)) {
FATAL("Invalid low_address: %p", low_address);