https://github.com/lichtso/macinject
Command line tool and library to inject and execute program code into another process
https://github.com/lichtso/macinject
code-injection macos
Last synced: 6 months ago
JSON representation
Command line tool and library to inject and execute program code into another process
- Host: GitHub
- URL: https://github.com/lichtso/macinject
- Owner: Lichtso
- License: mit
- Created: 2014-11-23T18:12:06.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-19T22:21:35.000Z (about 11 years ago)
- Last Synced: 2025-04-12T17:02:40.539Z (9 months ago)
- Topics: code-injection, macos
- Language: C
- Size: 160 KB
- Stars: 10
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MacInject
=========
Command line tool and library to inject and execute program code in another process.
It is easy to use and does not require deep knowledge like [mach_inject](https://github.com/rentzsch/mach_inject) asserts.
Just compile a piece of code you want to inject as shared lib and call the MacInjectTool.
Notice: The tool waits for the injected code to finish in order to free all resources.
Platforms: Only Intel x64 on Mac OS 10.7+ is supported.
Example
-------
```c
#include
#include
void init() {
syslog(LOG_NOTICE, "I got inside %d\n", getpid());
}
```
`clang -shared -o InjectMe.image InjectMe.c`
`sudo MacInjectTool -p InjectMe.image -t 1234`