aboutsummaryrefslogtreecommitdiff
path: root/frida_mode/src
diff options
context:
space:
mode:
Diffstat (limited to 'frida_mode/src')
-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);