Skip to content

Commit

Permalink
Add option -V: Show version number and exit (google#82)
Browse files Browse the repository at this point in the history
* Add option -V to afl-analyze: Show version number and exit

* Add option -V to afl-fuzz: Show version number and exit

* Show option -V to afl-showmap: Show version number and exit

* Add option -V to afl-tmin: Show version number and exit
  • Loading branch information
wolframroesler authored Aug 4, 2020
1 parent fc718c7 commit fcf734a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
11 changes: 10 additions & 1 deletion afl-analyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,10 @@ static void usage(u8* argv0) {

" -e - look for edge coverage only, ignore hit counts\n\n"

"Other stuff:\n\n"

" -V - show version number and exit\n\n"

"For additional tips, please consult %s/README.\n\n",

argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
Expand Down Expand Up @@ -959,7 +963,7 @@ int main(int argc, char** argv) {

SAYF(cCYA "afl-analyze " cBRI VERSION cRST " by <[email protected]>\n");

while ((opt = getopt(argc,argv,"+i:f:m:t:eQ")) > 0)
while ((opt = getopt(argc,argv,"+i:f:m:t:eQV")) > 0)

switch (opt) {

Expand Down Expand Up @@ -1039,6 +1043,11 @@ int main(int argc, char** argv) {
qemu_mode = 1;
break;

case 'V': /* Show version number */

/* Version number has been printed already, just quit. */
exit(0);

default:

usage(argv[0]);
Expand Down
10 changes: 8 additions & 2 deletions afl-fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -7119,7 +7119,8 @@ static void usage(u8* argv0) {

" -T text - text banner to show on the screen\n"
" -M / -S id - distributed mode (see parallel_fuzzing.txt)\n"
" -C - crash exploration mode (the peruvian rabbit thing)\n\n"
" -C - crash exploration mode (the peruvian rabbit thing)\n"
" -V - show version number and exit\n\n"

"For additional tips, please consult %s/README.\n\n",

Expand Down Expand Up @@ -7776,7 +7777,7 @@ int main(int argc, char** argv) {
gettimeofday(&tv, &tz);
srandom(tv.tv_sec ^ tv.tv_usec ^ getpid());

while ((opt = getopt(argc, argv, "+i:o:f:m:t:T:dnCB:S:M:x:Q")) > 0)
while ((opt = getopt(argc, argv, "+i:o:f:m:t:T:dnCB:S:M:x:QV")) > 0)

switch (opt) {

Expand Down Expand Up @@ -7944,6 +7945,11 @@ int main(int argc, char** argv) {

break;

case 'V': /* Show version number */

/* Version number has been printed already, just quit. */
exit(0);

default:

usage(argv[0]);
Expand Down
10 changes: 8 additions & 2 deletions afl-showmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ static void usage(u8* argv0) {

" -q - sink program's output and don't show messages\n"
" -e - show edge coverage only, ignore hit counts\n"
" -c - allow core dumps\n\n"
" -c - allow core dumps\n"
" -V - show version number and exit\n\n"

"This tool displays raw tuple data captured by AFL instrumentation.\n"
"For additional help, consult %s/README.\n\n" cRST,
Expand Down Expand Up @@ -634,7 +635,7 @@ int main(int argc, char** argv) {

doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;

while ((opt = getopt(argc,argv,"+o:m:t:A:eqZQbc")) > 0)
while ((opt = getopt(argc,argv,"+o:m:t:A:eqZQbcV")) > 0)

switch (opt) {

Expand Down Expand Up @@ -745,6 +746,11 @@ int main(int argc, char** argv) {
keep_cores = 1;
break;

case 'V':

show_banner();
exit(0);

default:

usage(argv[0]);
Expand Down
11 changes: 10 additions & 1 deletion afl-tmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,10 @@ static void usage(u8* argv0) {
" -e - solve for edge coverage only, ignore hit counts\n"
" -x - treat non-zero exit codes as crashes\n\n"

"Other stuff:\n\n"

" -V - show version number and exit\n\n"

"For additional tips, please consult %s/README.\n\n",

argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
Expand Down Expand Up @@ -986,7 +990,7 @@ int main(int argc, char** argv) {

SAYF(cCYA "afl-tmin " cBRI VERSION cRST " by <[email protected]>\n");

while ((opt = getopt(argc,argv,"+i:o:f:m:t:B:xeQ")) > 0)
while ((opt = getopt(argc,argv,"+i:o:f:m:t:B:xeQV")) > 0)

switch (opt) {

Expand Down Expand Up @@ -1098,6 +1102,11 @@ int main(int argc, char** argv) {
read_bitmap(optarg);
break;

case 'V': /* Show version number */

/* Version number has been printed already, just quit. */
exit(0);

default:

usage(argv[0]);
Expand Down

0 comments on commit fcf734a

Please sign in to comment.