mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 17:21:33 +00:00
renamed duplicated func names
This commit is contained in:
parent
19ce862810
commit
b10007a7b5
@ -873,7 +873,7 @@ void show_init_stats(afl_state_t *);
|
||||
|
||||
/* Run */
|
||||
|
||||
fsrv_run_result_t run_target(afl_state_t *, afl_forkserver_t *fsrv, u32);
|
||||
fsrv_run_result_t fuzz_run_target(afl_state_t *, afl_forkserver_t *fsrv, u32);
|
||||
void write_to_testcase(afl_state_t *, void *, u32);
|
||||
u8 calibrate_case(afl_state_t *, struct queue_entry *, u8 *, u32, u8);
|
||||
void sync_fuzzers(afl_state_t *);
|
||||
|
@ -31,7 +31,6 @@
|
||||
/* __FUNCTION__ is non-iso */
|
||||
#ifdef __func__
|
||||
#define __FUNCTION__ __func__
|
||||
#else
|
||||
#endif
|
||||
|
||||
/*******************
|
||||
|
@ -209,7 +209,7 @@ static s32 write_to_file(u8 *path, u8 *mem, u32 len) {
|
||||
/* Execute target application. Returns exec checksum, or 0 if program
|
||||
times out. */
|
||||
|
||||
static u32 run_target(char **argv, u8 *mem, u32 len, u8 first_run) {
|
||||
static u32 analyze_run_target(char **argv, u8 *mem, u32 len, u8 first_run) {
|
||||
|
||||
static struct itimerval it;
|
||||
int status = 0;
|
||||
@ -560,16 +560,16 @@ static void analyze(char **argv) {
|
||||
code. */
|
||||
|
||||
in_data[i] ^= 0xff;
|
||||
xor_ff = run_target(argv, in_data, in_len, 0);
|
||||
xor_ff = analyze_run_target(argv, in_data, in_len, 0);
|
||||
|
||||
in_data[i] ^= 0xfe;
|
||||
xor_01 = run_target(argv, in_data, in_len, 0);
|
||||
xor_01 = analyze_run_target(argv, in_data, in_len, 0);
|
||||
|
||||
in_data[i] = (in_data[i] ^ 0x01) - 0x10;
|
||||
sub_10 = run_target(argv, in_data, in_len, 0);
|
||||
sub_10 = analyze_run_target(argv, in_data, in_len, 0);
|
||||
|
||||
in_data[i] += 0x20;
|
||||
add_10 = run_target(argv, in_data, in_len, 0);
|
||||
add_10 = analyze_run_target(argv, in_data, in_len, 0);
|
||||
in_data[i] -= 0x10;
|
||||
|
||||
/* Classify current behavior. */
|
||||
@ -1020,7 +1020,7 @@ int main(int argc, char **argv, char **envp) {
|
||||
ACTF("Performing dry run (mem limit = %llu MB, timeout = %u ms%s)...",
|
||||
mem_limit, exec_tmout, edges_only ? ", edges only" : "");
|
||||
|
||||
run_target(use_argv, in_data, in_len, 1);
|
||||
analyze_run_target(use_argv, in_data, in_len, 1);
|
||||
|
||||
if (child_timed_out)
|
||||
FATAL("Target binary times out (adjusting -t may help).");
|
||||
|
@ -653,7 +653,7 @@ u8 save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) {
|
||||
|
||||
u8 new_fault;
|
||||
write_to_testcase(afl, mem, len);
|
||||
new_fault = run_target(afl, &afl->fsrv, afl->hang_tmout);
|
||||
new_fault = fuzz_run_target(afl, &afl->fsrv, afl->hang_tmout);
|
||||
|
||||
/* A corner case that one user reported bumping into: increasing the
|
||||
timeout actually uncovers a crash. Make sure we don't discard it if
|
||||
|
@ -62,7 +62,7 @@ u8 common_fuzz_cmplog_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
|
||||
|
||||
write_to_testcase(afl, out_buf, len);
|
||||
|
||||
fault = run_target(afl, &afl->cmplog_fsrv, afl->fsrv.exec_tmout);
|
||||
fault = fuzz_run_target(afl, &afl->cmplog_fsrv, afl->fsrv.exec_tmout);
|
||||
|
||||
if (afl->stop_soon) return 1;
|
||||
|
||||
|
@ -239,7 +239,7 @@ u8 trim_case_custom(afl_state_t *afl, struct queue_entry *q, u8 *in_buf) {
|
||||
|
||||
write_to_testcase(afl, retbuf, retlen);
|
||||
|
||||
fault = run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
fault = fuzz_run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
++afl->trim_execs;
|
||||
|
||||
if (afl->stop_soon || fault == FSRV_RUN_ERROR) { goto abort_trimming; }
|
||||
|
@ -33,7 +33,7 @@
|
||||
/* Execute target application, monitoring for timeouts. Return status
|
||||
information. The called program will update afl->fsrv->trace_bits. */
|
||||
|
||||
fsrv_run_result_t run_target(afl_state_t *afl, afl_forkserver_t *fsrv,
|
||||
fsrv_run_result_t fuzz_run_target(afl_state_t *afl, afl_forkserver_t *fsrv,
|
||||
u32 timeout) {
|
||||
|
||||
fsrv_run_result_t res = afl_fsrv_run_target(fsrv, timeout, &afl->stop_soon);
|
||||
@ -191,7 +191,7 @@ u8 calibrate_case(afl_state_t *afl, struct queue_entry *q, u8 *use_mem,
|
||||
|
||||
write_to_testcase(afl, use_mem, q->len);
|
||||
|
||||
fault = run_target(afl, &afl->fsrv, use_tmout);
|
||||
fault = fuzz_run_target(afl, &afl->fsrv, use_tmout);
|
||||
|
||||
/* afl->stop_soon is set by the handler for Ctrl+C. When it's pressed,
|
||||
we want to bail out quickly. */
|
||||
@ -409,7 +409,7 @@ void sync_fuzzers(afl_state_t *afl) {
|
||||
|
||||
write_to_testcase(afl, mem, st.st_size);
|
||||
|
||||
fault = run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
fault = fuzz_run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
|
||||
if (afl->stop_soon) goto close_sync;
|
||||
|
||||
@ -496,7 +496,7 @@ u8 trim_case(afl_state_t *afl, struct queue_entry *q, u8 *in_buf) {
|
||||
|
||||
write_with_gap(afl, in_buf, q->len, remove_pos, trim_avail);
|
||||
|
||||
fault = run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
fault = fuzz_run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
++afl->trim_execs;
|
||||
|
||||
if (afl->stop_soon || fault == FSRV_RUN_ERROR) goto abort_trimming;
|
||||
@ -603,7 +603,7 @@ u8 common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
|
||||
|
||||
write_to_testcase(afl, out_buf, len);
|
||||
|
||||
fault = run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
fault = fuzz_run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
|
||||
|
||||
if (afl->stop_soon) return 1;
|
||||
|
||||
|
@ -218,7 +218,7 @@ static u32 write_results_to_file(afl_forkserver_t *fsrv, u8 *outfile) {
|
||||
|
||||
/* Execute target application. */
|
||||
|
||||
void run_target_forkserver(afl_forkserver_t *fsrv, char **argv, u8 *mem,
|
||||
static void showmap_run_target_forkserver(afl_forkserver_t *fsrv, char **argv, u8 *mem,
|
||||
u32 len) {
|
||||
|
||||
afl_fsrv_write_to_testcase(fsrv, mem, len);
|
||||
@ -243,7 +243,7 @@ void run_target_forkserver(afl_forkserver_t *fsrv, char **argv, u8 *mem,
|
||||
|
||||
/* Read initial file. */
|
||||
|
||||
u32 read_file(u8 *in_file) {
|
||||
static u32 read_file(u8 *in_file) {
|
||||
|
||||
struct stat st;
|
||||
s32 fd = open(in_file, O_RDONLY);
|
||||
@ -268,7 +268,7 @@ u32 read_file(u8 *in_file) {
|
||||
|
||||
/* Execute target application. */
|
||||
|
||||
static void run_target(afl_forkserver_t *fsrv, char **argv) {
|
||||
static void showmap_run_target(afl_forkserver_t *fsrv, char **argv) {
|
||||
|
||||
static struct itimerval it;
|
||||
int status = 0;
|
||||
@ -883,7 +883,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
|
||||
if (read_file(infile)) {
|
||||
|
||||
run_target_forkserver(fsrv, use_argv, in_data, in_len);
|
||||
showmap_run_target_forkserver(fsrv, use_argv, in_data, in_len);
|
||||
ck_free(in_data);
|
||||
tcnt = write_results_to_file(fsrv, outfile);
|
||||
|
||||
@ -898,7 +898,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
|
||||
} else {
|
||||
|
||||
run_target(fsrv, use_argv);
|
||||
showmap_run_target(fsrv, use_argv);
|
||||
tcnt = write_results_to_file(fsrv, out_file);
|
||||
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ static s32 write_to_file(u8 *path, u8 *mem, u32 len) {
|
||||
/* Execute target application. Returns 0 if the changes are a dud, or
|
||||
1 if they should be kept. */
|
||||
|
||||
static u8 run_target(afl_forkserver_t *fsrv, char **argv, u8 *mem, u32 len,
|
||||
static u8 tmin_run_target(afl_forkserver_t *fsrv, char **argv, u8 *mem, u32 len,
|
||||
u8 first_run) {
|
||||
|
||||
afl_fsrv_write_to_testcase(fsrv, mem, len);
|
||||
@ -336,7 +336,7 @@ static void minimize(afl_forkserver_t *fsrv, char **argv) {
|
||||
memset(tmp_buf + set_pos, '0', use_len);
|
||||
|
||||
u8 res;
|
||||
res = run_target(fsrv, argv, tmp_buf, in_len, 0);
|
||||
res = tmin_run_target(fsrv, argv, tmp_buf, in_len, 0);
|
||||
|
||||
if (res) {
|
||||
|
||||
@ -409,7 +409,7 @@ next_del_blksize:
|
||||
/* Tail */
|
||||
memcpy(tmp_buf + del_pos, in_data + del_pos + del_len, tail_len);
|
||||
|
||||
res = run_target(fsrv, argv, tmp_buf, del_pos + tail_len, 0);
|
||||
res = tmin_run_target(fsrv, argv, tmp_buf, del_pos + tail_len, 0);
|
||||
|
||||
if (res) {
|
||||
|
||||
@ -472,7 +472,7 @@ next_del_blksize:
|
||||
for (r = 0; r < in_len; r++)
|
||||
if (tmp_buf[r] == i) tmp_buf[r] = '0';
|
||||
|
||||
res = run_target(fsrv, argv, tmp_buf, in_len, 0);
|
||||
res = tmin_run_target(fsrv, argv, tmp_buf, in_len, 0);
|
||||
|
||||
if (res) {
|
||||
|
||||
@ -508,7 +508,7 @@ next_del_blksize:
|
||||
if (orig == '0') continue;
|
||||
tmp_buf[i] = '0';
|
||||
|
||||
res = run_target(fsrv, argv, tmp_buf, in_len, 0);
|
||||
res = tmin_run_target(fsrv, argv, tmp_buf, in_len, 0);
|
||||
|
||||
if (res) {
|
||||
|
||||
@ -1036,7 +1036,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
ACTF("Performing dry run (mem limit = %llu MB, timeout = %u ms%s)...",
|
||||
fsrv->mem_limit, fsrv->exec_tmout, edges_only ? ", edges only" : "");
|
||||
|
||||
run_target(fsrv, use_argv, in_data, in_len, 1);
|
||||
tmin_run_target(fsrv, use_argv, in_data, in_len, 1);
|
||||
|
||||
if (hang_mode && !fsrv->last_run_timed_out)
|
||||
FATAL(
|
||||
|
Loading…
x
Reference in New Issue
Block a user