|
-
Sep 5th, 2001, 10:12 AM
#1
Thread Starter
Lively Member
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).
-
Sep 5th, 2001, 11:10 AM
#2
Lively Member
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.
-
Sep 5th, 2001, 05:22 PM
#3
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.
-
Sep 6th, 2001, 11:08 AM
#4
Frenzied Member
Quickview on a DLL will show you exported functions from a DLL
-
Sep 8th, 2001, 03:32 PM
#5
Monday Morning Lunatic
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:
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:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|