Kernel extensions and code injection?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Internet Messaging Program (IMP) 3.1 I've been working on a kernel extension that adds functionality to the IOHIDSystem class. Specifically, I want to be able to intercept mouse and keyboard events, manipulate specific events, and then pass them along. The point of doing this in a kernel extension is so that I can do this before the events arrive at the target application. (Incidentally, if there is a way to do this without writing a kernel extension, perhaps at the point where the window server receives the events, please do tell! AFAIK, though, there isn't.) So the question is, is there a standard or approved way of injecting or hooking code into the kernel via a kernel extension? Or specifically, in IOHIDSystem? I'm familiar with the way programs like uControl and DoubleCommand do it, which is by creating a C++ faux-subclass for IOCommandGate, and replacing the instance of it in IOHIDSystem with a new version that has a different version of the runAction() virtual function. The problem, though, is that there are several input devices, notably some Kensington mice and all Wacom tablets, that post events to the kernel either from userspace or without utilizing IOCommandGate. Consequently, the kernel extension will miss these events. What I'm looking for is a safe way to add new functionality into the IOHIDSystem class, either by some kind of code injection, a hook, or anything really. However, I can't find any information on how one would do this in this part of the kernel. (Creating the same kind of faux-subclass for IOHIDSystem isn't feasible, since it would mean recompiling and re-releasing the kernel extension for each new subversion of Darwin.) Any ideas? - Brian bjk02@hampshire.edu _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
bjk02ï¼ hampshire.edu