diff options
author | Sergej Schumilo <sergej@schumilo.de> | 2022-03-04 05:41:40 +0100 |
---|---|---|
committer | Sergej Schumilo <sergej@schumilo.de> | 2022-03-04 05:41:40 +0100 |
commit | 0f7419fc9166b1f719372e1658efc4e3b9c88ac5 (patch) | |
tree | 2d2c5b932af7873b12ebc4eb72c317048e7516fc /src/afl-fuzz-bitmap.c | |
parent | 7c9b7c0bc0f17f19e39684c4a066c10d08743672 (diff) | |
download | afl++-0f7419fc9166b1f719372e1658efc4e3b9c88ac5.tar.gz |
write nyx crash logs to AFL++ work directory
Diffstat (limited to 'src/afl-fuzz-bitmap.c')
-rw-r--r-- | src/afl-fuzz-bitmap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c index b963caf8..bce1a195 100644 --- a/src/afl-fuzz-bitmap.c +++ b/src/afl-fuzz-bitmap.c @@ -771,6 +771,20 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) { ck_write(fd, mem, len, fn); close(fd); + if(afl->fsrv.nyx_mode && fault == FSRV_RUN_CRASH) { + u8 fn_log[PATH_MAX]; + + snprintf(fn_log, PATH_MAX, "%s.log", fn); + + fd = open(fn_log, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION); + if (unlikely(fd < 0)) { PFATAL("Unable to create '%s'", fn_log); } + + u32 nyx_aux_string_len = afl->fsrv.nyx_handlers->nyx_get_aux_string(afl->fsrv.nyx_runner, afl->fsrv.nyx_aux_string, 0x1000); + + ck_write(fd, afl->fsrv.nyx_aux_string, nyx_aux_string_len, fn_log); + close(fd); + } + return keeping; } |