This commit is contained in:
vanhauser-thc
2023-08-04 09:25:19 +02:00
parent 4a9264444f
commit 79640acbf1
5 changed files with 26 additions and 19 deletions

View File

@ -78,7 +78,7 @@ enum {
}; };
#define MUT_TXT_ARRAY_SIZE 200 #define MUT_TXT_ARRAY_SIZE 200
u32 text_array[MUT_TXT_ARRAY_SIZE] = {MUT_FLIPBIT, u32 text_array[MUT_TXT_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
@ -280,7 +280,7 @@ u32 text_array[MUT_TXT_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_SPLICE_INSERT, MUT_SPLICE_INSERT,
MUT_SPLICE_INSERT}; MUT_SPLICE_INSERT};
#define MUT_BIN_ARRAY_SIZE 256 #define MUT_BIN_ARRAY_SIZE 256
u32 binary_array[MUT_BIN_ARRAY_SIZE] = {MUT_FLIPBIT, u32 binary_array[MUT_BIN_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
@ -538,7 +538,7 @@ u32 binary_array[MUT_BIN_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_SPLICE_INSERT, MUT_SPLICE_INSERT,
MUT_SPLICE_INSERT}; MUT_SPLICE_INSERT};
#define MUT_NORMAL_ARRAY_SIZE 77 #define MUT_NORMAL_ARRAY_SIZE 77
u32 normal_splice_array[MUT_NORMAL_ARRAY_SIZE] = {MUT_FLIPBIT, u32 normal_splice_array[MUT_NORMAL_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
@ -617,7 +617,7 @@ u32 normal_splice_array[MUT_NORMAL_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_SPLICE_INSERT, MUT_SPLICE_INSERT,
MUT_SPLICE_INSERT}; MUT_SPLICE_INSERT};
#define MUT_SPLICE_ARRAY_SIZE 81 #define MUT_SPLICE_ARRAY_SIZE 81
u32 full_splice_array[MUT_SPLICE_ARRAY_SIZE] = {MUT_FLIPBIT, u32 full_splice_array[MUT_SPLICE_ARRAY_SIZE] = {MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,
MUT_FLIPBIT, MUT_FLIPBIT,

View File

@ -86,7 +86,8 @@ typedef struct {
uint32_t size); uint32_t size);
bool (*nyx_remove_work_dir)(const char *workdir); bool (*nyx_remove_work_dir)(const char *workdir);
bool (*nyx_config_set_aux_buffer_size)(void *config, uint32_t aux_buffer_size); bool (*nyx_config_set_aux_buffer_size)(void *config,
uint32_t aux_buffer_size);
} nyx_plugin_handler_t; } nyx_plugin_handler_t;

View File

@ -129,7 +129,8 @@ nyx_plugin_handler_t *afl_load_libnyx_plugin(u8 *libnyx_binary) {
plugin->nyx_remove_work_dir = dlsym(handle, "nyx_remove_work_dir"); plugin->nyx_remove_work_dir = dlsym(handle, "nyx_remove_work_dir");
if (plugin->nyx_remove_work_dir == NULL) { goto fail; } if (plugin->nyx_remove_work_dir == NULL) { goto fail; }
plugin->nyx_config_set_aux_buffer_size = dlsym(handle, "nyx_config_set_aux_buffer_size"); 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; } if (plugin->nyx_config_set_aux_buffer_size == NULL) { goto fail; }
OKF("libnyx plugin is ready!"); OKF("libnyx plugin is ready!");
@ -593,10 +594,16 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
} }
if (getenv("AFL_NYX_AUX_SIZE") != NULL) { 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) { if (fsrv->nyx_handlers->nyx_config_set_aux_buffer_size(
NYX_PRE_FATAL(fsrv, "Invalid AFL_NYX_AUX_SIZE value set (must be a multiple of 4096) ..."); 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 (getenv("NYX_REUSE_SNAPSHOT") != NULL) {

View File

@ -2665,7 +2665,7 @@ static u8 rtn_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u8 *cbuf,
} }
// rtn_fuzz_next_iter: // rtn_fuzz_next_iter:
afl->stage_cur++; afl->stage_cur++;
} }

View File

@ -311,8 +311,8 @@ static void usage(u8 *argv0, int more_help) {
PERSISTENT_MSG PERSISTENT_MSG
"AFL_POST_PROCESS_KEEP_ORIGINAL: save the file as it was prior post-processing to the queue,\n" "AFL_POST_PROCESS_KEEP_ORIGINAL: save the file as it was prior post-processing to\n"
" but execute the post-processed one\n" " the queue, but execute the post-processed one\n"
"AFL_PRELOAD: LD_PRELOAD / DYLD_INSERT_LIBRARIES settings for target\n" "AFL_PRELOAD: LD_PRELOAD / DYLD_INSERT_LIBRARIES settings for target\n"
"AFL_TARGET_ENV: pass extra environment variables to target\n" "AFL_TARGET_ENV: pass extra environment variables to target\n"
"AFL_SHUFFLE_QUEUE: reorder the input queue randomly on startup\n" "AFL_SHUFFLE_QUEUE: reorder the input queue randomly on startup\n"
@ -323,18 +323,17 @@ static void usage(u8 *argv0, int more_help) {
"AFL_STATSD_HOST: change default statsd host (default 127.0.0.1)\n" "AFL_STATSD_HOST: change default statsd host (default 127.0.0.1)\n"
"AFL_STATSD_PORT: change default statsd port (default: 8125)\n" "AFL_STATSD_PORT: change default statsd port (default: 8125)\n"
"AFL_STATSD_TAGS_FLAVOR: set statsd tags format (default: disable tags)\n" "AFL_STATSD_TAGS_FLAVOR: set statsd tags format (default: disable tags)\n"
" Supported formats are: 'dogstatsd', 'librato',\n" " suported formats: dogstatsd, librato, signalfx, influxdb\n"
" 'signalfx' and 'influxdb'\n"
"AFL_SYNC_TIME: sync time between fuzzing instances (in minutes)\n" "AFL_SYNC_TIME: sync time between fuzzing instances (in minutes)\n"
"AFL_NO_CRASH_README: do not create a README in the crashes directory\n" "AFL_NO_CRASH_README: do not create a README in the crashes directory\n"
"AFL_TESTCACHE_SIZE: use a cache for testcases, improves performance (in MB)\n" "AFL_TESTCACHE_SIZE: use a cache for testcases, improves performance (in MB)\n"
"AFL_TMPDIR: directory to use for input file generation (ramdisk recommended)\n" "AFL_TMPDIR: directory to use for input file generation (ramdisk recommended)\n"
"AFL_EARLY_FORKSERVER: force an early forkserver in an afl-clang-fast/\n" "AFL_EARLY_FORKSERVER: force an early forkserver in an afl-clang-fast/\n"
" afl-clang-lto/afl-gcc-fast target\n" " afl-clang-lto/afl-gcc-fast target\n"
"AFL_PERSISTENT: enforce persistent mode (if __AFL_LOOP is in a shared lib\n" "AFL_PERSISTENT: enforce persistent mode (if __AFL_LOOP is in a shared lib)\n"
"AFL_DEFER_FORKSRV: enforced deferred forkserver (__AFL_INIT is in a .so)\n" "AFL_DEFER_FORKSRV: enforced deferred forkserver (__AFL_INIT is in a shared lib)\n"
"AFL_FUZZER_STATS_UPDATE_INTERVAL: interval to update fuzzer_stats file in seconds, " "AFL_FUZZER_STATS_UPDATE_INTERVAL: interval to update fuzzer_stats file in\n"
"(default: 60, minimum: 1)\n" " seconds (default: 60, minimum: 1)\n"
"\n" "\n"
); );