macOS code injection for fun and no profit
Summary
The article demonstrates macOS code injection using Mach APIs, detailing how to attach to a running process, suspend it, and read or write its memory. It then covers allocating executable remote memory, injecting new code, and creating a trampoline to overwrite an existing function. It also discusses entitlements, code signing, and caveats, highlighting the dual-use security implications of such techniques.