From d840462c2e4cdda4428d99cd4003ddda95c5a2dc Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 5 May 2022 10:55:04 +0200 Subject: [PATCH] fix libafl_maps_next for i386 --- linux-user/syscall.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2d850ca23b..16e4dd18a4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -13192,8 +13192,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, //// --- Begin LibAFL code --- struct libafl_mapinfo { - uint64_t start, end; - uint64_t offset; + target_ulong start, end; + target_ulong offset; const char* path; int flags, is_priv; }; @@ -13224,9 +13224,9 @@ GSList * libafl_maps_next(GSList *map_info, struct libafl_mapinfo* ret) { if (flags & PAGE_WRITE_ORG) libafl_flags |= PROT_WRITE; if (flags & PAGE_EXEC) libafl_flags |= PROT_EXEC; - ret->start = (uint64_t)min; - ret->end = (uint64_t)max; - ret->offset = (uint64_t)e->offset; + ret->start = (target_ulong)h2g_nocheck(min); + ret->end = (target_ulong)h2g_nocheck(max); + ret->offset = (target_ulong)e->offset; ret->path = e->path; ret->flags = libafl_flags; ret->is_priv = e->is_priv;