3 ms·
It just needs to be on an executable page. The processor doesn't care about anything else, so this will work with things like JIT-generated code too. The key id
by userbinator 4y ago
It just needs to be on an executable page. The processor doesn't care about anything else, so this will work with things like JIT-generated code too. The key idea is that in essentially all cases of compiler-generated code, every return address will be immediately after the call that wrote it.
- loeg 4y agoYeah, but how do you look up executable page mappings? (Dynamic loader segments will have at least one executable Seg mapped somewhere.)
- userbinator 4y agoLinux: /proc/$pid/maps Windows: VirtualQuery() Mac: vm_region() Your own OS (like this article): you should know.
- loeg 4y agoOk, some platform specific mechanisms. Cool.