unsafe extern "C" fn afl_fauxsrv_execv(mut fsrv: *mut afl_forkserver_t,
                                       mut argv: *mut *mut libc::c_char) {
    let mut tmp: [libc::c_uchar; 4] =
        [0 as libc::c_int as libc::c_uchar, 0 as libc::c_int as libc::c_uchar,
         0 as libc::c_int as libc::c_uchar,
         0 as libc::c_int as libc::c_uchar];
    let mut child_pid: pid_t = -(1 as libc::c_int);
    if be_quiet == 0 {
        printf(b"\x1b[1;94m[*] \x1b[0mUsing Fauxserver:\x00" as *const u8 as
                   *const libc::c_char);
        printf(b"\x1b[0m\n\x00" as *const u8 as *const libc::c_char);
    }
    /* Phone home and tell the parent that we're OK. If parent isn't there,
     assume we're not running in forkserver mode and just execute program. */
    if write(198 as libc::c_int + 1 as libc::c_int,
             tmp.as_mut_ptr() as *const libc::c_void,
             4 as libc::c_int as size_t) != 4 as libc::c_int as libc::c_long {
        abort(); // TODO: Abort?
    }
    let mut old_sigchld_handler:
            Option<unsafe extern "C" fn(_: libc::c_int) -> ()> =
        signal(17 as libc::c_int, None);
    loop  {
        let mut was_killed: uint32_t = 0;
        let mut status: libc::c_int = 0;
        /* Wait for parent by reading from the pipe. Exit if read fails. */
        if read(198 as libc::c_int,
                &mut was_killed as *mut uint32_t as *mut libc::c_void,
                4 as libc::c_int as size_t) !=
               4 as libc::c_int as libc::c_long {
            exit(0 as libc::c_int);
        }
        /* Create a clone of our process. */
        child_pid = fork();
        if child_pid < 0 as libc::c_int {
            fflush(stdout);
            printf(b"\x0f\x1b)B\x1b[?25h\x1b[0m\x1b[1;91m\n[-]  SYSTEM ERROR : \x1b[0mFork failed\x00"
                       as *const u8 as *const libc::c_char);
            printf(b"\x1b[1;91m\n    Stop location : \x1b[0m%s(), %s:%u\n\x00"
                       as *const u8 as *const libc::c_char,
                   b"func_unknown\x00" as *const u8 as *const libc::c_char,
                   b"src/afl-forkserver.c\x00" as *const u8 as
                       *const libc::c_char, 143 as libc::c_int);
            printf(b"\x1b[1;91m       OS message : \x1b[0m%s\n\x00" as
                       *const u8 as *const libc::c_char,
                   strerror(*__errno_location()));
            exit(1 as libc::c_int);
        }
        /* In child process: close fds, resume execution. */
        if child_pid == 0 {
            // New child
            signal(17 as libc::c_int, old_sigchld_handler);
            // FORKSRV_FD is for communication with AFL, we don't need it in the
      // child.
            close(198 as libc::c_int);
            close(198 as libc::c_int + 1 as libc::c_int);
            // TODO: exec...
            execv((*fsrv).target_path as *const libc::c_char,
                  argv as *const *mut libc::c_char);
            /* Use a distinctive bitmap signature to tell the parent about execv()
        falling through. */
            *((*fsrv).trace_bits as *mut u32_0) = 0xfee1dead as libc::c_uint;
            fflush(stdout);
            printf(b"\x0f\x1b)B\x1b[?25h\x1b[0m\x1b[1;91m\n[-]  SYSTEM ERROR : \x1b[0mExecv failed in fauxserver.\x00"
                       as *const u8 as *const libc::c_char);
            printf(b"\x1b[1;91m\n    Stop location : \x1b[0m%s(), %s:%u\n\x00"
                       as *const u8 as *const libc::c_char,
                   b"func_unknown\x00" as *const u8 as *const libc::c_char,
                   b"src/afl-forkserver.c\x00" as *const u8 as
                       *const libc::c_char, 164 as libc::c_int);
            printf(b"\x1b[1;91m       OS message : \x1b[0m%s\n\x00" as
                       *const u8 as *const libc::c_char,
                   strerror(*__errno_location()));
            exit(1 as libc::c_int);
        }
        /* In parent process: write PID to AFL. */
        if write(198 as libc::c_int + 1 as libc::c_int,
                 &mut child_pid as *mut pid_t as *const libc::c_void,
                 4 as libc::c_int as size_t) !=
               4 as libc::c_int as libc::c_long {
            exit(0 as libc::c_int);
        }
        /* after child exited, get and relay exit status to parent through waitpid.
     */
        if waitpid(child_pid, &mut status, 0 as libc::c_int) <
               0 as libc::c_int {
            // Zombie Child could not be collected. Scary!
            fflush(stdout);
            printf(b"\x0f\x1b)B\x1b[?25h\x1b[0m\x1b[1;91m\n[-]  SYSTEM ERROR : \x1b[0mFauxserver could not determin child\'s exit code. \x00"
                       as *const u8 as *const libc::c_char);
            printf(b"\x1b[1;91m\n    Stop location : \x1b[0m%s(), %s:%u\n\x00"
                       as *const u8 as *const libc::c_char,
                   b"func_unknown\x00" as *const u8 as *const libc::c_char,
                   b"src/afl-forkserver.c\x00" as *const u8 as
                       *const libc::c_char, 178 as libc::c_int);
            printf(b"\x1b[1;91m       OS message : \x1b[0m%s\n\x00" as
                       *const u8 as *const libc::c_char,
                   strerror(*__errno_location()));
            exit(1 as libc::c_int);
        }
        /* Relay wait status to AFL pipe, then loop back. */
        if write(198 as libc::c_int + 1 as libc::c_int,
                 &mut status as *mut libc::c_int as *const libc::c_void,
                 4 as libc::c_int as size_t) !=
               4 as libc::c_int as libc::c_long {
            exit(0 as libc::c_int);
        }
    };
}
/* Internal forkserver for dumb_mode=1 and non-forkserver mode runs.
  It execvs for each fork, forwarding exit codes and child pids to afl. */
Internal forkserver for dumb_mode=1 and non-forkserver mode runs.
It execvs for each fork, forwarding exit codes and child pids to afl.
Internal forkserver for dumb_mode = 1 and non - forkserver mode runs . It execvs for each fork forwarding exit codes and child pids to afl .
unsafe extern "C" fn afl_fauxsrv_execv(mut fsrv: *mut afl_forkserver_t,
                                       mut argv: *mut *mut libc::c_char) {
    let mut tmp: [libc::c_uchar; 4] =
        [0 as libc::c_int as libc::c_uchar, 0 as libc::c_int as libc::c_uchar,
         0 as libc::c_int as libc::c_uchar,
         0 as libc::c_int as libc::c_uchar];
    let mut child_pid: pid_t = -(1 as libc::c_int);
    if be_quiet == 0 {
        printf(b"\x1b[1;94m[*] \x1b[0mUsing Fauxserver:\x00" as *const u8 as
                   *const libc::c_char);
        printf(b"\x1b[0m\n\x00" as *const u8 as *const libc::c_char);
    }
    /* Phone home and tell the parent that we're OK. If parent isn't there,
     assume we're not running in forkserver mode and just execute program. */
    if write(198 as libc::c_int + 1 as libc::c_int,
             tmp.as_mut_ptr() as *const libc::c_void,
             4 as libc::c_int as size_t) != 4 as libc::c_int as libc::c_long {
        abort(); // TODO: Abort?
    }
    let mut old_sigchld_handler:
            Option<unsafe extern "C" fn(_: libc::c_int) -> ()> =
        signal(17 as libc::c_int, None);
    loop  {
        let mut was_killed: uint32_t = 0;
        let mut status: libc::c_int = 0;
        /* Wait for parent by reading from the pipe. Exit if read fails. */
        if read(198 as libc::c_int,
                &mut was_killed as *mut uint32_t as *mut libc::c_void,
                4 as libc::c_int as size_t) !=
               4 as libc::c_int as libc::c_long {
            exit(0 as libc::c_int);
        }
        /* Create a clone of our process. */
        child_pid = fork();
        if child_pid < 0 as libc::c_int {
            fflush(stdout);
            printf(b"\x0f\x1b)B\x1b[?25h\x1b[0m\x1b[1;91m\n[-]  SYSTEM ERROR : \x1b[0mFork failed\x00"
                       as *const u8 as *const libc::c_char);
            printf(b"\x1b[1;91m\n    Stop location : \x1b[0m%s(), %s:%u\n\x00"
                       as *const u8 as *const libc::c_char,
                   b"func_unknown\x00" as *const u8 as *const libc::c_char,
                   b"src/afl-forkserver.c\x00" as *const u8 as
                       *const libc::c_char, 143 as libc::c_int);
            printf(b"\x1b[1;91m       OS message : \x1b[0m%s\n\x00" as
                       *const u8 as *const libc::c_char,
                   strerror(*__errno_location()));
            exit(1 as libc::c_int);
        }
        /* In child process: close fds, resume execution. */
        if child_pid == 0 {
            // New child
            signal(17 as libc::c_int, old_sigchld_handler);
            // FORKSRV_FD is for communication with AFL, we don't need it in the
      // child.
            close(198 as libc::c_int);
            close(198 as libc::c_int + 1 as libc::c_int);
            // TODO: exec...
            execv((*fsrv).target_path as *const libc::c_char,
                  argv as *const *mut libc::c_char);
            /* Use a distinctive bitmap signature to tell the parent about execv()
        falling through. */
            *((*fsrv).trace_bits as *mut u32_0) = 0xfee1dead as libc::c_uint;
            fflush(stdout);
            printf(b"\x0f\x1b)B\x1b[?25h\x1b[0m\x1b[1;91m\n[-]  SYSTEM ERROR : \x1b[0mExecv failed in fauxserver.\x00"
                       as *const u8 as *const libc::c_char);
            printf(b"\x1b[1;91m\n    Stop location : \x1b[0m%s(), %s:%u\n\x00"
                       as *const u8 as *const libc::c_char,
                   b"func_unknown\x00" as *const u8 as *const libc::c_char,
                   b"src/afl-forkserver.c\x00" as *const u8 as
                       *const libc::c_char, 164 as libc::c_int);
            printf(b"\x1b[1;91m       OS message : \x1b[0m%s\n\x00" as
                       *const u8 as *const libc::c_char,
                   strerror(*__errno_location()));
            exit(1 as libc::c_int);
        }
        /* In parent process: write PID to AFL. */
        if write(198 as libc::c_int + 1 as libc::c_int,
                 &mut child_pid as *mut pid_t as *const libc::c_void,
                 4 as libc::c_int as size_t) !=
               4 as libc::c_int as libc::c_long {
            exit(0 as libc::c_int);
        }
        /* after child exited, get and relay exit status to parent through waitpid.
     */
        if waitpid(child_pid, &mut status, 0 as libc::c_int) <
               0 as libc::c_int {
            // Zombie Child could not be collected. Scary!
            fflush(stdout);
            printf(b"\x0f\x1b)B\x1b[?25h\x1b[0m\x1b[1;91m\n[-]  SYSTEM ERROR : \x1b[0mFauxserver could not determin child\'s exit code. \x00"
                       as *const u8 as *const libc::c_char);
            printf(b"\x1b[1;91m\n    Stop location : \x1b[0m%s(), %s:%u\n\x00"
                       as *const u8 as *const libc::c_char,
                   b"func_unknown\x00" as *const u8 as *const libc::c_char,
                   b"src/afl-forkserver.c\x00" as *const u8 as
                       *const libc::c_char, 178 as libc::c_int);
            printf(b"\x1b[1;91m       OS message : \x1b[0m%s\n\x00" as
                       *const u8 as *const libc::c_char,
                   strerror(*__errno_location()));
            exit(1 as libc::c_int);
        }
        /* Relay wait status to AFL pipe, then loop back. */
        if write(198 as libc::c_int + 1 as libc::c_int,
                 &mut status as *mut libc::c_int as *const libc::c_void,
                 4 as libc::c_int as size_t) !=
               4 as libc::c_int as libc::c_long {
            exit(0 as libc::c_int);
        }
    };
}
unsafe extern " " fn afl_fauxsrv_execv ( mut fsrv : * mut afl_forkserver_t , mut argv : * mut * mut libc :: c_char ) { let mut tmp : [ libc :: c_uchar ; 4 ] = [ 0 as libc :: c_int as libc :: c_uchar , 0 as libc :: c_int as libc :: c_uchar , 0 as libc :: c_int as libc :: c_uchar , 0 as libc :: c_int as libc :: c_uchar ] ; let mut child_pid : pid_t = - ( 1 as libc :: c_int ) ; if be_quiet == 0 { printf ( b" \x1b \x1b \x00 " as * const u8 as * const libc :: c_char ) ; printf ( b" \x1b \n \x00 " as * const u8 as * const libc :: c_char ) ; } /* Phone home and tell the parent that we're OK. If parent isn't there,
     assume we're not running in forkserver mode and just execute program. */ if write ( 198 as libc :: c_int + 1 as libc :: c_int , tmp . as_mut_ptr ( ) as * const libc :: c_void , 4 as libc :: c_int as size_t ) != 4 as libc :: c_int as libc :: c_long { abort ( ) ; // TODO: Abort? } let mut old_sigchld_handler : Option < unsafe extern " " fn ( _ : libc :: c_int ) -> ( ) > = signal ( 17 as libc :: c_int , None ) ; loop { let mut was_killed : uint32_t = 0 ; let mut status : libc :: c_int = 0 ; /* Wait for parent by reading from the pipe. Exit if read fails. */ if read ( 198 as libc :: c_int , & mut was_killed as * mut uint32_t as * mut libc :: c_void , 4 as libc :: c_int as size_t ) != 4 as libc :: c_int as libc :: c_long { exit ( 0 as libc :: c_int ) ; } /* Create a clone of our process. */ child_pid = fork ( ) ; if child_pid < 0 as libc :: c_int { fflush ( stdout ) ; printf ( b" \x0f \x1b \x1b \x1b \x1b \n \x1b \x00 " as * const u8 as * const libc :: c_char ) ; printf ( b" \x1b \n \x1b \n \x00 " as * const u8 as * const libc :: c_char , b" \x00 " as * const u8 as * const libc :: c_char , b" \x00 " as * const u8 as * const libc :: c_char , 143 as libc :: c_int ) ; printf ( b" \x1b \x1b \n \x00 " as * const u8 as * const libc :: c_char , strerror ( * __errno_location ( ) ) ) ; exit ( 1 as libc :: c_int ) ; } /* In child process: close fds, resume execution. */ if child_pid == 0 { // New child signal ( 17 as libc :: c_int , old_sigchld_handler ) ; // FORKSRV_FD is for communication with AFL, we don't need it in the // child. close ( 198 as libc :: c_int ) ; close ( 198 as libc :: c_int + 1 as libc :: c_int ) ; // TODO: exec... execv ( ( * fsrv ) . target_path as * const libc :: c_char , argv as * const * mut libc :: c_char ) ; /* Use a distinctive bitmap signature to tell the parent about execv()
        falling through. */ * ( ( * fsrv ) . trace_bits as * mut u32_0 ) = 0xfee1dead as libc :: c_uint ; fflush ( stdout ) ; printf ( b" \x0f \x1b \x1b \x1b \x1b \n \x1b \x00 " as * const u8 as * const libc :: c_char ) ; printf ( b" \x1b \n \x1b \n \x00 " as * const u8 as * const libc :: c_char , b" \x00 " as * const u8 as * const libc :: c_char , b" \x00 " as * const u8 as * const libc :: c_char , 164 as libc :: c_int ) ; printf ( b" \x1b \x1b \n \x00 " as * const u8 as * const libc :: c_char , strerror ( * __errno_location ( ) ) ) ; exit ( 1 as libc :: c_int ) ; } /* In parent process: write PID to AFL. */ if write ( 198 as libc :: c_int + 1 as libc :: c_int , & mut child_pid as * mut pid_t as * const libc :: c_void , 4 as libc :: c_int as size_t ) != 4 as libc :: c_int as libc :: c_long { exit ( 0 as libc :: c_int ) ; } /* after child exited, get and relay exit status to parent through waitpid.
     */ if waitpid ( child_pid , & mut status , 0 as libc :: c_int ) < 0 as libc :: c_int { // Zombie Child could not be collected. Scary! fflush ( stdout ) ; printf ( b" \x0f \x1b \x1b \x1b \x1b \n \x1b \' \x00 " as * const u8 as * const libc :: c_char ) ; printf ( b" \x1b \n \x1b \n \x00 " as * const u8 as * const libc :: c_char , b" \x00 " as * const u8 as * const libc :: c_char , b" \x00 " as * const u8 as * const libc :: c_char , 178 as libc :: c_int ) ; printf ( b" \x1b \x1b \n \x00 " as * const u8 as * const libc :: c_char , strerror ( * __errno_location ( ) ) ) ; exit ( 1 as libc :: c_int ) ; } /* Relay wait status to AFL pipe, then loop back. */ if write ( 198 as libc :: c_int + 1 as libc :: c_int , & mut status as * mut libc :: c_int as * const libc :: c_void , 4 as libc :: c_int as size_t ) != 4 as libc :: c_int as libc :: c_long { exit ( 0 as libc :: c_int ) ; } } ; }
Internal forkserver for dumb_mode=1 and non-forkserver mode runs.
Internal forkserver for dumb_mode = 1 and non - forkserver mode runs .
fsrv
*mut afl_forkserver_t
argv
*mut *mut libc::c_char
fsrv
*mut afl_forkserver_t
argv
*mut *mut libc::c_char