Last change
on this file since 1671 was
1671,
checked in by Sam Hocevar, 16 years ago
|
- Oops, ratio should be a double, not a float.
|
-
Property svn:keywords set to
Id
|
File size:
1.5 KB
|
Rev | Line | |
---|
[1470] | 1 | /* |
---|
| 2 | * zzuf - general purpose fuzzer |
---|
| 3 | * Copyright (c) 2006 Sam Hocevar <sam@zoy.org> |
---|
| 4 | * All Rights Reserved |
---|
| 5 | * |
---|
| 6 | * $Id: libzzuf.h 1671 2007-01-14 20:47:18Z sam $ |
---|
| 7 | * |
---|
| 8 | * This program is free software. It comes without any warranty, to |
---|
| 9 | * the extent permitted by applicable law. You can redistribute it |
---|
| 10 | * and/or modify it under the terms of the Do What The Fuck You Want |
---|
| 11 | * To Public License, Version 2, as published by Sam Hocevar. See |
---|
| 12 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | /* |
---|
| 16 | * libzzuf.h: preloaded wrapper library |
---|
| 17 | */ |
---|
| 18 | |
---|
[1535] | 19 | /* We use file descriptor 17 as the debug channel */ |
---|
| 20 | #define DEBUG_FILENO 17 |
---|
| 21 | |
---|
[1498] | 22 | /* We arbitrarily split files into 1024-byte chunks. Each chunk has an |
---|
| 23 | * associated seed that can be computed from the zzuf seed, the chunk |
---|
| 24 | * index and the fuzziness density. This allows us to predictably fuzz |
---|
| 25 | * any part of the file without reading the whole file. */ |
---|
| 26 | #define CHUNKBYTES 1024 |
---|
| 27 | |
---|
[1668] | 28 | /* Default seed is 0. Why not? */ |
---|
| 29 | #define DEFAULT_SEED 0 |
---|
| 30 | |
---|
| 31 | /* The default fuzzing ratio is, arbitrarily, 0.4% */ |
---|
| 32 | #define DEFAULT_RATIO 0.004f |
---|
| 33 | #define MIN_RATIO 0.00001f |
---|
| 34 | #define MAX_RATIO 5.0f |
---|
| 35 | |
---|
[1519] | 36 | struct fuzz |
---|
[1470] | 37 | { |
---|
[1663] | 38 | uint32_t seed; |
---|
[1671] | 39 | double ratio; |
---|
[1498] | 40 | int cur; |
---|
[1566] | 41 | #ifdef HAVE_FGETLN |
---|
| 42 | char *tmp; |
---|
| 43 | #endif |
---|
[1652] | 44 | uint8_t data[CHUNKBYTES]; |
---|
[1470] | 45 | }; |
---|
| 46 | |
---|
[1519] | 47 | /* Internal variables */ |
---|
[1663] | 48 | extern int _zz_ready; |
---|
| 49 | extern int _zz_disabled; |
---|
| 50 | extern int _zz_hasdebug; |
---|
| 51 | extern int _zz_signal; |
---|
| 52 | extern int _zz_memory; |
---|
| 53 | extern int _zz_network; |
---|
| 54 | extern int _zz_autoinc; |
---|
[1470] | 55 | |
---|
| 56 | /* Library initialisation shit */ |
---|
[1523] | 57 | extern void _zz_init(void) __attribute__((constructor)); |
---|
| 58 | extern void _zz_fini(void) __attribute__((destructor)); |
---|
[1470] | 59 | |
---|
Note: See
TracBrowser
for help on using the repository browser.