MS released Detours Library Express 2.1 along with all the sources, docs, and samples. It is really a good one to hooking, injecting and so on. And it is free to use for non-commercial purpose.
You can find it from the following link:
http://research.microsoft.com/sn/detours/
I wish people here could share more information about it.
At the moment, I am trying to intercept a COM object's member function and need someone's help.
Here is what I want to do.
T.exe : An EXE program.
P.dll : A COM DLL server program supporting a coclass whose class id is CLSID_Target. The coclass implements ITarget interface. ITarget has IID_ITarget as its interface id and has a method ITarget::DetourMe().
D.dll : My own detour dll which will intercept ITarget::DetourMe(). This is what I want to create.
When T.exe runs, it calls CoCreateInstance to create a COM object with CLSID_Target.
Next, T.exe calls QueryInterface to get ITarget interface and then calls ITarget::DetourMe() method.
=> I want to create D.dll and inject it into T.exe or P.dll to intercept the ITarget::DetourMe() method and do some preprocessing and postprocessing.
I am trying to modify the 'commem' sample (it is included in the Detours Libray samples folder) for this purpose, but I am not still clear about how to achive this.
Can someone shed a light on me?
HaeRim







