CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    Pune(INDIA)
    Posts
    77

    How to determine a DLL function's prototype

    I have a third party DLL which has some functions exported. Now I wish to call one of the functions of the DLL but I do not know the prototype of the same. How can I call it? In other words how can I know the prototype?

    I only have the DLL i.e. no lib nothing.

  2. #2
    Join Date
    Jun 2002
    Location
    Sweden
    Posts
    467

    Re: How to determine a DLL function's prototype

    This is not easy.

    It's easy to find which functions exist. But to find the parameters a bit more tricky. I used OllyDebug to do the same. OllyDebug is a Disassembler/Debugger.

    I launched OllyDebug with the other software that used the DLL and added breakpoints where the DLL was called. There you can see how many parameters is pushed. Then you have to backtrack a bit to check where the parameters is loaded to be able to figure out what they contain.

    But dont do any of this if you don't have good knowlegde about how the internals of software works. Some Assembly knowlegde is also neccasary.

    OllyDebug can be found at: http://home.t-online.de/home/Ollydbg/
    "The making of software, like the making of sausages, should never be watched."

    http://blog.gauffin.org - .NET Coding/Architecture

  3. #3
    Join Date
    Apr 2002
    Location
    Pune(INDIA)
    Posts
    77

    Re: How to determine a DLL function's prototype

    Thanks for your reply.

    Though I am not very comfortable with assembly still I need to do this very urgently so could you please guide me as to how can I accomplish this using OllyDbg?

  4. #4
    Join Date
    Jun 2002
    Location
    Sweden
    Posts
    467

    Re: How to determine a DLL function's prototype

    Sorry no. It's not easy at all and very time consuming. I spent about a month to find to idenitfy 20 functions in a DLL since it used various structs as parameters.
    "The making of software, like the making of sausages, should never be watched."

    http://blog.gauffin.org - .NET Coding/Architecture

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured