@@ -1,335 +0,0 @@
1−/*
2− american fuzzy lop - vaguely configurable bits
3− ----------------------------------------------
4−
5− Written and maintained by Michal Zalewski <lcamtuf@google.com>
6−
7− Copyright 2013, 2014, 2015 Google Inc. All rights reserved.
8−
9− Licensed under the Apache License, Version 2.0 (the "License");
10− you may not use this file except in compliance with the License.
11− You may obtain a copy of the License at:
12−
13− http://www.apache.org/licenses/LICENSE-2.0
14−
15− */
16−
17−#ifndef _HAVE_CONFIG_H
18−#define _HAVE_CONFIG_H
19−
20−#include "afl-types.h"
21−
22−/******************************************************
23− * *
24− * Settings that may be of interest to power users: *
25− * *
26− ******************************************************/
27−
28−/* Comment out to disable terminal colors: */
29−
30−#define USE_COLOR
31−
32−/* Comment out to disable fancy ANSI boxes and use poor man's 7-bit UI: */
33−
34−#define FANCY_BOXES
35−
36−/* Default timeout for fuzzed code (milliseconds): */
37−
38−#define EXEC_TIMEOUT 1000
39−
40−/* Timeout rounding factor when auto-scaling (milliseconds): */
41−
42−#define EXEC_TM_ROUND 20
43−
44−/* Default memory limit for child process (MB): */
45−
46−#ifndef __x86_64__
47−# define MEM_LIMIT 25
48−#else
49−# define MEM_LIMIT 50
50−#endif /* ^!__x86_64__ */
51−
52−/* Default memory limit when running in QEMU mode (MB): */
53−
54−#define MEM_LIMIT_QEMU 200
55−
56−/* Number of calibration cycles per every new test case (and for test
57− cases that show variable behavior): */
58−
59−#define CAL_CYCLES 10
60−#define CAL_CYCLES_LONG 40
61−
62−/* The same, but when AFL_NO_VAR_CHECK is set in the environment: */
63−
64−#define CAL_CYCLES_NO_VAR 4
65−
66−/* Number of subsequent hangs before abandoning an input file: */
67−
68−#define HANG_LIMIT 250
69−
70−/* Maximum number of unique hangs or crashes to record: */
71−
72−#define KEEP_UNIQUE_HANG 500
73−#define KEEP_UNIQUE_CRASH 5000
74−
75−/* Baseline number of random tweaks during a single 'havoc' stage: */
76−
77−#define HAVOC_CYCLES 5000
78−
79−/* Maximum multiplier for the above (should be a power of two, beware
80− of 32-bit int overflows): */
81−
82−#define HAVOC_MAX_MULT 16
83−
84−/* Absolute minimum number of havoc cycles (after all adjustments): */
85−
86−#define HAVOC_MIN 10
87−
88−/* Maximum stacking for havoc-stage tweaks. The actual value is calculated
89− like this:
90−
91− n = random between 1 and HAVOC_STACK_POW2
92− stacking = 2^n
93−
94− In other words, the default (n = 7) produces 2, 4, 8, 16, 32, 64, or
95− 128 stacked tweaks: */
96−
97−#define HAVOC_STACK_POW2 7
98−
99−/* Caps on block sizes for cloning and deletion operations. Each of these
100− ranges has a 33% probability of getting picked, except for the first
101− two cycles where smaller blocks are favored: */
102−
103−#define HAVOC_BLK_SMALL 32
104−#define HAVOC_BLK_MEDIUM 128
105−#define HAVOC_BLK_LARGE 1500
106−
107−/* Probabilities of skipping non-favored entries in the queue, expressed as
108− percentages: */
109−
110−#define SKIP_TO_NEW_PROB 99 /* ...when there are new, pending favorites */
111−#define SKIP_NFAV_OLD_PROB 95 /* ...no new favs, cur entry already fuzzed */
112−#define SKIP_NFAV_NEW_PROB 75 /* ...no new favs, cur entry not fuzzed yet */
113−
114−/* Splicing cycle count: */
115−
116−#define SPLICE_CYCLES 20
117−
118−/* Nominal per-splice havoc cycle length: */
119−
120−#define SPLICE_HAVOC 500
121−
122−/* Maximum offset for integer addition / subtraction stages: */
123−
124−#define ARITH_MAX 35
125−
126−/* Limits for the test case trimmer. The absolute minimum chunk size; and
127− the starting and ending divisors for chopping up the input file: */
128−
129−#define TRIM_MIN_BYTES 4
130−#define TRIM_START_STEPS 16
131−#define TRIM_END_STEPS 1024
132−
133−/* Maximum size of input file, in bytes (keep under 100MB): */
134−
135−#define MAX_FILE (1 * 1024 * 1024)
136−
137−/* The same, for the test case minimizer: */
138−
139−#define TMIN_MAX_FILE (10 * 1024 * 1024)
140−
141−/* Block normalization steps for afl-tmin: */
142−
143−#define TMIN_SET_MIN_SIZE 4
144−#define TMIN_SET_STEPS 128
145−
146−/* Maximum dictionary token size (-x), in bytes: */
147−
148−#define MAX_DICT_FILE 128
149−
150−/* Length limits for auto-detected dictionary tokens: */
151−
152−#define MIN_AUTO_EXTRA 3
153−#define MAX_AUTO_EXTRA 32
154−
155−/* Maximum number of user-specified dictionary tokens to use in deterministic
156− steps; past this point, the "extras/user" step will be still carried out,
157− but with proportionally lower odds: */
158−
159−#define MAX_DET_EXTRAS 200
160−
161−/* Maximum number of auto-extracted dictionary tokens to actually use in fuzzing
162− (first value), and to keep in memory as candidates. The latter should be much
163− higher than the former. */
164−
165−#define USE_AUTO_EXTRAS 50
166−#define MAX_AUTO_EXTRAS (USE_AUTO_EXTRAS * 10)
167−
168−/* Scaling factor for the effector map used to skip some of the more
169− expensive deterministic steps. The actual divisor is set to
170− 2^EFF_MAP_SCALE2 bytes: */
171−
172−#define EFF_MAP_SCALE2 3
173−
174−/* Minimum input file length at which the effector logic kicks in: */
175−
176−#define EFF_MIN_LEN 128
177−
178−/* Maximum effector density past which everything is just fuzzed
179− unconditionally (%): */
180−
181−#define EFF_MAX_PERC 90
182−
183−/* UI refresh frequency (Hz): */
184−
185−#define UI_TARGET_HZ 5
186−
187−/* Fuzzer stats file and plot update intervals (sec): */
188−
189−#define STATS_UPDATE_SEC 60
190−#define PLOT_UPDATE_SEC 5
191−
192−/* Smoothing divisor for CPU load and exec speed stats (1 - no smoothing). */
193−
194−#define AVG_SMOOTHING 16
195−
196−/* Sync interval (every n havoc cycles): */
197−
198−#define SYNC_INTERVAL 5
199−
200−/* Output directory reuse grace period (minutes): */
201−
202−#define OUTPUT_GRACE 25
203−
204−/* Uncomment to use simple file names (id_NNNNNN): */
205−
206−// #define SIMPLE_FILES
207−
208−/* List of interesting values to use in fuzzing. */
209−
210−#define INTERESTING_8 \
211− -128, /* Overflow signed 8-bit when decremented */ \
212− -1, /* */ \
213− 0, /* */ \
214− 1, /* */ \
215− 16, /* One-off with common buffer size */ \
216− 32, /* One-off with common buffer size */ \
217− 64, /* One-off with common buffer size */ \
218− 100, /* One-off with common buffer size */ \
219− 127 /* Overflow signed 8-bit when incremented */
220−
221−#define INTERESTING_16 \
222− -32768, /* Overflow signed 16-bit when decremented */ \
223− -129, /* Overflow signed 8-bit */ \
224− 128, /* Overflow signed 8-bit */ \
225− 255, /* Overflow unsig 8-bit when incremented */ \
226− 256, /* Overflow unsig 8-bit */ \
227− 512, /* One-off with common buffer size */ \
228− 1000, /* One-off with common buffer size */ \
229− 1024, /* One-off with common buffer size */ \
230− 4096, /* One-off with common buffer size */ \
231− 32767 /* Overflow signed 16-bit when incremented */
232−
233−#define INTERESTING_32 \
234− -2147483648LL, /* Overflow signed 32-bit when decremented */ \
235− -100663046, /* Large negative number (endian-agnostic) */ \
236− -32769, /* Overflow signed 16-bit */ \
237− 32768, /* Overflow signed 16-bit */ \
238− 65535, /* Overflow unsig 16-bit when incremented */ \
239− 65536, /* Overflow unsig 16 bit */ \
240− 100663045, /* Large positive number (endian-agnostic) */ \
241− 2147483647 /* Overflow signed 32-bit when incremented */
242−
243−/***********************************************************
244− * *
245− * Really exotic stuff you probably don't want to touch: *
246− * *
247− ***********************************************************/
248−
249−/* Call count interval between reseeding the libc PRNG from /dev/urandom: */
250−
251−#define RESEED_RNG 10000
252−
253−/* Maximum line length passed from GCC to 'as' and used for parsing
254− configuration files: */
255−
256−#define MAX_LINE 8192
257−
258−/* Environment variable used to pass SHM ID to the called program. */
259−
260−#define SHM_ENV_VAR "__AFL_SHM_ID"
261−
262−/* Other less interesting, internal-only variables. */
263−
264−#define CLANG_ENV_VAR "__AFL_CLANG_MODE"
265−#define AS_LOOP_ENV_VAR "__AFL_AS_LOOPCHECK"
266−
267−/* Distinctive bitmap signature used to indicate failed execution: */
268−
269−#define EXEC_FAIL_SIG 0xfee1dead
270−
271−/* Distinctive exit code used to indicate MSAN trip condition: */
272−
273−#define MSAN_ERROR 86
274−
275−/* Designated file descriptors for forkserver commands (the application will
276− use FORKSRV_FD and FORKSRV_FD + 1): */
277−
278−#define FORKSRV_FD 198
279−
280−/* Fork server init timeout multiplier: we'll wait the user-selected
281− timeout plus this much for the fork server to spin up. */
282−
283−#define FORK_WAIT_MULT 10
284−
285−/* Calibration timeout adjustments, to be a bit more generous when resuming
286− fuzzing sessions or trying to calibrate already-added internal finds.
287− The first value is a percentage, the other is in milliseconds: */
288−
289−#define CAL_TMOUT_PERC 125
290−#define CAL_TMOUT_ADD 50
291−
292−/* Number of chances to calibrate a case before giving up: */
293−
294−#define CAL_CHANCES 3
295−
296−/* Map size for the traced binary (2^MAP_SIZE_POW2). Must be greater than
297− 2; you probably want to keep it under 18 or so for performance reasons
298− (adjusting AFL_INST_RATIO when compiling is probably a better way to solve
299− problems with complex programs). You need to recompile the target binary
300− after changing this - otherwise, SEGVs may ensue. */
301−
302−#define MAP_SIZE_POW2 16
303−#define MAP_SIZE (1 << MAP_SIZE_POW2)
304−
305−/* Maximum allocator request size (keep well under INT_MAX): */
306−
307−#define MAX_ALLOC 0x40000000
308−
309−/* A made-up hashing seed: */
310−
311−#define HASH_CONST 0xa5b35705
312−
313−/* Constants for afl-gotcpu to control busy loop timing: */
314−
315−#define CTEST_TARGET_MS 5000
316−#define CTEST_BUSY_CYCLES (10 * 1000 * 1000)
317−
318−/* Uncomment this to use inferior block-coverage-based instrumentation. Note
319− that you need to recompile the target binary for this to have any effect: */
320−
321−// #define COVERAGE_ONLY
322−
323−/* Uncomment this to ignore hit counts and output just one bit per tuple.
324− As with the previous setting, you will need to recompile the target
325− binary: */
326−
327−// #define SKIP_COUNTS
328−
329−/* Uncomment this to use instrumentation data to record newly discovered paths,
330− but do not use them as seeds for fuzzing. This is useful for conveniently
331− measuring coverage that could be attained by a "dumb" fuzzing algorithm: */
332−
333−// #define IGNORE_FINDS
334−
335−#endif /* ! _HAVE_CONFIG_H */