From 3d33713c2b22b9d697698275a9c9dab5c8ba5d03 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 13 Jul 2024 10:07:39 +0200 Subject: Fixed some issue on tracking when protecting memory with PROT=0 --- src/custommem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/custommem.c b/src/custommem.c index d96a38be..3f650485 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -1260,8 +1260,10 @@ void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot) size = ALIGN(size); LOCK_PROT(); rb_set(mmapmem, addr, addr+size, 1); - if(!prot) + if(!prot) { rb_set(mapallmem, addr, addr+size, 1); + rb_unset(memprot, addr, addr+size); + } UNLOCK_PROT(); if(prot) setProtection(addr, size, prot); @@ -1276,6 +1278,7 @@ void setProtection_elf(uintptr_t addr, size_t size, uint32_t prot) else { LOCK_PROT(); rb_set(mapallmem, addr, addr+size, 1); + rb_unset(memprot, addr, addr+size); UNLOCK_PROT(); } } -- cgit 1.4.1