diff options
author | van Hauser <vh@thc.org> | 2022-08-08 15:27:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-08 15:27:07 +0200 |
commit | 3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3 (patch) | |
tree | 051a91a2a36a1c768870591634eca83c62e6053c /frida_mode/src/stats/stats_x86_64.c | |
parent | a2f3c3ee519c19935039d1fe1e8b77cdc32fa375 (diff) | |
parent | 1f06b55a8b558bd8da0296134c29c21c4849a4bd (diff) | |
download | afl++-4.02c.tar.gz |
Merge pull request #1489 from AFLplusplus/dev 4.02c
push to stable
Diffstat (limited to 'frida_mode/src/stats/stats_x86_64.c')
-rw-r--r-- | frida_mode/src/stats/stats_x86_64.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/frida_mode/src/stats/stats_x86_64.c b/frida_mode/src/stats/stats_x86_64.c index 761ca133..e2fb7b80 100644 --- a/frida_mode/src/stats/stats_x86_64.c +++ b/frida_mode/src/stats/stats_x86_64.c @@ -1,9 +1,9 @@ -#include <sys/shm.h> #include <sys/mman.h> #include "frida-gumjs.h" #include "ranges.h" +#include "shm.h" #include "stats.h" #include "util.h" @@ -46,24 +46,7 @@ static stats_data_arch_t *stats_data_arch = NULL; void starts_arch_init(void) { - int shm_id = shmget(IPC_PRIVATE, sizeof(stats_data_arch_t), - IPC_CREAT | IPC_EXCL | 0600); - if (shm_id < 0) { FFATAL("shm_id < 0 - errno: %d\n", errno); } - - stats_data_arch = shmat(shm_id, NULL, 0); - g_assert(stats_data_arch != MAP_FAILED); - - /* - * Configure the shared memory region to be removed once the process dies. - */ - if (shmctl(shm_id, IPC_RMID, NULL) < 0) { - - FFATAL("shmctl (IPC_RMID) < 0 - errno: %d\n", errno); - - } - - /* Clear it, not sure it's necessary, just seems like good practice */ - memset(stats_data_arch, '\0', sizeof(stats_data_arch_t)); + stats_data_arch = shm_create(sizeof(stats_data_arch_t)); } |