aboutsummaryrefslogtreecommitdiff
path: root/frida_mode/hook/hook.c
diff options
context:
space:
mode:
authorWorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com>2021-07-02 08:44:53 +0100
committerGitHub <noreply@github.com>2021-07-02 09:44:53 +0200
commita8529de59247a8bf1e9c1591c0db306ccbcf1d49 (patch)
treead23054ba30c47a2b22a464f10c0ed33a1f3f180 /frida_mode/hook/hook.c
parenta6cf9bb336cc3e166469d6eed206a2b6fa9c994a (diff)
downloadafl++-a8529de59247a8bf1e9c1591c0db306ccbcf1d49.tar.gz
Changes to strip unused symbols from afl-frida-trace.so and hance remove v7 and its dependency on C++ (#1001)
Co-authored-by: Your Name <you@example.com>
Diffstat (limited to 'frida_mode/hook/hook.c')
-rw-r--r--frida_mode/hook/hook.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/frida_mode/hook/hook.c b/frida_mode/hook/hook.c
index 7d08101f..97f28db7 100644
--- a/frida_mode/hook/hook.c
+++ b/frida_mode/hook/hook.c
@@ -5,8 +5,8 @@
#if defined(__x86_64__)
-void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
- uint32_t input_buf_len) {
+__attribute__((visibility("default"))) 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;
@@ -15,8 +15,8 @@ void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
#elif defined(__i386__)
-void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
- uint32_t input_buf_len) {
+__attribute__((visibility("default"))) void afl_persistent_hook(
+ GumCpuContext *regs, uint8_t *input_buf, uint32_t input_buf_len) {
void **esp = (void **)regs->esp;
void * arg1 = esp[0];
@@ -28,8 +28,8 @@ void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
#elif defined(__aarch64__)
-void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
- uint32_t input_buf_len) {
+__attribute__((visibility("default"))) 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;
@@ -40,7 +40,7 @@ void afl_persistent_hook(GumCpuContext *regs, uint8_t *input_buf,
#pragma error "Unsupported architecture"
#endif
-int afl_persistent_hook_init(void) {
+__attribute__((visibility("default"))) 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)