macOS code injection for fun and no profit
2024-07-20
Look, ma, code injection
Table of contents
I love Live++ by Molecular Matters, aka Stefan Reinalter. It's an exceptionally fantastic C/C++ hot-reload/live coding solution for Windows, Xbox, and PlayStation 5. If you do any kind of C/C++ development on these platforms, you absolutely owe it to yourself to get a license.
I've been using it to work on a Godot module (on Windows), and it's reduced my iteration times to essentially zero for most programming tasks. If I compare the billable hours I saved with Live++ to its price, I can only conclude that Stefan hates capitalism.
Sadly, I'm a macOS boi (don't @ me), and Live++ doesn't work on macOS.
I'm on vacation and figured I'll have a look-see into what it takes to inject some code into a running process. Not that this could do anything like Live++ can do. But it's a fun, small project with a scope fitting for a lush evening sitting on a porch next to the Adriatic Sea.
Given this little C test program:
int data = 123 ; int foo () { return data; } int main ( int argc, char ** argv) { while ( true ) { printf ( "%d
... continue reading