about summary refs log tree commit diff
path: root/examples/qemu_persistent_hook/read_into_rdi.c
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-02-08 17:24:04 +0100
committerhexcoder- <heiko@hexco.de>2020-02-08 17:24:04 +0100
commit585c3015a59fed0747ebb6b492dab99452ceb23e (patch)
tree9f8829318e66f8f445a4573abe40ffbdea09394a /examples/qemu_persistent_hook/read_into_rdi.c
parentb6209b373217a7cc84e229cf8f7fff3253815b8e (diff)
parent079f177cdaf43f017bf320912cd97f86dea586be (diff)
downloadafl++-585c3015a59fed0747ebb6b492dab99452ceb23e.tar.gz
Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus
Diffstat (limited to 'examples/qemu_persistent_hook/read_into_rdi.c')
-rw-r--r--examples/qemu_persistent_hook/read_into_rdi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/qemu_persistent_hook/read_into_rdi.c b/examples/qemu_persistent_hook/read_into_rdi.c
index fd4c9000..3994e790 100644
--- a/examples/qemu_persistent_hook/read_into_rdi.c
+++ b/examples/qemu_persistent_hook/read_into_rdi.c
@@ -37,8 +37,12 @@ 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.
+
   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);
 
 }