mach_inject | interprocess code injection for Mac OS X | iOS library
kandi X-RAY | mach_inject Summary
kandi X-RAY | mach_inject Summary
mach_inject enables you to "inject" code into an arbitrary process on Mac OS X. "Injection" means both 1) copying over the necessary code into the target's address space and 2) remotely creating a new thread to execute the code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mach_inject
mach_inject Key Features
mach_inject Examples and Code Snippets
Community Discussions
Trending Discussions on mach_inject
QUESTION
While mach_inject was a handy (but risky) solution to inject some of your code to other Apps (mostly used to customize Finder), it doesn't work since 10.11. Is there a possibility to achieve the same functionality by using some sort of kext?
The purpose of this is to add some visual effects on top of windows for specific apps. Maybe there is a simpler solution, like Accessibility API? Thanks!
...ANSWER
Answered 2018-Dec-17 at 18:00Using a kext, you can certainly obtain the task handle to any process; this is the part that no longer works from user space since SIP. The task_t
pointer in the kext can be converted to a special port using task_get_special_port(task, TASK_KERNEL_PORT, &task_port)
, which you can then send to a user space task using mach_msg_send_from_kernel()
. Once you have the port in user space you can do the usual things such as allocating, reading & writing memory in the target task, etc. However, if the target task has very strict code signing flags set, any attempt to execute code in memory pages that aren't signed will fail by crashing the process. This means it won't work on most of Apple's own apps. Other methods than code injection may be easier and more secure, as you mentioned.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mach_inject
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page