commit on Dec31st

林睿健_branch
LRJ 2 months ago
parent 1f6fe18cf1
commit 281f185cab

@ -807,6 +807,16 @@ int main(int argc, char **argv_orig, char **envp) {
afl->out_dir = optarg; afl->out_dir = optarg;
break; break;
/*
1.sync_id-M/-S
2.使ck_strdupchunkchunksync_id
3.Master:使使sscanfMasterMaster
"Bogus master ID passed to -M"
退
a.MasterMaster
b.MasterMaster
c.Master1000000
4.force_deterministic*/
case 'M': { /* main sync ID */ case 'M': { /* main sync ID */
u8 *c; u8 *c;

@ -97,6 +97,10 @@ static sharedmem_t *shm_fuzz;
/* Classify tuple counts. This is a slow & naive version, but good enough here. /* Classify tuple counts. This is a slow & naive version, but good enough here.
*/ */
/*
count_class_lookup
*/
static const u8 count_class_lookup[256] = { static const u8 count_class_lookup[256] = {
[0] = 0, [0] = 0,
@ -111,6 +115,10 @@ static const u8 count_class_lookup[256] = {
}; };
/*
kill_child
PID0
*/
static void kill_child() { static void kill_child() {
if (fsrv->child_pid > 0) { if (fsrv->child_pid > 0) {
@ -122,6 +130,11 @@ static void kill_child() {
} }
/*
deinit_shmem
fsrvforkservershm_fuzz
NULL
*/
static sharedmem_t *deinit_shmem(afl_forkserver_t *fsrv, static sharedmem_t *deinit_shmem(afl_forkserver_t *fsrv,
sharedmem_t *shm_fuzz) { sharedmem_t *shm_fuzz) {
@ -135,7 +148,11 @@ static sharedmem_t *deinit_shmem(afl_forkserver_t *fsrv,
} }
/* Apply mask to classified bitmap (if set). */ /* Apply mask to classified bitmap (if set). */
/*
apply_mask
memmask
NULL
*/
static void apply_mask(u32 *mem, u32 *mask) { static void apply_mask(u32 *mem, u32 *mask) {
u32 i = (map_size >> 2); u32 i = (map_size >> 2);
@ -152,6 +169,12 @@ static void apply_mask(u32 *mem, u32 *mask) {
} }
/*
classify_counts
fsrvforkserver
edges_only
使count_class_lookup
*/
static void classify_counts(afl_forkserver_t *fsrv) { static void classify_counts(afl_forkserver_t *fsrv) {
u8 *mem = fsrv->trace_bits; u8 *mem = fsrv->trace_bits;
@ -180,7 +203,11 @@ static void classify_counts(afl_forkserver_t *fsrv) {
} }
/* See if any bytes are set in the bitmap. */ /* See if any bytes are set in the bitmap. */
/*
anything_set
fsrvforkserver
1
*/
static inline u8 anything_set(afl_forkserver_t *fsrv) { static inline u8 anything_set(afl_forkserver_t *fsrv) {
u32 *ptr = (u32 *)fsrv->trace_bits; u32 *ptr = (u32 *)fsrv->trace_bits;
@ -196,6 +223,11 @@ static inline u8 anything_set(afl_forkserver_t *fsrv) {
} }
/*
at_exit_handler退
remove_shm
remove_out_file
*/
static void at_exit_handler(void) { static void at_exit_handler(void) {
if (remove_shm) { if (remove_shm) {
@ -211,7 +243,11 @@ static void at_exit_handler(void) {
} }
/* Read initial file. */ /* Read initial file. */
/*
read_initial_file
in_file
*/
static void read_initial_file(void) { static void read_initial_file(void) {
struct stat st; struct stat st;
@ -239,7 +275,11 @@ static void read_initial_file(void) {
} }
/* Write output file. */ /* Write output file. */
/*
write_to_file
pathmemlen
*/
static s32 write_to_file(u8 *path, u8 *mem, u32 len) { static s32 write_to_file(u8 *path, u8 *mem, u32 len) {
s32 ret; s32 ret;
@ -260,7 +300,11 @@ static s32 write_to_file(u8 *path, u8 *mem, u32 len) {
/* Execute target application. Returns 0 if the changes are a dud, or /* Execute target application. Returns 0 if the changes are a dud, or
1 if they should be kept. */ 1 if they should be kept. */
/*
tmin_run_target
fsrvforkservermemlenfirst_run
*/
static u8 tmin_run_target(afl_forkserver_t *fsrv, u8 *mem, u32 len, static u8 tmin_run_target(afl_forkserver_t *fsrv, u8 *mem, u32 len,
u8 first_run) { u8 first_run) {
@ -280,7 +324,7 @@ static u8 tmin_run_target(afl_forkserver_t *fsrv, u8 *mem, u32 len,
} }
/* Always discard inputs that time out, unless we are in hang mode */ /* Always discard inputs that time out, unless we are in hang mode */
/* 如果处于挂起模式,总是丢弃超时的输入 */
if (hang_mode) { if (hang_mode) {
switch (ret) { switch (ret) {
@ -300,7 +344,7 @@ static u8 tmin_run_target(afl_forkserver_t *fsrv, u8 *mem, u32 len,
classify_counts(fsrv); classify_counts(fsrv);
apply_mask((u32 *)fsrv->trace_bits, (u32 *)mask_bitmap); apply_mask((u32 *)fsrv->trace_bits, (u32 *)mask_bitmap);
/* 根据当前模式处理崩溃输入 */
if (ret == FSRV_RUN_TMOUT) { if (ret == FSRV_RUN_TMOUT) {
missed_hangs++; missed_hangs++;
@ -326,7 +370,7 @@ static u8 tmin_run_target(afl_forkserver_t *fsrv, u8 *mem, u32 len,
} }
} else { } else {
/* 适当处理非崩溃输入 */
/* Handle non-crashing inputs appropriately. */ /* Handle non-crashing inputs appropriately. */
if (crash_mode) { if (crash_mode) {
@ -352,7 +396,11 @@ static u8 tmin_run_target(afl_forkserver_t *fsrv, u8 *mem, u32 len,
} }
/* Actually minimize! */ /* Actually minimize! */
/*
minimize
fsrvforkserver
*/
static void minimize(afl_forkserver_t *fsrv) { static void minimize(afl_forkserver_t *fsrv) {
static u32 alpha_map[256]; static u32 alpha_map[256];
@ -631,7 +679,11 @@ finalize_all:
} }
/* Handle Ctrl-C and the like. */ /* Handle Ctrl-C and the like. */
/*
handle_stop_sig
sig
*/
static void handle_stop_sig(int sig) { static void handle_stop_sig(int sig) {
(void)sig; (void)sig;
@ -641,7 +693,11 @@ static void handle_stop_sig(int sig) {
} }
/* Do basic preparations - persistent fds, filenames, etc. */ /* Do basic preparations - persistent fds, filenames, etc. */
/*
set_up_environment
fsrvforkserverargv
*/
static void set_up_environment(afl_forkserver_t *fsrv, char **argv) { static void set_up_environment(afl_forkserver_t *fsrv, char **argv) {
u8 *x; u8 *x;
@ -739,7 +795,10 @@ static void set_up_environment(afl_forkserver_t *fsrv, char **argv) {
} }
/* Setup signal handlers, duh. */ /* Setup signal handlers, duh. */
/*
setup_signal_handlers
便Ctrl-C
*/
static void setup_signal_handlers(void) { static void setup_signal_handlers(void) {
struct sigaction sa; struct sigaction sa;
@ -764,7 +823,11 @@ static void setup_signal_handlers(void) {
} }
/* Display usage hints. */ /* Display usage hints. */
/*
usage使
argv0
使
*/
static void usage(u8 *argv0) { static void usage(u8 *argv0) {
SAYF( SAYF(
@ -829,7 +892,11 @@ static void usage(u8 *argv0) {
} }
/* Main entry point */ /* Main entry point */
/*
argcargvenvp
退
*/
int main(int argc, char **argv_orig, char **envp) { int main(int argc, char **argv_orig, char **envp) {
s32 opt; s32 opt;

Loading…
Cancel
Save