aboutsummaryrefslogtreecommitdiff
path: root/src/afl-fuzz-mutators.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-05-13 16:39:23 +0200
committerGitHub <noreply@github.com>2020-05-13 16:39:23 +0200
commitc4fe6f5277a8edfbf12d9c9c5db77ceb5271bd7f (patch)
treec039c7192a3aa9f83ac9f7dde9c68dac01f3f607 /src/afl-fuzz-mutators.c
parentf8b3d34225102158ed585130e3de08772e989b53 (diff)
parent645e331559d01d234be231a7f5076c2ad658b159 (diff)
downloadafl++-c4fe6f5277a8edfbf12d9c9c5db77ceb5271bd7f.tar.gz
Merge pull request #361 from rish9101/pre_save_format
Add post library API as custom mutator and rename pre_save
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r--src/afl-fuzz-mutators.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c
index 2c2efc94..acc1b12d 100644
--- a/src/afl-fuzz-mutators.c
+++ b/src/afl-fuzz-mutators.c
@@ -108,6 +108,8 @@ void setup_custom_mutators(afl_state_t *afl) {
#endif
+ if (afl->post_library_mutator) list_append(&afl->custom_mutator_list, afl->post_library_mutator);
+
}
void destroy_custom_mutators(afl_state_t *afl) {
@@ -120,11 +122,11 @@ void destroy_custom_mutators(afl_state_t *afl) {
if (el->afl_custom_deinit) el->afl_custom_deinit(el->data);
if (el->dh) dlclose(el->dh);
- if (el->pre_save_buf) {
+ if (el->post_process_buf) {
- ck_free(el->pre_save_buf);
- el->pre_save_buf = NULL;
- el->pre_save_size = 0;
+ ck_free(el->post_process_buf);
+ el->post_process_buf = NULL;
+ el->post_process_size = 0;
}
@@ -170,10 +172,10 @@ struct custom_mutator *load_custom_mutator(afl_state_t *afl, const char *fn) {
mutator->afl_custom_deinit = dlsym(dh, "afl_custom_deinit");
if (!mutator->afl_custom_deinit) FATAL("Symbol 'afl_custom_init' not found.");
- /* "afl_custom_pre_save", optional */
- mutator->afl_custom_pre_save = dlsym(dh, "afl_custom_pre_save");
- if (!mutator->afl_custom_pre_save)
- ACTF("optional symbol 'afl_custom_pre_save' not found.");
+ /* "afl_custom_post_process", optional */
+ mutator->afl_custom_post_process = dlsym(dh, "afl_custom_post_process");
+ if (!mutator->afl_custom_post_process)
+ ACTF("optional symbol 'afl_custom_post_process' not found.");
u8 notrim = 0;
/* "afl_custom_init_trim", optional */