From a260d34b4997d86ec158843c2362dae009e3bcf7 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Mon, 2 Nov 2020 14:15:44 +0100 Subject: persistent hook example --- examples/qemu_persistent_hook/read_into_rdi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/qemu_persistent_hook/read_into_rdi.c') diff --git a/examples/qemu_persistent_hook/read_into_rdi.c b/examples/qemu_persistent_hook/read_into_rdi.c index 15647cb4..1977c89f 100644 --- a/examples/qemu_persistent_hook/read_into_rdi.c +++ b/examples/qemu_persistent_hook/read_into_rdi.c @@ -15,11 +15,11 @@ void afl_persistent_hook(struct x86_64_regs *regs, // of the target buffer, and the length of the input is in RSI. // This can be seen with a debugger, e.g. gdb (and "disass main") - printf("Placing input into %p\n", regs->rdi); + printf("Placing input into 0x%lx\n", regs->rdi); - if (input_len > 1024) input_len = 1024; - memcpy(g2h(regs->rdi), input_buf, input_len); - regs->rsi = input_len; + if (input_buf_len > 1024) input_buf_len = 1024; + memcpy(g2h(regs->rdi), input_buf, input_buf_len); + regs->rsi = input_buf_len; #undef g2h #undef h2g -- cgit 1.4.1