Skip to content

Commit 5ee5403

Browse files
committed
QoL patch: also use @@ instead of AFL_FILE
1 parent e49e125 commit 5ee5403

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ the output directory used by `afl-fuzz`, and the command to execute along with
8282
associated arguments. This command and arguments should closely resemble the
8383
manner in which `afl-fuzz` executes the targeted binary during the fuzzing
8484
cycle. If there is already an existing directory of AFL fuzzing results, then
85-
just omit the `--live` argument to process the existing results. Here is an
86-
example:
85+
just omit the `--live` argument to process the existing results.
86+
87+
NOTE: you can use both afl's "@@" or afl-cov's original "AFL_FILE" placeholder for
88+
the --coverage-cmd line parameter.
89+
90+
Here is an example:
8791

8892
```bash
8993
$ cd /path/to/project-gcov/
@@ -98,6 +102,7 @@ The `AFL_FILE` string above refers to the test case file that AFL will
98102
build in the `queue/` directory under `/path/to/afl-fuzz-output`. Just leave this
99103
string as-is since `afl-cov` will automatically substitute it with each AFL
100104
`queue/id:NNNNNN*` in succession as it builds the code coverage reports.
105+
You can also use @@ instead of AFL_FILE, both notations work.
101106

102107
Also, in the above command, this handles the case where the AFL fuzzing cycle
103108
is fuzzing the targeted binary via stdin. This explains the
@@ -107,7 +112,7 @@ fuzzing with AFL where a file is read from the filesystem, here is an example:
107112
```bash
108113
$ cd /path/to/project-gcov/
109114
$ afl-cov -d /path/to/afl-fuzz-output/ --live --coverage-cmd \
110-
"LD_LIBRARY_PATH=./lib/.libs ./bin/.libs/somebin -f AFL_FILE -a -b -c" \
115+
"LD_LIBRARY_PATH=./lib/.libs ./bin/.libs/somebin -f @@ -a -b -c" \
111116
--code-dir .
112117
```
113118

afl-cov

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def main():
5757

5858
cargs = parse_cmdline()
5959

60+
if cargs.coverage_cmd:
61+
cargs.coverage_cmd = cargs.coverage_cmd.replace('@@', 'AFL_FILE')
62+
6063
if cargs.version:
6164
print "afl-cov-" + __version__
6265
return exit_success

0 commit comments

Comments
 (0)