Oddbean new post about | logout
 Played around with mach APIs a little to see how hard it is to inject code into a running process. Pretty similar to what you need to do on Windows.

Maybe this PoS code is helpful to others.

https://github.com/badlogic/macinject

https://cdn.masto.host/mastodongamedevplace/media_attachments/files/112/815/886/760/725/644/original/e6bbd39b00742379.mp4 
 Fun fact: On ARM64, trivial functions may not have enough space for a long jump to a newly allocated memory area with new machine code.

Praise be x86_64 for its generous prologues and epilogues! 🫠

https://cdn.masto.host/mastodongamedevplace/media_attachments/files/112/815/898/729/263/190/original/2eb0ea570c6d05c3.png

https://cdn.masto.host/mastodongamedevplace/media_attachments/files/112/815/898/733/308/683/original/738ae9c0084ad2b6.png 
 👀