diff options
author | van Hauser <vh@thc.org> | 2020-07-30 11:11:30 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-07-30 11:11:30 +0200 |
commit | 49b77207dd870bc2e2e1b283f46504e27fce432f (patch) | |
tree | 5cb69d1ef4fcb040a173d201372b852292569c90 /examples/aflpp_driver/aflpp_driver_test.c | |
parent | 35a448ee921158c586177ff8fe0cd82da4345f68 (diff) | |
download | afl++-49b77207dd870bc2e2e1b283f46504e27fce432f.tar.gz |
aflpp driver cpp -> c
Diffstat (limited to 'examples/aflpp_driver/aflpp_driver_test.c')
-rw-r--r-- | examples/aflpp_driver/aflpp_driver_test.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/aflpp_driver/aflpp_driver_test.c b/examples/aflpp_driver/aflpp_driver_test.c new file mode 100644 index 00000000..83278f5c --- /dev/null +++ b/examples/aflpp_driver/aflpp_driver_test.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> + +#include "hash.h" + +int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + + fprintf(stderr, "FUNC crc: %016llx len: %lu\n", hash64((u8*)Data, (unsigned int) Size, (unsigned long long int) 0xa5b35705), Size); + + if (Size < 5) + return 0; + + if (Data[0] == 'F') + if (Data[1] == 'A') + if (Data[2] == '$') + if (Data[3] == '$') + if (Data[4] == '$') + abort(); + + return 0; + +} |