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

Last change on this file since 1701 was 1701, checked in by Sam Hocevar, 14 years ago
  • Added DLL initialisation code for Win32.
  • 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 1701 2007-01-23 15:38: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
19/* We use file descriptor 17 as the debug channel */
20#define DEBUG_FILENO 17
21
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
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
36struct fuzz
37{
38    uint32_t seed;
39    double ratio;
40    int cur;
41#ifdef HAVE_FGETLN
42    char *tmp;
43#endif
44    uint8_t data[CHUNKBYTES];
45};
46
47/* Internal variables */
48extern int _zz_ready;
49extern int _zz_disabled;
50extern int _zz_hasdebug;
51extern int _zz_signal;
52extern int _zz_memory;
53extern int _zz_network;
54extern int _zz_autoinc;
55
Note: See TracBrowser for help on using the repository browser.