about summary refs log tree commit diff
path: root/include/forkserver.h
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-01-11 12:20:35 +0100
committerGitHub <noreply@github.com>2022-01-11 12:20:35 +0100
commit10dae419d6e3ebc38f53840c5abfe98e9c901217 (patch)
tree352576e19c8a504c40ea58dbb141056762901a69 /include/forkserver.h
parent74a8f145e09d0361d8f576eb3f2e8881b6116f18 (diff)
parentd2715336a54635bb6e617a2e739c0ad5fe51d28d (diff)
downloadafl++-10dae419d6e3ebc38f53840c5abfe98e9c901217.tar.gz
Merge pull request #1236 from AFLplusplus/dev
push to stable
Diffstat (limited to 'include/forkserver.h')
-rw-r--r--include/forkserver.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/include/forkserver.h b/include/forkserver.h
index 464f208d..48db2e26 100644
--- a/include/forkserver.h
+++ b/include/forkserver.h
@@ -12,7 +12,7 @@
                      Dominik Maier <mail@dmnk.co>>
 
    Copyright 2016, 2017 Google Inc. All rights reserved.
-   Copyright 2019-2020 AFLplusplus Project. All rights reserved.
+   Copyright 2019-2022 AFLplusplus Project. All rights reserved.
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -33,6 +33,42 @@
 
 #include "types.h"
 
+#ifdef __linux__
+/**
+ * Nyx related typedefs taken from libnyx.h
+ */
+
+typedef enum NyxReturnValue {
+
+  Normal,
+  Crash,
+  Asan,
+  Timout,
+  InvalidWriteToPayload,
+  Error,
+  IoError,
+  Abort,
+
+} NyxReturnValue;
+
+typedef struct {
+
+  void *(*nyx_new)(const char *sharedir, const char *workdir,
+                   uint32_t worker_id, uint32_t cpu_id, bool create_snapshot);
+  void (*nyx_shutdown)(void *qemu_process);
+  void (*nyx_option_set_reload_mode)(void *qemu_process, bool enable);
+  void (*nyx_option_set_timeout)(void *qemu_process, uint8_t timeout_sec,
+                                 uint32_t timeout_usec);
+  void (*nyx_option_apply)(void *qemu_process);
+  void (*nyx_set_afl_input)(void *qemu_process, uint8_t *buffer, uint32_t size);
+  enum NyxReturnValue (*nyx_exec)(void *qemu_process);
+  uint8_t *(*nyx_get_bitmap_buffer)(void *qemu_process);
+  size_t (*nyx_get_bitmap_buffer_size)(void *qemu_process);
+
+} nyx_plugin_handler_t;
+
+#endif
+
 typedef struct afl_forkserver {
 
   /* a program that includes afl-forkserver needs to define these */
@@ -121,6 +157,17 @@ typedef struct afl_forkserver {
 
   u8 kill_signal;
 
+#ifdef __linux__
+  nyx_plugin_handler_t *nyx_handlers;
+  char *                out_dir_path;    /* path to the output directory     */
+  u8                    nyx_mode;        /* if running in nyx mode or not    */
+  bool                  nyx_parent;      /* create initial snapshot          */
+  bool                  nyx_standalone;  /* don't serialize the snapshot     */
+  void *                nyx_runner;      /* nyx runner object                */
+  u32                   nyx_id;          /* nyx runner id (0 -> master)      */
+  u32                   nyx_bind_cpu_id; /* nyx runner cpu id                */
+#endif
+
 } afl_forkserver_t;
 
 typedef enum fsrv_run_result {