diff options
author | van Hauser <vh@thc.org> | 2024-09-14 16:02:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-14 16:02:21 +0200 |
commit | 8531928fa4333eddd958899b6ccb714db33573f6 (patch) | |
tree | 315828e77369e94a2c9f9a9a86a06693674e7635 /src/afl-forkserver.c | |
parent | 804c98a1e893b40209b377d31b55efec4c7c824b (diff) | |
parent | 1d6cd5dd199e0c745aaca05b465286bf63d5ebc2 (diff) | |
download | afl++-8531928fa4333eddd958899b6ccb714db33573f6.tar.gz |
Merge pull request #2207 from schumilo/dev
fix AFL_AUTORESUME=1 for Nyx mode
Diffstat (limited to 'src/afl-forkserver.c')
-rw-r--r-- | src/afl-forkserver.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c index c7c493cf..ae3c7ccc 100644 --- a/src/afl-forkserver.c +++ b/src/afl-forkserver.c @@ -136,6 +136,12 @@ nyx_plugin_handler_t *afl_load_libnyx_plugin(u8 *libnyx_binary) { dlsym(handle, "nyx_config_set_aux_buffer_size"); if (plugin->nyx_config_set_aux_buffer_size == NULL) { goto fail; } + plugin->nyx_get_target_hash64 = dlsym(handle, "nyx_get_target_hash64"); + if (plugin->nyx_get_target_hash64 == NULL) { goto fail; } + + plugin->nyx_config_free = dlsym(handle, "nyx_config_free"); + if (plugin->nyx_get_target_hash64 == NULL) { goto fail; } + OKF("libnyx plugin is ready!"); return plugin; @@ -224,6 +230,7 @@ void afl_fsrv_init(afl_forkserver_t *fsrv) { fsrv->nyx_use_tmp_workdir = false; fsrv->nyx_tmp_workdir_path = NULL; fsrv->nyx_log_fd = -1; + fsrv->nyx_target_hash64 = 0; #endif // this structure needs default so we initialize it if this was not done @@ -527,6 +534,15 @@ static void report_error_and_exit(int error) { } +#ifdef __linux__ +void nyx_load_target_hash(afl_forkserver_t *fsrv) { + void *nyx_config = fsrv->nyx_handlers->nyx_config_load(fsrv->target_path); + fsrv->nyx_target_hash64 = fsrv->nyx_handlers->nyx_get_target_hash64(nyx_config); + fsrv->nyx_handlers->nyx_config_free(nyx_config); +} +#endif + + /* Spins up fork server. The idea is explained here: https://lcamtuf.blogspot.com/2014/10/fuzzing-binaries-without-execve.html |