about summary refs log tree commit diff
path: root/frida_mode/hook/frida_hook.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-08-08 15:27:07 +0200
committerGitHub <noreply@github.com>2022-08-08 15:27:07 +0200
commit3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3 (patch)
tree051a91a2a36a1c768870591634eca83c62e6053c /frida_mode/hook/frida_hook.c
parenta2f3c3ee519c19935039d1fe1e8b77cdc32fa375 (diff)
parent1f06b55a8b558bd8da0296134c29c21c4849a4bd (diff)
downloadafl++-3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3.tar.gz
Merge pull request #1489 from AFLplusplus/dev 4.02c
push to stable
Diffstat (limited to 'frida_mode/hook/frida_hook.c')
-rw-r--r--frida_mode/hook/frida_hook.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/frida_mode/hook/frida_hook.c b/frida_mode/hook/frida_hook.c
index 3bfdb207..79e2348d 100644
--- a/frida_mode/hook/frida_hook.c
+++ b/frida_mode/hook/frida_hook.c
@@ -31,7 +31,7 @@ __attribute__((visibility("default"))) void afl_persistent_hook(
   // do a length check matching the target!
 
   void **esp = (void **)regs->esp;
-  void * arg1 = esp[0];
+  void  *arg1 = esp[0];
   void **arg2 = &esp[1];
   memcpy(arg1, input_buf, input_buf_len);
   *arg2 = (void *)input_buf_len;
@@ -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