diff options
author | van Hauser <vh@thc.org> | 2020-12-11 11:38:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-11 11:38:22 +0100 |
commit | 12d62d539353517abee8069df6e591f4fc474e93 (patch) | |
tree | c7ec08c39d3153ab3de1602fbda0739dd32dd37e /utils/aflpp_driver/aflpp_driver_test.c | |
parent | 3997d06cbd09e12cd0367170b3e2698ee71dd8cf (diff) | |
parent | d5ded820e5b610f330cf23f53c21c169032a725a (diff) | |
download | afl++-12d62d539353517abee8069df6e591f4fc474e93.tar.gz |
Merge pull request #617 from AFLplusplus/dev
push to stable
Diffstat (limited to 'utils/aflpp_driver/aflpp_driver_test.c')
-rw-r--r-- | utils/aflpp_driver/aflpp_driver_test.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/utils/aflpp_driver/aflpp_driver_test.c b/utils/aflpp_driver/aflpp_driver_test.c new file mode 100644 index 00000000..b4ff6bc6 --- /dev/null +++ b/utils/aflpp_driver/aflpp_driver_test.c @@ -0,0 +1,32 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> + +#include "hash.h" + +void __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) { + + if (Size < 5) return; + + if (Data[0] == 'F') + if (Data[1] == 'A') + if (Data[2] == '$') + if (Data[3] == '$') + if (Data[4] == '$') abort(); + +} + +int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + + if (Size) + fprintf(stderr, "FUNC crc: %016llx len: %lu\n", + hash64((u8 *)Data, (unsigned int)Size, + (unsigned long long int)0xa5b35705), + Size); + + crashme(Data, Size); + + return 0; + +} + |