Intercepting calls to dlls

Posted on 2009-04-27
Last Modified: 2013-12-14
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?
Question by:ericlockshine
    LVL 39

    Accepted Solution

    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.


    Author Comment

    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.


    Author Closing Comment

    Thanks for the assist!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now