File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1
1
# afl-cov - AFL Fuzzing Code Coverage
2
2
3
+ - [ Preface] ( #preface )
3
4
- [ Introduction] ( #introduction )
4
5
- [ Prerequisites] ( #prerequisites )
5
6
- [ Workflow] ( #workflow )
10
11
- [ License] ( #license )
11
12
- [ Contact] ( #contact )
12
13
14
+ ## Preface
15
+
16
+ This is a modified afl-cov fork because the original author's account is
17
+ inactive :-(
18
+
19
+ It has three changes:
20
+ * afl-cov now accepts "@@" like AFL++ in the command line
21
+ * afl-cov.sh makes using afl-cov easier (just needs two parameters)
22
+ * afl-cov-build.sh makes builing a target for coverage easier
23
+
24
+ Enjoy!
25
+
26
+ Marc "vanHauser" Heuse
27
+
13
28
## Introduction
14
29
` afl-cov ` uses test case files produced by the
15
30
[ AFL fuzzer] ( http://lcamtuf.coredump.cx/afl/ ) ` afl-fuzz ` to generate gcov code
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ test -z " $1 " -o " $1 " = " -h" && {
4
+ echo " Syntax: $0 <command> [options]"
5
+ echo Sets build options for coverage instrumentation with gcov/lcov.
6
+ echo Example: " $0 ./configure --disable-shared"
7
+ }
8
+
9
+ test -z " $CC " && export CC=gcc
10
+ test -z " $CXX " && export CXX=g++
11
+ export CFLAGS=" -fprofile-arcs -ftest-coverage"
12
+ export CXXFLAGS=" $CFLAGS "
13
+ export LDFLAGS=" -lgcov --coverage"
14
+
15
+ $*
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # easy wrapper script for afl-cov
4
+ #
5
+ test " $1 " = " -h" -o -z " $1 " && {
6
+ echo Syntax: $0 out-dir \" exec cmd --foo @@\"
7
+ echo Generates the coverage information for an AFL run.
8
+ echo Must be run from the top directory of the coverage build.
9
+ echo Example: $0 ../target/out \" tools/target @@\"
10
+ exit 1
11
+ }
12
+ test -d " $1 " || { echo Error: not a directory: $1 ; exit 1 ; }
13
+ test -e " $1 " /queue || { echo Error: not an afl-fuzz -o out directory ; exit 1 ; }
14
+ DST=` realpath " $1 " `
15
+ afl-cov -v -d " $DST " --cover-corpus --coverage-cmd " $2 " --code-dir . --overwrite
16
+ test -e " $1 " /fuzzer_stats && {
17
+ echo " runtime :" $( expr ` grep last_update " $DST " /fuzzer_stats| awk ' {print$3}' ` - ` grep start_time " $DST " /fuzzer_stats| awk ' {print$3}' ` ) seconds
18
+ egrep ' execs_done|paths_total|^unique_|stability' " $DST " /fuzzer_stats
19
+ }
20
+ echo open " file://$DST /cov/web/index.html"
You can’t perform that action at this time.
0 commit comments