I'm currently working on hooking ntdll.dll calls via dll injection.
At first, I create thread in existing process via CreateRemoteThread()
then I load my dll via LoadLibrary
and finally hook calls on PROCESS_ATTACH
.
Injection works fine, but then I want to log all registry and file system queries. And the problem is that it doesn't work properly.
I decided to publish code via PasteBin, because piece is pretty big. Here is the link: http://pastebin.com/39r4Me6B
I'm trying to hook ZwOpenKey
, then log key content and then launch "true" function by pointer. Function NOpenKey
gets executed, but process stops without any errors.
Does anyone see any issues?