about summary refs log tree commit diff
path: root/frida_mode/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-08-31 14:42:16 +0200
committervanhauser-thc <vh@thc.org>2023-08-31 14:42:16 +0200
commit8f5c510be18df03fe201c1bae9bde8e7e7bc0bd9 (patch)
treec15fce54f5e730a74f9c2ca9e6f15a2cc2f84471 /frida_mode/src
parent88ca5c75634d8edfa268005f2e1855a35a5b9e2e (diff)
parent5020e6b275adf0d74e9174b278ff417b5c6a64d2 (diff)
downloadafl++-8f5c510be18df03fe201c1bae9bde8e7e7bc0bd9.tar.gz
Merge branch 'dev' of ssh://github.com/AFLplusplus/AFLplusplus into dev
Diffstat (limited to 'frida_mode/src')
-rw-r--r--frida_mode/src/instrument/instrument_arm64.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/frida_mode/src/instrument/instrument_arm64.c b/frida_mode/src/instrument/instrument_arm64.c
index 2256f941..a0c66697 100644
--- a/frida_mode/src/instrument/instrument_arm64.c
+++ b/frida_mode/src/instrument/instrument_arm64.c
@@ -402,6 +402,18 @@ bool instrument_write_inline(GumArm64Writer *cw, GumAddress code_addr,
 
   }
 
+  /* 
+   * The mov instruction supports up to a 16-bit offset. If our offset is out of 
+   * range, then it can end up clobbering the op-code portion of the instruction 
+   * rather than just the operands. So return false and fall back to the 
+   * alternative instrumentation.
+   */
+  if (area_offset > UINT16_MAX) {
+
+    return false;
+    
+  }
+
   code.code.mov_x0_curr_loc |= area_offset << 5;
 
   if (!instrument_patch_ardp(