diff options
author | h1994st <h1994st@gmail.com> | 2020-03-07 10:29:14 -0500 |
---|---|---|
committer | h1994st <h1994st@gmail.com> | 2020-03-07 10:29:14 -0500 |
commit | dc0b2dda5e4ec41ea491e63f0ec31c5da6fe7f1d (patch) | |
tree | c94bdcd834b4d011df9e2f0fa4e7cd0fd8689019 /src/afl-fuzz-mutators.c | |
parent | a10a3f2fa75f16bf7781a3c02cd23eab7164cff1 (diff) | |
parent | ed5d65b54f07570c82f6704fdca403b776ff7be2 (diff) | |
download | afl++-dc0b2dda5e4ec41ea491e63f0ec31c5da6fe7f1d.tar.gz |
Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r-- | src/afl-fuzz-mutators.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c index 26eaea59..76ce2c96 100644 --- a/src/afl-fuzz-mutators.c +++ b/src/afl-fuzz-mutators.c @@ -25,6 +25,11 @@ #include "afl-fuzz.h" +void load_custom_mutator(const char*); +#ifdef USE_PYTHON +void load_custom_mutator_py(const char*); +#endif + void setup_custom_mutator(void) { /* Try mutator library first */ @@ -146,6 +151,16 @@ void load_custom_mutator(const char* fn) { "trimming will be used."); } + + /* "afl_custom_havoc_mutation", optional */ + mutator->afl_custom_havoc_mutation = dlsym(dh, "afl_custom_havoc_mutation"); + if (!mutator->afl_custom_havoc_mutation) + WARNF("Symbol 'afl_custom_havoc_mutation' not found."); + + /* "afl_custom_havoc_mutation", optional */ + mutator->afl_custom_havoc_mutation_probability = dlsym(dh, "afl_custom_havoc_mutation_probability"); + if (!mutator->afl_custom_havoc_mutation_probability) + WARNF("Symbol 'afl_custom_havoc_mutation_probability' not found."); OKF("Custom mutator '%s' installed successfully.", fn); @@ -276,6 +291,7 @@ abort_trimming: } +#ifdef USE_PYTHON void load_custom_mutator_py(const char* module_name) { mutator = ck_alloc(sizeof(struct custom_mutator)); @@ -301,6 +317,12 @@ void load_custom_mutator_py(const char* module_name) { if (py_functions[PY_FUNC_TRIM]) mutator->afl_custom_trim = trim_py; + + if (py_functions[PY_FUNC_HAVOC_MUTATION]) + mutator->afl_custom_havoc_mutation = havoc_mutation_py; + + if (py_functions[PY_FUNC_HAVOC_MUTATION_PROBABILITY]) + mutator->afl_custom_havoc_mutation_probability = havoc_mutation_probability_py; OKF("Python mutator '%s' installed successfully.", module_name); @@ -309,3 +331,4 @@ void load_custom_mutator_py(const char* module_name) { mutator->afl_custom_init(UR(0xFFFFFFFF)); } +#endif |