Results 1 to 5 of 5

Thread: DLL functions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Wisconsin
    Posts
    64

    DLL functions

    Anyone know how to actually extract information for a DLL, including a list of functions, their arguments and return types? I am trying to use a function in a DLL that comes with a program I have on my computer. I can use Microsoft's Dependency Viewer (part of MS Visual Studio 6.0 Pro) to view a list of the functions, along with their oridnals and insertion point, but can't figure out how to decypher the DLL to find a list of the arguments for the function and its return type (if any). I have even tried looking at the DLL with a hex editor (which is zero help).

  2. #2
    Lively Member
    Join Date
    Aug 2001
    Location
    Crossroads of America
    Posts
    72
    I've been looking for this same type of thing for about 5 years, with no success.

    The only way that I believe you could do it is to maybe debug in assembly the program that calls the dll. I know about as much about debugging in assembly as I do about the mating habits of fruit-flies (nothing), so this is just a theory.

  3. #3
    jim mcnamara
    Guest
    If you have an undocumented dll, the best you do is to get the export names (function names) using the dependency walker (comes with Visual Studio).

    You cannot get at the arguments that way. Or any other way programatically.

    If you look up the GetVersionEx api on your MSDN distribution or at www.msdn.microsoft.com, you will find it supports a structure that returns extended version information. Part of this is the vendor or manufacturer name. If it was developed commercially, the company name is in there. Write a little code to get it. You can then pursue a net search for the company's website, and maybe find some documentation.

    Maybe not.

  4. #4
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253
    Quickview on a DLL will show you exported functions from a DLL

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yes, but not the arguments.

    I'll say it now - from just the DLL, there is NO WAY WHATSOEVER to get the argument list. The most you'll get is the total number of bytes of parameters needed to be passed. So, for example, if your DLL function has the prototype:
    Code:
    void WINAPI func(long x, short y);
    ...in VB:
    VB Code:
    1. Declare Sub func Lib "thedll" (ByVal x As Long, ByVal y As Integer)
    This requires (4+2) bytes of parameters. Therefore, you could also call the function as:
    VB Code:
    1. Declare Sub func Lib "thedll" (ByVal x As Integer, ByVal y As Long)
    This *should* work, but I doubt you'll get the right answer

    If you get the number of bytes of parameters wrong then you'll get the "Bad DLL calling convention" error.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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