3 ms·
Do you analyze the dynamic loader segments (to determine code-like addresses) or just do some hard-coded approximations per platform? Pretty cute idea and I ag
by loeg 4y ago
Do you analyze the dynamic loader segments (to determine code-like addresses) or just do some hard-coded approximations per platform? Pretty cute idea and I agree it will often work.
- userbinator 4y agoIt 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.