Insert - Dylib [2021]
int main() anti_injection_check(); // ... rest of program
void anti_injection_check() const char *env = getenv("DYLD_INSERT_LIBRARIES"); if (env && strlen(env) > 0) fprintf(stderr, "DYLD_INSERT_LIBRARIES detected: %s\n", env); exit(1); insert dylib
DYLD_INSERT_LIBRARIES=/path/to/my.dylib /path/to/target : dyld respects this environment variable unless restricted (see SIP, hardened runtime). int main() anti_injection_check(); //
: