minor fix to qemu_persistent_hook example
MODIFY
examples/qemu_persistent_hook/read_into_rdi.c
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);
}

MODIFY
examples/qemu_persistent_hook/test.c
examples/qemu_persistent_hook/test.c
#include <stdio.h>
-int target_func(char *buf, int size) {
+int target_func(unsigned char *buf, int size) {
printf("buffer:%p, size:%p\n", buf, size);
switch (buf[0]) {

minor fix to qemu_persistent_hook example