Skip to content

Commit d869913

Browse files
committed
score output in afl-showmap
1 parent 6a24651 commit d869913

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/afl-showmap.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ static u32 tcnt, highest; /* tuple content information */
8383

8484
static u32 in_len; /* Input data length */
8585

86+
static u32 score;
87+
8688
static u32 map_size = MAP_SIZE, timed_out = 0;
8789

8890
static bool quiet_mode, /* Hide non-essential messages? */
@@ -238,6 +240,13 @@ static void at_exit_handler(void) {
238240
static void analyze_results(afl_forkserver_t *fsrv) {
239241

240242
u32 i;
243+
244+
if (unlikely((score = *(u32 *)((u8 *)fsrv->trace_bits + 1)) > 0)) {
245+
246+
memset(fsrv->trace_bits + 1, 0, 4);
247+
248+
}
249+
241250
for (i = 0; i < map_size; i++) {
242251

243252
if (fsrv->trace_bits[i]) {
@@ -269,6 +278,12 @@ static u32 write_results_to_file(afl_forkserver_t *fsrv, u8 *outfile) {
269278

270279
}
271280

281+
if (unlikely((score = *(u32 *)((u8 *)fsrv->trace_bits + 1)) > 0)) {
282+
283+
memset(fsrv->trace_bits + 1, 0, 4);
284+
285+
}
286+
272287
if (cmin_mode &&
273288
(fsrv->last_run_timed_out || (!caa && child_crashed != cco))) {
274289

@@ -1766,12 +1781,20 @@ int main(int argc, char **argv_orig, char **envp) {
17661781
OKF("Captured %u tuples (map size %u, highest value %u, total values %llu) "
17671782
"in '%s'." cRST,
17681783
tcnt, fsrv->real_map_size, highest, total, out_file);
1769-
if (collect_coverage)
1784+
if (collect_coverage) {
1785+
17701786
OKF("A coverage of %u edges were achieved out of %u existing (%.02f%%) "
17711787
"with %llu input files.",
17721788
tcnt, map_size, ((float)tcnt * 100) / (float)map_size,
17731789
fsrv->total_execs);
17741790

1791+
} else if (score > 0) {
1792+
1793+
OKF("Path score is %u (cyclomatic and/or vulnerability scoring).\n",
1794+
score);
1795+
1796+
}
1797+
17751798
}
17761799

17771800
if (stdin_file) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy