* Change -i/-e to -I/-E.
This commit is contained in:
parent
291a1ca6c1
commit
03abccd656
6
README
6
README
@ -22,7 +22,7 @@ input and restricting fuzzing to filenames matching the regular expression
|
||||
"foo[.]jpeg" (because convert will also open its own configuration files and
|
||||
we do not want zzuf to fuzz them):
|
||||
|
||||
# zzuf -i 'foo[.]jpeg' convert -- foo.jpeg -format tga /dev/null
|
||||
# zzuf -I 'foo[.]jpeg' convert -- foo.jpeg -format tga /dev/null
|
||||
|
||||
Fuzz the input of VLC, using file movie.avi as the original input, and
|
||||
generate fuzzy-movie.avi which is a file that can be fed to VLC to reproduce
|
||||
@ -36,12 +36,12 @@ the behaviour without using zzuf:
|
||||
Fuzz mplayer's input with seeds 0 to 9999 and kill processes that take more
|
||||
than one minute to read the movie file:
|
||||
|
||||
# zzuf -q -s 0:10000 -T 60 -r 0.02 -i movie.avi \
|
||||
# zzuf -q -s 0:10000 -T 60 -r 0.02 -I movie.avi \
|
||||
mplayer movie.avi -- -benchmark -vo null -fps 1000
|
||||
|
||||
Same as above with up to 15 simultaneous child processes because we are
|
||||
playing a sound file:
|
||||
|
||||
# zzuf -F 15 -q -s 0:10000 -T 60 -r 0.02 -i song.mp3 \
|
||||
# zzuf -F 15 -q -s 0:10000 -T 60 -r 0.02 -I song.mp3 \
|
||||
mplayer song.mp3 -- -benchmark -ao null
|
||||
|
||||
|
||||
12
doc/zzuf.1
12
doc/zzuf.1
@ -32,10 +32,10 @@ zzuf \- multiple purpose fuzzer
|
||||
.IP
|
||||
.PD
|
||||
[
|
||||
.B \-i
|
||||
.B \-I
|
||||
.I include
|
||||
] [
|
||||
.B \-e
|
||||
.B \-E
|
||||
.I exclude
|
||||
]
|
||||
.I COMMAND [ARGS]...
|
||||
@ -111,13 +111,13 @@ situations.
|
||||
Hide the output of the fuzzed application. This is useful if the application
|
||||
is very verbose but only its exit code is really useful to you.
|
||||
.TP
|
||||
.B \-i, \-\-include <regex>
|
||||
.B \-I, \-\-include <regex>
|
||||
Only fuzz files whose name matches the
|
||||
.B <regex>
|
||||
regular expression. Use this for instance if your application reads
|
||||
configuration files in many places and you do not want them to be fuzzed.
|
||||
.TP
|
||||
.B \-e, \-\-exclude <regex>
|
||||
.B \-E, \-\-exclude <regex>
|
||||
Do not fuzz files whose name matches the
|
||||
.B <regex>
|
||||
regular expression. This option supersedes anything that is specified by the
|
||||
@ -167,7 +167,7 @@ will also open its own configuration files and we do not want
|
||||
to fuzz them):
|
||||
.nf
|
||||
|
||||
.B % zzuf -i "foo[.]jpeg" convert -- foo.jpeg -format tga /dev/null
|
||||
.B % zzuf -I "foo[.]jpeg" convert -- foo.jpeg -format tga /dev/null
|
||||
|
||||
.fi
|
||||
Fuzz the input of
|
||||
@ -197,7 +197,7 @@ and killing
|
||||
if it takes more than one minute to read the file:
|
||||
.fn
|
||||
|
||||
.B % zzuf -q -s 0:10000 -F 3 -T 60 -r 0.02 -i movie.avi mplayer movie.avi -- -benchmark -vo null -fps 1000
|
||||
.B % zzuf -q -s 0:10000 -F 3 -T 60 -r 0.02 -I movie.avi mplayer movie.avi -- -benchmark -vo null -fps 1000
|
||||
|
||||
.fi
|
||||
.RI
|
||||
|
||||
22
src/zzuf.c
22
src/zzuf.c
@ -95,8 +95,8 @@ int main(int argc, char *argv[])
|
||||
static struct option long_options[] =
|
||||
{
|
||||
/* Long option, needs arg, flag, short option */
|
||||
{ "include", 1, NULL, 'i' },
|
||||
{ "exclude", 1, NULL, 'e' },
|
||||
{ "include", 1, NULL, 'I' },
|
||||
{ "exclude", 1, NULL, 'E' },
|
||||
{ "seed", 1, NULL, 's' },
|
||||
{ "ratio", 1, NULL, 'r' },
|
||||
{ "fork", 1, NULL, 'F' },
|
||||
@ -107,21 +107,21 @@ int main(int argc, char *argv[])
|
||||
{ "help", 0, NULL, 'h' },
|
||||
{ "version", 0, NULL, 'v' },
|
||||
};
|
||||
int c = getopt_long(argc, argv, "i:e:s:r:F:B:T:qdhv",
|
||||
int c = getopt_long(argc, argv, "I:E:s:r:F:B:T:qdhv",
|
||||
long_options, &option_index);
|
||||
# else
|
||||
# define MOREINFO "Try `%s -h' for more information.\n"
|
||||
int c = getopt(argc, argv, "i:e:s:r:F:B:T:qdhv");
|
||||
int c = getopt(argc, argv, "I:E:s:r:F:B:T:qdhv");
|
||||
# endif
|
||||
if(c == -1)
|
||||
break;
|
||||
|
||||
switch(c)
|
||||
{
|
||||
case 'i': /* --include */
|
||||
case 'I': /* --include */
|
||||
setenv("ZZUF_INCLUDE", optarg, 1);
|
||||
break;
|
||||
case 'e': /* --exclude */
|
||||
case 'E': /* --exclude */
|
||||
setenv("ZZUF_EXCLUDE", optarg, 1);
|
||||
break;
|
||||
case 's': /* --seed */
|
||||
@ -427,7 +427,7 @@ static void usage(void)
|
||||
{
|
||||
printf("Usage: zzuf [ -vqdh ] [ -r ratio ] [ -s seed | -s start:stop]\n");
|
||||
printf(" [ -F children ] [ -B bytes ] [ -T seconds ]\n");
|
||||
printf(" [ -i include ] [ -e exclude ] COMMAND [ARGS]...\n");
|
||||
printf(" [ -I include ] [ -E exclude ] COMMAND [ARGS]...\n");
|
||||
printf("Run COMMAND and randomly fuzz its input files.\n");
|
||||
printf("\n");
|
||||
printf("Mandatory arguments to long options are mandatory for short options too.\n");
|
||||
@ -439,8 +439,8 @@ static void usage(void)
|
||||
printf(" -B, --max-bytes <n> kill children that output more than <n> bytes\n");
|
||||
printf(" -T, --max-time <n> kill children that run for more than <n> seconds\n");
|
||||
printf(" -q, --quiet do not print children's messages\n");
|
||||
printf(" -i, --include <regex> only fuzz files matching <regex>\n");
|
||||
printf(" -e, --exclude <regex> do not fuzz files matching <regex>\n");
|
||||
printf(" -I, --include <regex> only fuzz files matching <regex>\n");
|
||||
printf(" -E, --exclude <regex> do not fuzz files matching <regex>\n");
|
||||
printf(" -d, --debug print debug messages\n");
|
||||
printf(" -h, --help display this help and exit\n");
|
||||
printf(" -v, --version output version information and exit\n");
|
||||
@ -452,8 +452,8 @@ static void usage(void)
|
||||
printf(" -B <n> kill children that output more than <n> bytes\n");
|
||||
printf(" -T <n> kill children that run for more than <n> seconds\n");
|
||||
printf(" -q do not print the fuzzed application's messages\n");
|
||||
printf(" -i <regex> only fuzz files matching <regex>\n");
|
||||
printf(" -e <regex> do not fuzz files matching <regex>\n");
|
||||
printf(" -I <regex> only fuzz files matching <regex>\n");
|
||||
printf(" -E <regex> do not fuzz files matching <regex>\n");
|
||||
printf(" -d print debug messages\n");
|
||||
printf(" -h display this help and exit\n");
|
||||
printf(" -v output version information and exit\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user