📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Anyone Interested in MS Detours Library Express 2.1

Topic created on: December 22, 2007 19:16 CST by 2haerim .

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

  jms     December 25, 2007 00:09.12 CST
I uploaded an ImmunityDebugger script, that will resolve COM functions as seen by the external program calling them. This is useful for statically analyzing ActiveX controls for instance. In your case, just attach to the process that has the COM control loaded (or just load the control itself), run the !activex (download from here which requires comtypes and wintypes to be installed) pyCommand and then hit ALT-L to go see the output. You can then easily set BpHooks or LogBpHooks on the addresses of the functions you want to hook, and do whatever you want inside the hooks. Hope this helps!

  c1de0x   December 26, 2007 01:51.04 CST
hm....

Maybe I should rethink that idea I had for a generic COM interceptor/sniffer/fuzzer. I was thinking of either using hooks on the proxy/marshal layer of COM.

jms: want to collab on that?

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit