mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 01:58:17 +00:00
@ -37,10 +37,12 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) && !defined(__ANDROID__)
|
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(__HAIKU__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h>
|
#ifdef __linux__
|
||||||
#include <malloc.h>
|
#include <sys/syscall.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
#ifdef __NR_getrandom
|
#ifdef __NR_getrandom
|
||||||
#define arc4random_buf(p, l) \
|
#define arc4random_buf(p, l) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -35,10 +35,11 @@ _UNIQ=_QINU_
|
|||||||
_____OS_DL = $(____OS_DL:$(_UNIQ)$(UNAME_S)=)
|
_____OS_DL = $(____OS_DL:$(_UNIQ)$(UNAME_S)=)
|
||||||
______OS_DL = $(_____OS_DL:$(_UNIQ)="-ldl")
|
______OS_DL = $(_____OS_DL:$(_UNIQ)="-ldl")
|
||||||
|
|
||||||
_OS_TARGET = $(____OS_DL:$(_UNIQ)FreeBSD=$(_UNIQ))
|
_OS_TARGET = $(____OS_DL:$(_UNIQ)FreeBSD=$(_UNIQ))
|
||||||
__OS_TARGET = $(_OS_TARGET:$(_UNIQ)OpenBSD=$(_UNIQ))
|
__OS_TARGET = $(_OS_TARGET:$(_UNIQ)OpenBSD=$(_UNIQ))
|
||||||
___OS_TARGET = $(__OS_TARGET:$(_UNIQ)NetBSD=$(_UNIQ))
|
___OS_TARGET = $(__OS_TARGET:$(_UNIQ)NetBSD=$(_UNIQ))
|
||||||
____OS_TARGET = $(___OS_TARGET:$(_UNIQ)$(UNAME_S)=)
|
____OS_TARGET = $(___OS_TARGET:$(_UNIQ)Haiku=$(_UNIQ))
|
||||||
|
_____OS_TARGET = $(___OS_TARGET:$(_UNIQ)$(UNAME_S)=)
|
||||||
|
|
||||||
TARGETS = $(____OS_TARGET:$(_UNIQ)=libtokencap.so)
|
TARGETS = $(____OS_TARGET:$(_UNIQ)=libtokencap.so)
|
||||||
|
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
|
||||||
#if !defined __linux__ && !defined __APPLE__ && !defined __FreeBSD__ && \
|
#if !defined __linux__ && !defined __APPLE__ && !defined __FreeBSD__ && \
|
||||||
!defined __OpenBSD__ && !defined __NetBSD__ && !defined __DragonFly__
|
!defined __OpenBSD__ && !defined __NetBSD__ && !defined __DragonFly__ && \
|
||||||
|
!defined(__HAIKU__)
|
||||||
#error "Sorry, this library is unsupported in this platform for now!"
|
#error "Sorry, this library is unsupported in this platform for now!"
|
||||||
#endif /* !__linux__ && !__APPLE__ && ! __FreeBSD__ && ! __OpenBSD__ && \
|
#endif /* !__linux__ && !__APPLE__ && ! __FreeBSD__ && ! __OpenBSD__ && \
|
||||||
!__NetBSD__*/
|
!__NetBSD__*/
|
||||||
@ -49,6 +50,8 @@
|
|||||||
#include <sys/user.h>
|
#include <sys/user.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#elif defined __HAIKU__
|
||||||
|
#include <kernel/image.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
@ -230,6 +233,18 @@ static void __tokencap_load_mappings(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
munmap(buf, len);
|
munmap(buf, len);
|
||||||
|
#elif defined __HAIKU__
|
||||||
|
image_info ii;
|
||||||
|
int32_t group = 0;
|
||||||
|
|
||||||
|
while (get_next_image_info(0, &group, &ii) == B_OK) {
|
||||||
|
|
||||||
|
__tokencap_ro[__tokencap_ro_cnt].st = ii.text;
|
||||||
|
__tokencap_ro[__tokencap_ro_cnt].en = ((char *)ii.text) + ii.text_size;
|
||||||
|
|
||||||
|
if (++__tokencap_ro_cnt == MAX_MAPPINGS) break;
|
||||||
|
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user