I want to change the read-write-execute permissions for a specific memory region in the same process.
The following is one of the entries from /proc/pid/maps.
f606e000-f60e4000 r-xp 00000000 08:04 1873848
Is there any function to change r-xp to rwxp?
I have tried using mmap
. Copy contents of the memory region. Save it to a file. Open a memory region at the exact address and size with full permissions with its contents coming from the saved file. It works but I think there should be a better way.