Re:Writing a Self-Mutating x86_64 C Program (2013)
by snek on Friday January 11, 2019 @09:47AM
(#18883864)
I was on board until `PROT_READ | PROT_WRITE | PROT_EXEC`
[ Parent
| on HN ]
Re:Writing a Self-Mutating x86_64 C Program (2013)
by orclev on Friday January 11, 2019 @10:59AM
(#18884373)
I mean, how else are you going to write self-modifying code? It's kind of implicit in the name of the thing that it's going to need to at a minimum have write and exec permission, and read is kind of important to make sure you're actually modifying the right stuff. Yes it's a terrible idea to have write and execute permissions on the same piece of memory, but that's part of why literally the very first line of the article says it's a terrible idea to write self-mutating code.