mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 19:38:09 +00:00
fix a few cur_time uses
This commit is contained in:
@ -9,6 +9,7 @@ Want to stay in the loop on major new features? Join our mailing list by
|
|||||||
sending a mail to <afl-users+subscribe@googlegroups.com>.
|
sending a mail to <afl-users+subscribe@googlegroups.com>.
|
||||||
|
|
||||||
### Version ++3.13a (development)
|
### Version ++3.13a (development)
|
||||||
|
- Note: plot_data switched to relative time from unix time in 3.10
|
||||||
- frida_mode - new mode that uses frida to fuzz binary-only targets,
|
- frida_mode - new mode that uses frida to fuzz binary-only targets,
|
||||||
it currently supports persistent mode and cmplog.
|
it currently supports persistent mode and cmplog.
|
||||||
thanks to @WorksButNotTested!
|
thanks to @WorksButNotTested!
|
||||||
|
16
src/afl-cc.c
16
src/afl-cc.c
@ -1574,12 +1574,12 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
else if (have_gcc_plugin)
|
else if (have_gcc_plugin)
|
||||||
compiler_mode = GCC_PLUGIN;
|
compiler_mode = GCC_PLUGIN;
|
||||||
else if (have_gcc)
|
else if (have_gcc)
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// on OSX clang masquerades as GCC
|
// on OSX clang masquerades as GCC
|
||||||
compiler_mode = CLANG;
|
compiler_mode = CLANG;
|
||||||
#else
|
#else
|
||||||
compiler_mode = GCC;
|
compiler_mode = GCC;
|
||||||
#endif
|
#endif
|
||||||
else if (have_lto)
|
else if (have_lto)
|
||||||
compiler_mode = LTO;
|
compiler_mode = LTO;
|
||||||
else
|
else
|
||||||
@ -1602,8 +1602,10 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (compiler_mode == CLANG) {
|
if (compiler_mode == CLANG) {
|
||||||
|
|
||||||
instrument_mode = INSTRUMENT_CLANG;
|
instrument_mode = INSTRUMENT_CLANG;
|
||||||
setenv(CLANG_ENV_VAR, "1", 1); // used by afl-as
|
setenv(CLANG_ENV_VAR, "1", 1); // used by afl-as
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc < 2 || strncmp(argv[1], "-h", 2) == 0) {
|
if (argc < 2 || strncmp(argv[1], "-h", 2) == 0) {
|
||||||
|
@ -562,7 +562,7 @@ u8 fuzz_one_original(afl_state_t *afl) {
|
|||||||
if (afl->cmplog_lvl == 3 ||
|
if (afl->cmplog_lvl == 3 ||
|
||||||
(afl->cmplog_lvl == 2 && afl->queue_cur->tc_ref) ||
|
(afl->cmplog_lvl == 2 && afl->queue_cur->tc_ref) ||
|
||||||
!(afl->fsrv.total_execs % afl->queued_paths) ||
|
!(afl->fsrv.total_execs % afl->queued_paths) ||
|
||||||
get_cur_time() - afl->last_path_time > 300000) {
|
get_cur_time() - afl->last_path_time > 300000) { // 300 seconds
|
||||||
|
|
||||||
if (input_to_state_stage(afl, in_buf, out_buf, len)) {
|
if (input_to_state_stage(afl, in_buf, out_buf, len)) {
|
||||||
|
|
||||||
@ -2013,7 +2013,7 @@ havoc_stage:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(get_cur_time() - afl->last_path_time > 5000 &&
|
if (unlikely(get_cur_time() - afl->last_path_time > 5000 /* 5 seconds */ &&
|
||||||
afl->ready_for_splicing_count > 1)) {
|
afl->ready_for_splicing_count > 1)) {
|
||||||
|
|
||||||
/* add expensive havoc cases here if there is no findings in the last 5s */
|
/* add expensive havoc cases here if there is no findings in the last 5s */
|
||||||
@ -3060,7 +3060,7 @@ static u8 mopt_common_fuzzing(afl_state_t *afl, MOpt_globals_t MOpt_globals) {
|
|||||||
if (afl->cmplog_lvl == 3 ||
|
if (afl->cmplog_lvl == 3 ||
|
||||||
(afl->cmplog_lvl == 2 && afl->queue_cur->tc_ref) ||
|
(afl->cmplog_lvl == 2 && afl->queue_cur->tc_ref) ||
|
||||||
!(afl->fsrv.total_execs % afl->queued_paths) ||
|
!(afl->fsrv.total_execs % afl->queued_paths) ||
|
||||||
get_cur_time() - afl->last_path_time > 300000) {
|
get_cur_time() - afl->last_path_time > 300000) { // 300 seconds
|
||||||
|
|
||||||
if (input_to_state_stage(afl, in_buf, out_buf, len)) {
|
if (input_to_state_stage(afl, in_buf, out_buf, len)) {
|
||||||
|
|
||||||
|
@ -368,7 +368,8 @@ void maybe_update_plot_file(afl_state_t *afl, u32 t_bytes, double bitmap_cvg,
|
|||||||
afl->plot_prev_uh == afl->unique_hangs &&
|
afl->plot_prev_uh == afl->unique_hangs &&
|
||||||
afl->plot_prev_md == afl->max_depth &&
|
afl->plot_prev_md == afl->max_depth &&
|
||||||
afl->plot_prev_ed == afl->fsrv.total_execs) ||
|
afl->plot_prev_ed == afl->fsrv.total_execs) ||
|
||||||
!afl->queue_cycle || get_cur_time() - afl->start_time <= 60))) {
|
!afl->queue_cycle ||
|
||||||
|
get_cur_time() - afl->start_time <= 60000))) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -393,7 +394,7 @@ void maybe_update_plot_file(afl_state_t *afl, u32 t_bytes, double bitmap_cvg,
|
|||||||
fprintf(afl->fsrv.plot_file,
|
fprintf(afl->fsrv.plot_file,
|
||||||
"%llu, %llu, %u, %u, %u, %u, %0.02f%%, %llu, %llu, %u, %0.02f, %llu, "
|
"%llu, %llu, %u, %u, %u, %u, %0.02f%%, %llu, %llu, %u, %0.02f, %llu, "
|
||||||
"%u\n",
|
"%u\n",
|
||||||
(afl->prev_run_time + get_cur_time() - afl->start_time),
|
((afl->prev_run_time + get_cur_time() - afl->start_time) / 1000),
|
||||||
afl->queue_cycle - 1, afl->current_entry, afl->queued_paths,
|
afl->queue_cycle - 1, afl->current_entry, afl->queued_paths,
|
||||||
afl->pending_not_fuzzed, afl->pending_favored, bitmap_cvg,
|
afl->pending_not_fuzzed, afl->pending_favored, bitmap_cvg,
|
||||||
afl->unique_crashes, afl->unique_hangs, afl->max_depth, eps,
|
afl->unique_crashes, afl->unique_hangs, afl->max_depth, eps,
|
||||||
|
@ -1940,8 +1940,10 @@ int main(int argc, char **argv_orig, char **envp) {
|
|||||||
/* If we had a full queue cycle with no new finds, try
|
/* If we had a full queue cycle with no new finds, try
|
||||||
recombination strategies next. */
|
recombination strategies next. */
|
||||||
|
|
||||||
if (unlikely(afl->queued_paths == prev_queued &&
|
if (unlikely(afl->queued_paths == prev_queued
|
||||||
(get_cur_time() - afl->start_time) >= 3600)) {
|
/* FIXME TODO BUG: && (get_cur_time() - afl->start_time) >=
|
||||||
|
3600 */
|
||||||
|
)) {
|
||||||
|
|
||||||
if (afl->use_splicing) {
|
if (afl->use_splicing) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user