diff options
author | van Hauser <vh@thc.org> | 2020-03-17 16:10:34 +0100 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-03-17 16:10:34 +0100 |
commit | dae249dc71ceb230b939ddd114b24af33bd133a3 (patch) | |
tree | e92245b3f5eb6f41f98cb77630c74a8f63548e2e /examples/qemu_persistent_hook/read_into_rdi.c | |
parent | e194acdd79aade4c5516701867ad2c0cd83cce23 (diff) | |
download | afl++-dae249dc71ceb230b939ddd114b24af33bd133a3.tar.gz |
minor fix to qemu_persistent_hook example
Diffstat (limited to 'examples/qemu_persistent_hook/read_into_rdi.c')
-rw-r--r-- | examples/qemu_persistent_hook/read_into_rdi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/qemu_persistent_hook/read_into_rdi.c b/examples/qemu_persistent_hook/read_into_rdi.c index 43f1758f..6cf66ddf 100644 --- a/examples/qemu_persistent_hook/read_into_rdi.c +++ b/examples/qemu_persistent_hook/read_into_rdi.c @@ -38,12 +38,13 @@ enum { void afl_persistent_hook(uint64_t *regs, uint64_t guest_base) { // In this example the register RDI is pointing to the memory location - // of the target buffer, and the length of the input is in RAX. + // 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("reading into %p\n", regs[R_EDI]); size_t r = read(0, g2h(regs[R_EDI]), 1024); - regs[R_EAX] = r; - printf("readed %ld bytes\n", r); + regs[R_ESI] = r; + printf("read %ld bytes\n", r); } |