diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-06-23 11:01:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 11:01:22 +0200 |
commit | 59e1a18197b08b08ad9e75b23fb6a5c740a0b9dd (patch) | |
tree | 6d6064f523ee22f395caafa5587839424a10bb38 /libtokencap/libtokencap.so.c | |
parent | 7119bf5d860657dab7afb60fab8b7ad5dc0ef222 (diff) | |
parent | 8f98044d691bf604245554bec029f67b53819bd9 (diff) | |
download | afl++-59e1a18197b08b08ad9e75b23fb6a5c740a0b9dd.tar.gz |
Merge pull request #422 from devnexen/haiku__build_upd
Haiku build upd
Diffstat (limited to 'libtokencap/libtokencap.so.c')
-rw-r--r-- | libtokencap/libtokencap.so.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libtokencap/libtokencap.so.c b/libtokencap/libtokencap.so.c index 5a7cf3aa..88b5c041 100644 --- a/libtokencap/libtokencap.so.c +++ b/libtokencap/libtokencap.so.c @@ -34,7 +34,8 @@ #include "../config.h" #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!" #endif /* !__linux__ && !__APPLE__ && ! __FreeBSD__ && ! __OpenBSD__ && \ !__NetBSD__*/ @@ -49,6 +50,8 @@ #include <sys/user.h> #endif #include <sys/mman.h> +#elif defined __HAIKU__ + #include <kernel/image.h> #endif #include <dlfcn.h> @@ -230,6 +233,18 @@ static void __tokencap_load_mappings(void) { } 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 } |