Created
September 8, 2014 16:58
-
-
Save smirn0v/d2f70ee1e6092d4c9f01 to your computer and use it in GitHub Desktop.
Inject from Mike Ash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void inject_init(void) __attribute__((constructor)); | |
void inject_init(void) | |
{ | |
fprintf(stderr, "Here's your injected code!\n"); | |
} | |
gcc -c injectlib.c | |
gcc -dynamiclib -current_version 1.0 injectlib.o -o injectlib.dylib | |
DYLD_INSERT_LIBRARIES=./injectlib.dylib date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment