Kernel extensions and code injection?
Kernel extensions and code injection?
- Subject: Kernel extensions and code injection?
- From: email@hidden
- Date: Wed, 16 Feb 2005 23:06:47 -0500
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
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden