diff options
author | richinseattle@gmail.com <richinseattle@gmail.com> | 2021-03-18 01:37:40 -0700 |
---|---|---|
committer | richinseattle@gmail.com <richinseattle@gmail.com> | 2021-03-18 01:37:40 -0700 |
commit | c397becd81229d71b55acf89a31710bead3707aa (patch) | |
tree | 8306b59e88e22d7090fd786690227dacc99e24e3 /utils/aflpp_driver/aflpp_qemu_driver_hook.c | |
parent | 62508c3b446a893f0afead9a6d0546d53d588a13 (diff) | |
parent | 94312796f936ba1830b61432a0f958e192dd212f (diff) | |
download | afl++-c397becd81229d71b55acf89a31710bead3707aa.tar.gz |
Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev
Diffstat (limited to 'utils/aflpp_driver/aflpp_qemu_driver_hook.c')
-rw-r--r-- | utils/aflpp_driver/aflpp_qemu_driver_hook.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/aflpp_driver/aflpp_qemu_driver_hook.c b/utils/aflpp_driver/aflpp_qemu_driver_hook.c new file mode 100644 index 00000000..823cc42d --- /dev/null +++ b/utils/aflpp_driver/aflpp_qemu_driver_hook.c @@ -0,0 +1,22 @@ +#include <stdint.h> +#include <string.h> + +#define g2h(x) ((void *)((unsigned long)(x) + guest_base)) + +#define REGS_RDI 7 +#define REGS_RSI 6 + +void afl_persistent_hook(uint64_t *regs, uint64_t guest_base, + uint8_t *input_buf, uint32_t input_len) { + + memcpy(g2h(regs[REGS_RDI]), input_buf, input_len); + regs[REGS_RSI] = input_len; + +} + +int afl_persistent_hook_init(void) { + + return 1; + +} + |