diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2020-03-08 12:38:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 12:38:01 +0100 |
commit | 891f6985ed39dba44dc0cf2c56d22882d97024b0 (patch) | |
tree | fc5eec5cd8b1fcd7d0071c7660342b2494e1d497 /src/afl-fuzz-mutators.c | |
parent | 98ffef26dcc59c48e1afa00ddb8c39206602ccfe (diff) | |
parent | e7bc3e09a3913e5c06d4150e8c8a44a70774937c (diff) | |
download | afl++-891f6985ed39dba44dc0cf2c56d22882d97024b0.tar.gz |
Merge pull request #238 from h1994st/master
Two new hooks for the custom mutator
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r-- | src/afl-fuzz-mutators.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c index 76ce2c96..28d21636 100644 --- a/src/afl-fuzz-mutators.c +++ b/src/afl-fuzz-mutators.c @@ -162,6 +162,16 @@ void load_custom_mutator(const char* fn) { if (!mutator->afl_custom_havoc_mutation_probability) WARNF("Symbol 'afl_custom_havoc_mutation_probability' not found."); + /* "afl_custom_queue_get", optional */ + mutator->afl_custom_queue_get = dlsym(dh, "afl_custom_queue_get"); + if (!mutator->afl_custom_queue_get) + WARNF("Symbol 'afl_custom_queue_get' not found."); + + /* "afl_custom_queue_new_entry", optional */ + mutator->afl_custom_queue_new_entry = dlsym(dh, "afl_custom_queue_new_entry"); + if (!mutator->afl_custom_queue_new_entry) + WARNF("Symbol 'afl_custom_queue_new_entry' not found"); + OKF("Custom mutator '%s' installed successfully.", fn); /* Initialize the custom mutator */ @@ -324,6 +334,12 @@ void load_custom_mutator_py(const char* module_name) { if (py_functions[PY_FUNC_HAVOC_MUTATION_PROBABILITY]) mutator->afl_custom_havoc_mutation_probability = havoc_mutation_probability_py; + if (py_functions[PY_FUNC_QUEUE_GET]) + mutator->afl_custom_queue_get = queue_get_py; + + if (py_functions[PY_FUNC_QUEUE_NEW_ENTRY]) + mutator->afl_custom_queue_new_entry = queue_new_entry_py; + OKF("Python mutator '%s' installed successfully.", module_name); /* Initialize the custom mutator */ |