about summary refs log tree commit diff
path: root/frida_mode/hook/hook.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-07-19 10:31:56 +0200
committerGitHub <noreply@github.com>2021-07-19 10:31:56 +0200
commit939729e504ea269dd6d7252c363b160e01d1be1a (patch)
tree808710139e53d9958cdb660d61680d48e64e8c3a /frida_mode/hook/hook.c
parent458eb0813a6f7d63eed97f18696bca8274533123 (diff)
parent18fd97fc5ffc5ad94e735cfbfa0d500463dcb585 (diff)
downloadafl++-939729e504ea269dd6d7252c363b160e01d1be1a.tar.gz
Merge pull request #1023 from AFLplusplus/dev
push to stable
Diffstat (limited to 'frida_mode/hook/hook.c')
-rw-r--r--frida_mode/hook/hook.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/frida_mode/hook/hook.c b/frida_mode/hook/hook.c
deleted file mode 100644
index 7d08101f..00000000
--- a/frida_mode/hook/hook.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <stdint.h>
-#include <string.h>
-
-#include "frida-gumjs.h"
-
-#if defined(__x86_64__)
-
-void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
-                         uint32_t input_buf_len) {
-
-  memcpy((void *)regs->rdi, input_buf, input_buf_len);
-  regs->rsi = input_buf_len;
-
-}
-
-#elif defined(__i386__)
-
-void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
-                         uint32_t input_buf_len) {
-
-  void **esp = (void **)regs->esp;
-  void * arg1 = esp[0];
-  void **arg2 = &esp[1];
-  memcpy(arg1, input_buf, input_buf_len);
-  *arg2 = (void *)input_buf_len;
-
-}
-
-#elif defined(__aarch64__)
-
-void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
-                         uint32_t input_buf_len) {
-
-  memcpy((void *)regs->x[0], input_buf, input_buf_len);
-  regs->x[1] = input_buf_len;
-
-}
-
-#else
-  #pragma error "Unsupported architecture"
-#endif
-
-int afl_persistent_hook_init(void) {
-
-  // 1 for shared memory input (faster), 0 for normal input (you have to use
-  // read(), input_buf will be NULL)
-  return 1;
-
-}
-