about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--unicorn_mode/samples/persistent/Makefile3
-rw-r--r--unicorn_mode/samples/persistent/harness.c4
-rwxr-xr-xunicorn_mode/samples/persistent/persistent_targetbin0 -> 20048 bytes
3 files changed, 5 insertions, 2 deletions
diff --git a/unicorn_mode/samples/persistent/Makefile b/unicorn_mode/samples/persistent/Makefile
index cb491e10..9c7ed7aa 100644
--- a/unicorn_mode/samples/persistent/Makefile
+++ b/unicorn_mode/samples/persistent/Makefile
@@ -45,3 +45,6 @@ harness: harness.o
 
 debug: harness-debug.o
 	${MYCC} -L${LIBDIR} harness.o ../../unicornafl/libunicornafl.a $(LDFLAGS) -o harness-debug
+
+fuzz: harness
+	../../../afl-fuzz -m none -i sample_inputs -o out -- ./harness @@
diff --git a/unicorn_mode/samples/persistent/harness.c b/unicorn_mode/samples/persistent/harness.c
index 02d96e90..3d379f46 100644
--- a/unicorn_mode/samples/persistent/harness.c
+++ b/unicorn_mode/samples/persistent/harness.c
@@ -151,7 +151,7 @@ static void mem_map_checked(uc_engine *uc, uint64_t addr, size_t size, uint32_t
     //printf("SIZE %llx, align: %llx\n", size, ALIGNMENT);
     uc_err err = uc_mem_map(uc, addr, size, mode);
     if (err != UC_ERR_OK) {
-        printf("Error mapping %ld bytes at 0x%lx: %s (mode: %d)\n", size, addr, uc_strerror(err), mode);
+        printf("Error mapping %zu bytes at 0x%llx: %s (mode: %d)\n", size, (unsigned long long) addr, uc_strerror(err), mode);
         exit(1);
     }
 }
@@ -213,7 +213,7 @@ int main(int argc, char **argv, char **envp) {
     // Setup the Stack
     mem_map_checked(uc, STACK_ADDRESS - STACK_SIZE, STACK_SIZE, UC_PROT_READ | UC_PROT_WRITE);
     uint64_t stack_val = STACK_ADDRESS;
-    printf("%lu", stack_val);
+    printf("%llu", (unsigned long long) stack_val);
     uc_reg_write(uc, UC_X86_REG_RSP, &stack_val);
 
     // reserve some space for our input data
diff --git a/unicorn_mode/samples/persistent/persistent_target b/unicorn_mode/samples/persistent/persistent_target
new file mode 100755
index 00000000..83421a4f
--- /dev/null
+++ b/unicorn_mode/samples/persistent/persistent_target
Binary files differ