aboutsummaryrefslogtreecommitdiff
path: root/qemu_mode
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2019-12-02 14:34:21 +0100
committerAndrea Fioraldi <andreafioraldi@gmail.com>2019-12-02 14:34:21 +0100
commit124ec8d297269b6b3066123782a7e92c802d2248 (patch)
treef18a4a42111ea2faa08ef2183d995aa254146e7b /qemu_mode
parente9ed056913b4ce711ae47699c1937779036259e7 (diff)
downloadafl++-124ec8d297269b6b3066123782a7e92c802d2248.tar.gz
code format (contributors, do it!)
Diffstat (limited to 'qemu_mode')
-rw-r--r--qemu_mode/libcompcov/libcompcov.so.c1
-rw-r--r--qemu_mode/patches/afl-qemu-cpu-inl.h6
-rw-r--r--qemu_mode/patches/afl-qemu-floats.h40
3 files changed, 26 insertions, 21 deletions
diff --git a/qemu_mode/libcompcov/libcompcov.so.c b/qemu_mode/libcompcov/libcompcov.so.c
index d58e45dd..dee8cfda 100644
--- a/qemu_mode/libcompcov/libcompcov.so.c
+++ b/qemu_mode/libcompcov/libcompcov.so.c
@@ -340,7 +340,6 @@ int memcmp(const void* mem1, const void* mem2, size_t len) {
// TODO bcmp
-
/* Common libraries wrappers (from honggfuzz) */
/*
diff --git a/qemu_mode/patches/afl-qemu-cpu-inl.h b/qemu_mode/patches/afl-qemu-cpu-inl.h
index 7c6d3341..70f5ef9d 100644
--- a/qemu_mode/patches/afl-qemu-cpu-inl.h
+++ b/qemu_mode/patches/afl-qemu-cpu-inl.h
@@ -83,8 +83,8 @@ __thread abi_ulong afl_prev_loc;
/* Set in the child process in forkserver mode: */
-static int forkserver_installed = 0;
-static int disable_caching = 0;
+static int forkserver_installed = 0;
+static int disable_caching = 0;
unsigned char afl_fork_child;
unsigned int afl_forksrv_pid;
@@ -207,7 +207,7 @@ static void afl_setup(void) {
behaviour, and seems to work alright? */
rcu_disable_atfork();
-
+
disable_caching = getenv("AFL_QEMU_DISABLE_CACHE") != NULL;
is_persistent = getenv("AFL_QEMU_PERSISTENT_ADDR") != NULL;
diff --git a/qemu_mode/patches/afl-qemu-floats.h b/qemu_mode/patches/afl-qemu-floats.h
index 0b2ac2ae..7fea04e7 100644
--- a/qemu_mode/patches/afl-qemu-floats.h
+++ b/qemu_mode/patches/afl-qemu-floats.h
@@ -35,24 +35,30 @@
#include "afl-qemu-common.h"
union afl_float32 {
+
float32 f;
struct {
- u64 sign : 1;
- u64 exp : 7;
+
+ u64 sign : 1;
+ u64 exp : 7;
u64 frac : 24;
+
};
-};
+};
union afl_float64 {
+
float64 f;
struct {
- u64 sign : 1;
- u64 exp : 11;
+
+ u64 sign : 1;
+ u64 exp : 11;
u64 frac : 52;
+
};
-};
+};
// TODO 16 and 128 bits floats
// TODO figure out why float*_unpack_canonical does not work
@@ -65,11 +71,11 @@ void afl_float_compcov_log_32(target_ulong cur_loc, float32 arg1, float32 arg2,
if (cur_loc >= afl_inst_rms) return;
- //float_status* s = (float_status*)status;
- //FloatParts a = float32_unpack_canonical(arg1, s);
- //FloatParts b = float32_unpack_canonical(arg2, s);
- union afl_float32 a = { .f = arg1 };
- union afl_float32 b = { .f = arg2 };
+ // float_status* s = (float_status*)status;
+ // FloatParts a = float32_unpack_canonical(arg1, s);
+ // FloatParts b = float32_unpack_canonical(arg2, s);
+ union afl_float32 a = {.f = arg1};
+ union afl_float32 b = {.f = arg2};
// if (is_nan(a.cls) || is_nan(b.cls)) return;
@@ -97,11 +103,11 @@ void afl_float_compcov_log_64(target_ulong cur_loc, float64 arg1, float64 arg2,
if (cur_loc >= afl_inst_rms) return;
- //float_status* s = (float_status*)status;
- //FloatParts a = float64_unpack_canonical(arg1, s);
- //FloatParts b = float64_unpack_canonical(arg2, s);
- union afl_float64 a = { .f = arg1 };
- union afl_float64 b = { .f = arg2 };
+ // float_status* s = (float_status*)status;
+ // FloatParts a = float64_unpack_canonical(arg1, s);
+ // FloatParts b = float64_unpack_canonical(arg2, s);
+ union afl_float64 a = {.f = arg1};
+ union afl_float64 b = {.f = arg2};
// if (is_nan(a.cls) || is_nan(b.cls)) return;
@@ -196,7 +202,7 @@ void afl_float_compcov_log_80(target_ulong cur_loc, floatx80 arg1,
if ((arg1.low & 0xff00) == (arg2.low & 0xff00)) {
INC_AFL_AREA(idx + 9);
- //if ((arg1.low & 0xff) == (arg2.low & 0xff))
+ // if ((arg1.low & 0xff) == (arg2.low & 0xff))
// INC_AFL_AREA(idx + 10);
}