diff options
author | Khaled Yakdan <yakdan@code-intelligence.de> | 2019-09-04 23:22:22 +0200 |
---|---|---|
committer | Khaled Yakdan <yakdan@code-intelligence.de> | 2019-09-04 23:22:22 +0200 |
commit | e0f9aa35081b0dffba1476192bc071848082c504 (patch) | |
tree | 802c5b59ee18a2977aa10740105a62e04423a06e | |
parent | b31dff6beec6a7aa17da6f7f8a2eef198c263ccc (diff) | |
download | afl++-e0f9aa35081b0dffba1476192bc071848082c504.tar.gz |
Added docstring to the custom mutator hooks
-rw-r--r-- | include/afl-fuzz.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h index 571ca879..86b97c12 100644 --- a/include/afl-fuzz.h +++ b/include/afl-fuzz.h @@ -421,9 +421,25 @@ extern u32 a_extras_cnt; /* Total number of tokens available */ u8* (*post_handler)(u8* buf, u32* len); /* hooks for the custom mutator function */ -size_t (*custom_mutator)(u8* data, size_t size, u8* mutated_out, - size_t max_size, unsigned int seed); -size_t (*pre_save_handler)(u8* data, size_t size, u8** new_data); +/** + * Perform custom mutations on a given input + * @param data Input data to be mutated + * @param size Size of input data + * @param mutated_out Buffer to store the mutated input + * @param max_size Maximum size of the mutated output. The mutation must not produce data larger than max_size. + * @param seed Seed used for the mutation. The mutation should produce the same output given the same seed. + * @return Size of the mutated output. + */ +size_t (*custom_mutator)(u8 *data, size_t size, u8* mutated_out, size_t max_size, unsigned int seed); +/** + * A post-processing function to use right before AFL writes the test case to disk in order to execute the target. + * If this functionality is not needed, Simply don't define this function. + * @param data Buffer containing the test case to be executed. + * @param size Size of the test case. + * @param new_data Buffer to store the test case after processing + * @return Size of data after processing. + */ +size_t (*pre_save_handler)(u8 *data, size_t size, u8 **new_data); /* Interesting values, as per config.h */ |