fuzzotron.c
void * worker(void * worker_args){
    struct worker_args *thread_info = (struct worker_args *)worker_args;
    printf("[.] Worker %u alive\n", thread_info->thread_id);

    int deterministic = 1;

    char prefix[25];
    sprintf(prefix,"%d",(int)syscall(SYS_gettid));

    struct testcase * cases = 0x00;
    struct testcase * entry = 0x00;

    uint32_t exec_hash;
    int r;

    if(fuzz.gen == RADAMSA || fuzz.gen == SELF){
        if(deterministic == 1 && thread_info->thread_id == 1){
            
            struct testcase * orig_cases = load_testcases(fuzz.in_dir, "");
            struct testcase * orig_entry = orig_cases;

            if(send_cases(orig_entry) < 0){
                goto cleanup;
            }

            deterministic = 0;
        }
        if(fuzz.gen == SELF)
            cases = generator_other(CASE_COUNT, fuzz.in_dir, fuzz.tmp_dir, prefix);
        if(fuzz.gen == RADAMSA)
            cases = generator_radamsa(CASE_COUNT, fuzz.in_dir, fuzz.tmp_dir, prefix);
        if(send_cases(cases) < 0){
            goto cleanup;
        }
	}

cleanup:
    stop = 1;
    printf("[!] Thread %d exiting\n", thread_info->thread_id);
    return NULL;
}
// worker thread, generate cases and sends them
worker thread, generate cases and sends them
worker thread generate cases and sends them
void * worker(void * worker_args){
    struct worker_args *thread_info = (struct worker_args *)worker_args;
    printf("[.] Worker %u alive\n", thread_info->thread_id);
    int deterministic = 1;
    char prefix[25];
    sprintf(prefix,"%d",(int)syscall(SYS_gettid));
    struct testcase * cases = 0x00;
    struct testcase * entry = 0x00;
    uint32_t exec_hash;
    int r;
    if(fuzz.gen == RADAMSA || fuzz.gen == SELF){
        if(deterministic == 1 && thread_info->thread_id == 1){
            struct testcase * orig_cases = load_testcases(fuzz.in_dir, "");
            struct testcase * orig_entry = orig_cases;
            if(send_cases(orig_entry) < 0){
                goto cleanup;
            }
            deterministic = 0;
        }
        if(fuzz.gen == SELF)
            cases = generator_other(CASE_COUNT, fuzz.in_dir, fuzz.tmp_dir, prefix);
        if(fuzz.gen == RADAMSA)
            cases = generator_radamsa(CASE_COUNT, fuzz.in_dir, fuzz.tmp_dir, prefix);
        if(send_cases(cases) < 0){
            goto cleanup;
        }
	}
cleanup:
    stop = 1;
    printf("[!] Thread %d exiting\n", thread_info->thread_id);
    return NULL;
}
void * worker ( void * worker_args ) { struct worker_args * thread_info = ( struct worker_args * ) worker_args ; printf ( " \n " , thread_info -> thread_id ) ; int deterministic = 1 ; char prefix [ 25 ] ; sprintf ( prefix , " " , ( int ) syscall ( SYS_gettid ) ) ; struct testcase * cases = 0x00 ; struct testcase * entry = 0x00 ; uint32_t exec_hash ; int r ; if ( fuzz . gen == RADAMSA || fuzz . gen == SELF ) { if ( deterministic == 1 && thread_info -> thread_id == 1 ) { struct testcase * orig_cases = load_testcases ( fuzz . in_dir , " " ) ; struct testcase * orig_entry = orig_cases ; if ( send_cases ( orig_entry ) < 0 ) { goto cleanup ; } deterministic = 0 ; } if ( fuzz . gen == SELF ) cases = generator_other ( CASE_COUNT , fuzz . in_dir , fuzz . tmp_dir , prefix ) ; if ( fuzz . gen == RADAMSA ) cases = generator_radamsa ( CASE_COUNT , fuzz . in_dir , fuzz . tmp_dir , prefix ) ; if ( send_cases ( cases ) < 0 ) { goto cleanup ; } } cleanup : stop = 1 ; printf ( " \n " , thread_info -> thread_id ) ; return NULL ; }
worker thread, generate cases and sends them
worker thread generate cases and sends them