source: zzuf/trunk/src/libzzuf.h @ 1718

Last change on this file since 1718 was 1718, checked in by Sam Hocevar, 14 years ago
  • Carry DEBUG_FILENO in the ZZUF_DEBUG environment variable.
  • Property svn:keywords set to Id
File size: 1.4 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 1718 2007-01-25 22:34:28Z 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
33struct fuzz
34{
35    uint32_t seed;
36    double ratio;
37    int cur;
38#ifdef HAVE_FGETLN
39    char *tmp;
40#endif
41    uint8_t data[CHUNKBYTES];
42};
43
44/* Internal variables */
45extern int _zz_ready;
46extern int _zz_disabled;
47extern int _zz_debugfd;
48extern int _zz_signal;
49extern int _zz_memory;
50extern int _zz_network;
51extern int _zz_autoinc;
52
53/* This function is needed to initialise memory functions */
54extern void _zz_mem_init(void);
55
Note: See TracBrowser for help on using the repository browser.