Help a beginner

c++ / delphi package - dll injection and api hooking
Post Reply
rowger
Posts: 2
Joined: Tue Jan 03, 2017 8:57 am

Help a beginner

Post by rowger »

Hi everybody and a happy new year!

I would like to use a hook on wtsapi32.dll, specifically the WTSQuerySessionInformationA Call.

However, I am a complete beginner at hooking and C++

I would be very grateful is you have the code to a similar project that you can provide me with.

Thanks.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help a beginner

Post by madshi »

Your best bet is always to take one of the demo projects as the starting point for your own hook project, and then just change the hook dll source code. E.g. try the HookProcessCreation demo, and simply replace the CreateProcess etc API hooks with an WTSQuerySessionInformationA hook. It shouldn't be very hard to do. Just be very careful to make sure that both the hook callback function and the "next" function variable definition have the exactly correct list of parameters, calling convention and return type.
rowger
Posts: 2
Joined: Tue Jan 03, 2017 8:57 am

Re: Help a beginner

Post by rowger »

I can't seem to be able to find the Demo Folder, can you please point me to it?
Thanks for bearing with me.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help a beginner

Post by madshi »

Should be "madCollection installation root\madCodeHook\Demos".
Post Reply