diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2020-01-30 22:54:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 22:54:23 +0100 |
commit | 19ebdf31b999223e4965f701077f9af9d550e386 (patch) | |
tree | 9c6d27d58d0606d59725ef46766eb1961e908d31 /include/cmplog.h | |
parent | b050c1158398dd07e25a6cd65234da84e5656fa6 (diff) | |
parent | 6e9fce1c2d654c92dbf8e6b8cc21a88d8cba9496 (diff) | |
download | afl++-19ebdf31b999223e4965f701077f9af9d550e386.tar.gz |
Merge pull request #178 from vanhauser-thc/CmpLog
Cmp log
Diffstat (limited to 'include/cmplog.h')
-rw-r--r-- | include/cmplog.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/include/cmplog.h b/include/cmplog.h new file mode 100644 index 00000000..c02650ee --- /dev/null +++ b/include/cmplog.h @@ -0,0 +1,76 @@ +/* + american fuzzy lop++ - cmplog header + ------------------------------------ + + Originally written by Michal Zalewski + + Forkserver design by Jann Horn <jannhorn@googlemail.com> + + Now maintained by by Marc Heuse <mh@mh-sec.de>, + Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and + Andrea Fioraldi <andreafioraldi@gmail.com> + + Copyright 2016, 2017 Google Inc. All rights reserved. + Copyright 2019-2020 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. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Shared code to handle the shared memory. This is used by the fuzzer + as well the other components like afl-tmin, afl-showmap, etc... + + */ + +#ifndef _AFL_CMPLOG_H +#define _AFL_CMPLOG_H + +#include "config.h" + +#define CMP_MAP_W 65536 +#define CMP_MAP_H 256 + +#define SHAPE_BYTES(x) (x + 1) + +#define CMP_TYPE_INS 0 +#define CMP_TYPE_RTN 1 + +struct cmp_header { + + unsigned hits : 20; + + unsigned cnt : 20; + unsigned id : 16; + + unsigned shape : 5; // from 0 to 31 + unsigned type : 1; + +} __attribute__((packed)); + +struct cmp_operands { + + u64 v0; + u64 v1; + +}; + +struct cmpfn_operands { + + u8 v0[32]; + u8 v1[32]; + +}; + +typedef struct cmp_operands cmp_map_list[CMP_MAP_H]; + +struct cmp_map { + + struct cmp_header headers[CMP_MAP_W]; + struct cmp_operands log[CMP_MAP_W][CMP_MAP_H]; + +}; + +#endif + |