Intercepting calls to dlls

Hi all,
I am attempting to intercept a call from a specific function in my code.  Unfortunately, the function call is to an interface and not an actual call.  This interface is then sent to a different dll.  I would like to be able to overwrite the location in memory to test a problem, but since I don't know what dll to attach to, I can't.  The function is in IWbemLocator, and the call is to ConnectServer.  I can monitor the call stack, but that is it.

How can I find out what dll this function is actually calling, and then how can I attach to that dll to monitor (or modify) that call?
ericlockshineAsked:
Who is Participating?
 
itsmeandnobodyelseConnect With a Mentor Commented:
You may look for the Interface names used in the registry. Each name should be associated to a GUID and when using the GUID for further queries you finally should come to an .ocx or .dll  file.

You also could check the included type libraries. If you would set the preprocessor option to resolve all header files included you also should get the header definitions of all interfaces used by type library. The type library name where you find the names is that of the dll (typically).

Or you use the Object Browser from Tools menu. You can browse for all available interfaces.

>>> and then how can I attach to that dll to monitor (or modify) that call?
That is difficult to impossible if no source code is available. And you would arise a lot of security issues if trying to hook into a COM interface.

0
 
ericlockshineAuthor Commented:
itsmeandnobodyelse,
Thanks for the information. You are correct, we were able to find the dlls in the registy, and also noted that it would be nearly impossible to attach to the process and debug without the source code.  We have changed direction, but thanks for the good information.

ericlockshine.
0
 
ericlockshineAuthor Commented:
Thanks for the assist!
0
All Courses

From novice to tech pro — start learning today.