From 98e883875548c12d022adf556f9a95babb38c200 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Aug 2022 18:46:29 +0100 Subject: Fix formatting --- frida_mode/hook/frida_hook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frida_mode/hook/frida_hook.c') diff --git a/frida_mode/hook/frida_hook.c b/frida_mode/hook/frida_hook.c index 3bfdb207..86c6f9d4 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; -- cgit 1.4.1 From 9d5a2d1b8e6f4ead25a857d106b37fd85950aff3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Aug 2022 18:46:29 +0100 Subject: Add support for using hook on ARM32 --- frida_mode/hook/frida_hook.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'frida_mode/hook/frida_hook.c') 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 -- cgit 1.4.1