-
June 20th, 2006, 04:23 AM
#1
Finding Syntax of a dll function
Hi,
I have obtained a dll created in VC++ whose source code i don't have.I want to use this dll in my vc++ application.But i know I need the lib file and header files associated with the dll file in order for me to use it in vc++.But is there some way I can obtain the syntax of the functions exported by the dll ,like the number and type of arguments etc. so that i can call the dll function in vb.I tried using Dependency Walker but it does not seem to provide the kind of information i need.Please help
-
June 20th, 2006, 05:32 AM
#2
Re: Finding Syntax of a dll function
Well, not really. OK, there is the option of disassemblying it (if that's allowed for your DLL) and try to figure out from the ASM code what the signatures are.
-
June 20th, 2006, 05:41 AM
#3
Re: Finding Syntax of a dll function
Originally Posted by dreamer60
Hi,
I have obtained a dll created in VC++ whose source code i don't have.
You don't need the source code. Are the functions documented? If not, what good does it do if you don't know what those functions are supposed to do? That type of information cannot be discovered with Dependency Walker.
Yes, you can try to guess the parameters and what they mean, but that is programming calling functions blindly without any context of what those functions do, what the parameters are supposed to denote, what order to call the functions, etc.
In other words, get the documentation. It is worth far more than the source code.
Regards,
Paul McKenzie
-
June 20th, 2006, 07:40 AM
#4
Re: Finding Syntax of a dll function
Thanks... but i found the same problem on some web site and as directed by them i downloaded the latest verion of Dependency Walker .
http://www.dependencywalker.com
and they have a screen shot of a dll being opened in the Dependency Walker.And the screen shot shows the syntax of a dll function (check the screen shot). But at the same time they also make it clear that the definiction of most dlls cannot be viewed...Could do with a modification, eh?
OK , how can we disassemble a dll and obtain the signature of fucntion calls?
-
June 20th, 2006, 07:51 AM
#5
Re: Finding Syntax of a dll function
I'm using that same version of Dependency Walker and it does not seem to have a problem displaying function signatures. However, it does appear that it will not display 'C' type function signatures.
Gort...Klaatu, Barada Nikto!
-
June 20th, 2006, 08:14 AM
#6
Re: Finding Syntax of a dll function
From the FAQ of the Dependency walker program:
How do I view the parameter and return types of a function?
For most functions, this information is simply not present in the module. The Windows’ module file format only provides a single text string to identify each function. There is no structured way to list the number of parameters, the parameter types, or the return type. However, some languages do something called function "decoration" or "mangling", which is the process of encoding information into the text string. For example, a function like int Foo(int, int) encoded with simple decoration might be exported as _Foo@8. The 8 refers to the number of bytes used by the parameters. If C++ decoration is used, the function would be exported as ?Foo@@YGHHH@Z, which can be directly decoded back to the function's original prototype: int Foo(int, int). Dependency Walker supports C++ undecoration by using the "Undecorate C++ Functions Command".
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
|