make nyx aux buffer size configurable

This commit is contained in:
Sergej Schumilo
2023-08-03 14:40:10 +02:00
parent 641c551ba0
commit 8f31086a7f
4 changed files with 15 additions and 0 deletions

View File

@ -129,6 +129,9 @@ nyx_plugin_handler_t *afl_load_libnyx_plugin(u8 *libnyx_binary) {
plugin->nyx_remove_work_dir = dlsym(handle, "nyx_remove_work_dir");
if (plugin->nyx_remove_work_dir == NULL) { goto fail; }
plugin->nyx_config_set_aux_buffer_size = dlsym(handle, "nyx_config_set_aux_buffer_size");
if (plugin->nyx_config_set_aux_buffer_size == NULL) { goto fail; }
OKF("libnyx plugin is ready!");
return plugin;
@ -589,6 +592,13 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
}
if (getenv("AFL_NYX_AUX_SIZE") != NULL) {
if(fsrv->nyx_handlers->nyx_config_set_aux_buffer_size(
nyx_config, atoi(getenv("AFL_NYX_AUX_SIZE"))) != 1) {
NYX_PRE_FATAL(fsrv, "Invalid AFL_NYX_AUX_SIZE value set (must be a multiple of 4096) ...");
}
}
if (getenv("NYX_REUSE_SNAPSHOT") != NULL) {
if (access(getenv("NYX_REUSE_SNAPSHOT"), F_OK) == -1) {