diff options
author | h1994st <h1994st@gmail.com> | 2020-03-07 16:28:48 -0500 |
---|---|---|
committer | h1994st <h1994st@gmail.com> | 2020-03-07 16:28:48 -0500 |
commit | 8f93cf5c55c8a845f90ec283effe0114488a7e31 (patch) | |
tree | a36c2e816ad99fde6b216513b989a6a006b91f00 /src/afl-fuzz-queue.c | |
parent | dc0b2dda5e4ec41ea491e63f0ec31c5da6fe7f1d (diff) | |
download | afl++-8f93cf5c55c8a845f90ec283effe0114488a7e31.tar.gz |
Add two new hooks for the custom mutator
- `afl_custom_queue_get` and `afl_custom_queue_new_entry` - Update the corresponding document and examples
Diffstat (limited to 'src/afl-fuzz-queue.c')
-rw-r--r-- | src/afl-fuzz-queue.c | 11 |
1 files changed, 11 insertions, 0 deletions
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. */ |