about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-08-04 18:46:29 +0100
committerYour Name <you@example.com>2022-08-04 18:46:29 +0100
commit9d5a2d1b8e6f4ead25a857d106b37fd85950aff3 (patch)
treea00dcc353fd4add31a2c1e75bc2a4ac79419570c
parent1e524d1f43bba638b000da5fa6fb094ebcc9bb83 (diff)
downloadafl++-9d5a2d1b8e6f4ead25a857d106b37fd85950aff3.tar.gz
Add support for using hook on ARM32
-rw-r--r--frida_mode/hook/frida_hook.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/frida_mode/hook/frida_hook.c b/frida_mode/hook/frida_hook.c
index 86c6f9d4..79e2348d 100644
--- a/frida_mode/hook/frida_hook.c
+++ b/frida_mode/hook/frida_hook.c
@@ -50,6 +50,16 @@ __attribute__((visibility("default"))) void afl_persistent_hook(
 
 }
 
+#elif defined(__arm__)
+
+__attribute__((visibility("default"))) void afl_persistent_hook(
+    GumCpuContext *regs, uint8_t *input_buf, uint32_t input_buf_len) {
+  // do a length check matching the target!
+
+  memcpy((void *)regs->r[0], input_buf, input_buf_len);
+  regs->r[1] = input_buf_len;
+}
+
 #else
   #pragma error "Unsupported architecture"
 #endif