Changeset 1633 for zzuf


Ignore:
Timestamp:
Jan 9, 2007, 11:07:35 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Bah, reverted that. We'll use -O for --offset.
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/doc/zzuf.1

    r1632 r1633  
    55\fBzzuf\fR [\fB\-cdiMnqS\fR] [\fB\-r\fR \fIratio\fR] [\fB\-s\fR \fIseed\fR | \fB\-s\fR \fIstart:stop\fR]
    66.br
    7                 [\fB\-F\fR \fIforks\fR] [\fB\-C\fR \fIcrashes\fR] [\fB\-O\fR \fIbytes\fR] [\fB\-T\fR \fIseconds\fR]
     7                [\fB\-F\fR \fIforks\fR] [\fB\-C\fR \fIcrashes\fR] [\fB\-B\fR \fIbytes\fR] [\fB\-T\fR \fIseconds\fR]
    88.br
    99                [\fB\-P\fR \fIprotect\fR] [\fB\-R\fR \fIrefuse\fR]
     
    3131interpret them as arguments for itself), eg:
    3232.PP
    33 \fB    zzuf \-O 1000 cat \-\- \-v /dev/zero\fR
     33\fB    zzuf \-B 1000 cat \-\- \-v /dev/zero\fR
    3434.PP
    3535When no program is specified, \fBzzuf\fR simply fuzzes the standard input, as
     
    3838\fB    zzuf < /dev/zero\fR
    3939.SH OPTIONS
     40.TP
     41\fB\-B\fR, \fB\-\-max\-bytes\fR=\fIn\fR
     42Automatically terminate child processes that output more than \fIn\fR bytes
     43on the standard output and standard error channels. This is useful to detect
     44infinite loops. See also the \fB\-T\fR flag.
    4045.TP
    4146\fB\-c\fR, \fB\-\-cmdline\fR
     
    96101\fB\-n\fR, \fB\-\-network\fR
    97102Fuzz the application's network input. By default \fBzzuf\fR only fuzzes files.
    98 .TP
    99 \fB\-O\fR, \fB\-\-max\-output\fR=\fIn\fR
    100 Automatically terminate child processes that output more than \fIn\fR bytes
    101 on the standard output and standard error channels. This is useful to detect
    102 infinite loops. See also the \fB\-T\fR flag.
    103103.TP
    104104\fB\-P\fR, \fB\-\-protect\fR=\fIlist\fR
     
    187187Automatically terminate child processes that run for more than \fIn\fR
    188188seconds. This is useful to detect infinite loops or processes stuck in other
    189 situations. See also the \fB\-O\fR flag.
     189situations. See also the \fB\-B\fR flag.
    190190.TP
    191191\fB\-h\fR, \fB\-\-help\fR
  • zzuf/trunk/src/zzuf.c

    r1632 r1633  
    7878static int endseed = 1;
    7979static int quiet = 0;
    80 static int maxoutput = -1;
     80static int maxbytes = -1;
    8181static int md5 = 0;
    8282static double maxtime = -1.0;
     
    110110        {
    111111            /* Long option, needs arg, flag, short option */
     112            { "max-bytes",   1, NULL, 'B' },
    112113            { "cmdline",     0, NULL, 'c' },
    113114            { "max-crashes", 1, NULL, 'C' },
     
    119120            { "md5",         0, NULL, 'M' },
    120121            { "network",     0, NULL, 'n' },
    121             { "max-output",  1, NULL, 'O' },
    122122            { "protect",     1, NULL, 'P' },
    123123            { "quiet",       0, NULL, 'q' },
     
    130130            { "version",     0, NULL, 'v' },
    131131        };
    132         int c = getopt_long(argc, argv, "cC:dE:F:iI:MnO:P:qr:R:s:ST:hv",
     132        int c = getopt_long(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:hv",
    133133                            long_options, &option_index);
    134134#   else
    135135#       define MOREINFO "Try `%s -h' for more information.\n"
    136         int c = getopt(argc, argv, "cC:dE:F:iI:MnO:P:qr:R:s:ST:hv");
     136        int c = getopt(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:hv");
    137137#   endif
    138138        if(c == -1)
     
    141141        switch(c)
    142142        {
     143        case 'B': /* --max-bytes */
     144            maxbytes = atoi(optarg);
     145            break;
    143146        case 'c': /* --cmdline */
    144147            cmdline = 1;
     
    179182        case 'n': /* --network */
    180183            setenv("ZZUF_NETWORK", "1", 1);
    181             break;
    182         case 'O': /* --max-output */
    183             maxoutput = atoi(optarg);
    184184            break;
    185185        case 'P': /* --protect */
     
    466466    {
    467467        if(child_list[i].status == STATUS_RUNNING
    468             && maxoutput >= 0 && child_list[i].bytes > maxoutput)
     468            && maxbytes >= 0 && child_list[i].bytes > maxbytes)
    469469        {
    470470            fprintf(stdout, "zzuf[seed=%i]: data exceeded, sending SIGTERM\n",
     
    675675    printf("Mandatory arguments to long options are mandatory for short options too.\n");
    676676#   ifdef HAVE_GETOPT_LONG
     677    printf("  -B, --max-bytes <n>      kill children that output more than <n> bytes\n");
    677678    printf("  -c, --cmdline            only fuzz files specified in the command line\n");
    678679    printf("  -C, --max-crashes <n>    stop after <n> children have crashed (default 1)\n");
     
    684685    printf("  -M, --md5                compute the output's MD5 hash\n");
    685686    printf("  -n, --network            fuzz network input\n");
    686     printf("  -O, --max-output <n>     kill children that output more than <n> bytes\n");
    687687    printf("  -P, --protect <list>     protect bytes and characters in <list>\n");
    688688    printf("  -q, --quiet              do not print children's messages\n");
     
    696696    printf("  -v, --version            output version information and exit\n");
    697697#   else
     698    printf("  -B <n>           kill children that output more than <n> bytes\n");
    698699    printf("  -c               only fuzz files specified in the command line\n");
    699700    printf("  -C <n>           stop after <n> children have crashed (default 1)\n");
     
    705706    printf("  -M               compute the output's MD5 hash\n");
    706707    printf("  -n               fuzz network input\n");
    707     printf("  -O <n>           kill children that output more than <n> bytes\n");
    708708    printf("  -P <list>        protect bytes and characters in <list>\n");
    709709    printf("  -q               do not print the fuzzed application's messages\n");
Note: See TracChangeset for help on using the changeset viewer.