Last change
on this file since 1732 was
1732,
checked in by Sam Hocevar, 16 years ago
|
- Fixed a few signed/unsigned confusions.
|
-
Property svn:keywords set to
Id
|
File size:
1.5 KB
|
Line | |
---|
1 | /* |
---|
2 | * zzuf - general purpose fuzzer |
---|
3 | * Copyright (c) 2006 Sam Hocevar <sam@zoy.org> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * $Id: libzzuf.h 1732 2007-02-01 22:20:48Z 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 | |
---|
19 | /* We arbitrarily split files into 1024-byte chunks. Each chunk has an |
---|
20 | * associated seed that can be computed from the zzuf seed, the chunk |
---|
21 | * index and the fuzziness density. This allows us to predictably fuzz |
---|
22 | * any part of the file without reading the whole file. */ |
---|
23 | #define CHUNKBYTES 1024 |
---|
24 | |
---|
25 | /* Default seed is 0. Why not? */ |
---|
26 | #define DEFAULT_SEED 0 |
---|
27 | |
---|
28 | /* The default fuzzing ratio is, arbitrarily, 0.4% */ |
---|
29 | #define DEFAULT_RATIO 0.004f |
---|
30 | #define MIN_RATIO 0.00001f |
---|
31 | #define MAX_RATIO 5.0f |
---|
32 | |
---|
33 | struct fuzz |
---|
34 | { |
---|
35 | uint32_t seed; |
---|
36 | double ratio; |
---|
37 | int cur; |
---|
38 | #ifdef HAVE_FGETLN |
---|
39 | char *tmp; |
---|
40 | #endif |
---|
41 | int uflag; int64_t upos; uint8_t uchar; /* ungetc stuff */ |
---|
42 | uint8_t data[CHUNKBYTES]; |
---|
43 | }; |
---|
44 | |
---|
45 | /* Internal variables */ |
---|
46 | extern int _zz_ready; |
---|
47 | extern int _zz_disabled; |
---|
48 | extern int _zz_debugfd; |
---|
49 | extern int _zz_signal; |
---|
50 | extern int _zz_memory; |
---|
51 | extern int _zz_network; |
---|
52 | extern int _zz_autoinc; |
---|
53 | |
---|
54 | /* This function is needed to initialise memory functions */ |
---|
55 | extern void _zz_mem_init(void); |
---|
56 | |
---|
Note: See
TracBrowser
for help on using the repository browser.