tags:

views:

69

answers:

1

I have a pointer and I want to check if the referenced memory is readable, writeable and/or executable. How can I do this?

+1  A: 

You will have to parse the file /proc/self/maps which contains memory mappings of your process, and check which of the mappings lie within the value of your pointer (if any). The /proc/self/maps file contains the memory protection (read/write/execute).

See this question for more info about the maps file.

nos