about summary refs log tree commit diff
path: root/examples/qemu_persistent_hook/read_into_rdi.c
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-06-03 11:41:30 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-06-03 11:41:30 +0200
commit2d8c3d29345b57fd7e4d2fcb335151d7ef8f08ca (patch)
treefb2b1b8ceeb4b987c6c61a981a0ab42ecc901ace /examples/qemu_persistent_hook/read_into_rdi.c
parentf1192b2d16116fb6c8dc2673e37ec426b7792312 (diff)
parentfc164e4709f1f1c91f9343eb116627417e7f267f (diff)
downloadafl++-2d8c3d29345b57fd7e4d2fcb335151d7ef8f08ca.tar.gz
fix conflicts
Diffstat (limited to 'examples/qemu_persistent_hook/read_into_rdi.c')
-rw-r--r--examples/qemu_persistent_hook/read_into_rdi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/qemu_persistent_hook/read_into_rdi.c b/examples/qemu_persistent_hook/read_into_rdi.c
index 29087962..180d9f00 100644
--- a/examples/qemu_persistent_hook/read_into_rdi.c
+++ b/examples/qemu_persistent_hook/read_into_rdi.c
@@ -36,7 +36,7 @@ enum {
 };
 
 void afl_persistent_hook(uint64_t *regs, uint64_t guest_base,
-                         uint8_t* input_buf, uint32_t input_len) {
+                         uint8_t *input_buf, uint32_t input_len) {
 
   // In this example the register RDI is pointing to the memory location
   // of the target buffer, and the length of the input is in RSI.
@@ -44,16 +44,17 @@ void afl_persistent_hook(uint64_t *regs, uint64_t guest_base,
 
   printf("placing input into %p\n", regs[R_EDI]);
 
-  if (input_len > 1024)
-    input_len = 1024;
-  memcpy(g2h(regs[R_EDI]), input_buf, input_len); 
+  if (input_len > 1024) input_len = 1024;
+  memcpy(g2h(regs[R_EDI]), input_buf, input_len);
   regs[R_ESI] = input_len;
 
 }
 
 int afl_persistent_hook_init(void) {
 
-  // 1 for shared memory input (faster), 0 for normal input (you have to use read(), input_buf will be NULL)
+  // 1 for shared memory input (faster), 0 for normal input (you have to use
+  // read(), input_buf will be NULL)
   return 1;
 
 }
+