1 // This file is distributed under the University of Illinois Open Source
2 // License. See LICENSE.TXT for details.
4 // The fuzzer must find several constants with swapped bytes.
10 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
11 if (Size < 14) return 0;
15 memcpy(&x, Data, sizeof(x));
16 memcpy(&y, Data + Size / 2, sizeof(y));
17 memcpy(&z, Data + Size - sizeof(z), sizeof(z));
19 x = __builtin_bswap64(x);
20 y = __builtin_bswap32(y);
21 z = __builtin_bswap32(z);
22 const bool k32bit = sizeof(void*) == 4;
24 if ((k32bit || x == 0x46555A5A5A5A5546ULL) &&
29 if (Data[Size - 5] == 'z') {
30 fprintf(stderr, "BINGO; Found the target\n");