Add support for ExCreateCallback objects to system callbacks list #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently stumbled upon an interesting change in the
ExCreateCallback
function that is responsible for creating executive callbacks like\Callback\ProcessorAdd
. It turns out that the size of theCALLBACK_OBJECT
type changed in Windows 8.1: from 40 bytes previously to 56 bytes now (going by the size thatExCreateCallback
is requesting fromObCreateObject
).It doesn't take a rocket scientist to figure out what these 16 bytes are used for: there is a new
LIST_ENTRY
at the end of theCALLBACK_OBJECT
struct thatExCreateCallback
uses to insert the callback object into theExpCallbackListHead
list (also new in 8.1). And if you traverseExpCallbackListHead
, you will quickly see that there are a lot more objects in this list than what the\Callback
directory shows! It seems that this change hasn't really been picked up on before, probably becauseCALLBACK_OBJECT
is a private type that is not in any headers or PDBs.This PR adds a typedef for the new
CALLBACK_OBJECT
that looks like this:This type is not used in the object dump procedure for callback objects; I tried doing it that way at first but quickly realized it didn't make much sense, because the second list is a reference to a global list and the list entries are really unrelated to the object itself. So I decided to add support for enumerating callback objects to the 'callbacks extra' instead.
There is a finder routine named
FindExpCallbackListHead
, which finds the address ofExpCallbackListHead
and is not particularly interesting. The dump routine (DumpExpCallbackListCallbacks
) is a bit different from the ones that are currently in the callbacks extra. This is because it is IMO not really interesting or helpful to print the address of aCALLBACK_OBJECT
(which is what is in the list). These objects are not function addresses, and they aren't even located in a kernel module. So what I have done instead is this:ExpCallbackListHead
, add a new item to the tree list that shows only the object address.CALLBACK_REGISTRATION
) in theRegisteredCallbacks
list of the object, add a new sub-item of the parent callback object. This can be 0 or many entries depending on the callback object.If this sounds confusing, here's what it looks like:
Essentially you can expand each callback object to see the callback function(s) registered with it. I preferred doing this over a flat layout, because without nesting it would be impossible to tell which registered callback functions belong to which callback object.
I did need to add a new
AddParentEntryToList
function to support doing this cleanly, and I'm no good at GUI stuff, so I hope I didn't mess that part up.