4 ms·
An Evil Copy: How the Loader Betrays You [pdf]
- CalChris 10y agoTL;DR when instantiating a process, constant external variables that are referenced in executables are forcefully relocated to a writable memory segment without warning So my first reaction was to add a check to see that my constants are in fact mapped read-only. const int constant_int = 42; It'd be nice to validate this read-only property and refuse to run but while mprotect() will set the memory protections there seems to be no associated getter. How do you check this in a reasonably portably manner?