From 8f93cf5c55c8a845f90ec283effe0114488a7e31 Mon Sep 17 00:00:00 2001 From: h1994st Date: Sat, 7 Mar 2020 16:28:48 -0500 Subject: Add two new hooks for the custom mutator - `afl_custom_queue_get` and `afl_custom_queue_new_entry` - Update the corresponding document and examples --- src/afl-fuzz-queue.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/afl-fuzz-queue.c') diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c index 0880de75..ad9dad13 100644 --- a/src/afl-fuzz-queue.c +++ b/src/afl-fuzz-queue.c @@ -139,6 +139,17 @@ void add_to_queue(u8* fname, u32 len, u8 passed_det) { last_path_time = get_cur_time(); + if (mutator && mutator->afl_custom_queue_new_entry) { + + u8* fname_orig = NULL; + + /* At the initialization stage, queue_cur is NULL */ + if (queue_cur) fname_orig = queue_cur->fname; + + mutator->afl_custom_queue_new_entry(fname, fname_orig); + + } + } /* Destroy the entire queue. */ -- cgit 1.4.1