Hacker News new | ask | show | jobs
by silasb 938 days ago
Can't you use `mprotect` to allow you to write to memory and execute?

https://github.com/Frodox/execute-machine-code-from-memory/t... has several examples of how to do it.

EDIT: https://www.kvakil.me/posts/2022-10-13-optimizing-mprotect-i... is another good link that explains this.