mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 03:48:08 +00:00
afl qemu persistent hook
This commit is contained in:
@ -27,7 +27,7 @@
|
||||
#include "afl-fuzz.h"
|
||||
#include "cmplog.h"
|
||||
|
||||
static s32 cmplog_child_pid, cmplog_fsrv_ctl_fd, cmplog_fsrv_st_fd;
|
||||
static s32 cmplog_fsrv_ctl_fd, cmplog_fsrv_st_fd;
|
||||
|
||||
void init_cmplog_forkserver(char** argv) {
|
||||
|
||||
|
@ -252,7 +252,7 @@ u32 a_extras_cnt; /* Total number of tokens available */
|
||||
u8 *(*post_handler)(u8 *buf, u32 *len);
|
||||
|
||||
u8 *cmplog_binary;
|
||||
s32 cmplog_forksrv_pid;
|
||||
s32 cmplog_child_pid, cmplog_forksrv_pid;
|
||||
|
||||
/* hooks for the custom mutator function */
|
||||
size_t (*custom_mutator)(u8 *data, size_t size, u8 *mutated_out,
|
||||
|
@ -1822,6 +1822,8 @@ static void handle_stop_sig(int sig) {
|
||||
|
||||
if (child_pid > 0) kill(child_pid, SIGKILL);
|
||||
if (forksrv_pid > 0) kill(forksrv_pid, SIGKILL);
|
||||
if (cmplog_child_pid > 0) kill(cmplog_child_pid, SIGKILL);
|
||||
if (cmplog_forksrv_pid > 0) kill(cmplog_forksrv_pid, SIGKILL);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1017,6 +1017,8 @@ int main(int argc, char** argv) {
|
||||
|
||||
if (child_pid > 0) kill(child_pid, SIGKILL);
|
||||
if (forksrv_pid > 0) kill(forksrv_pid, SIGKILL);
|
||||
if (cmplog_child_pid > 0) kill(cmplog_child_pid, SIGKILL);
|
||||
if (cmplog_forksrv_pid > 0) kill(cmplog_forksrv_pid, SIGKILL);
|
||||
/* Now that we've killed the forkserver, we wait for it to be able to get
|
||||
* rusage stats. */
|
||||
if (waitpid(forksrv_pid, NULL, 0) <= 0) { WARNF("error waitpid\n"); }
|
||||
|
Reference in New Issue
Block a user