 |

08-18-2003, 09:52 AM
|
|
Junior Contributor
|
|
Join Date: Mar 2003
Posts: 274
|
|
extracting functions
|
Lets say I have a dll that I didn't make and I don't know what functions it has. Is it possible to extract the names of the functions. Eg. just the part like myfunc(parameters..) as datatype. Im not looking for the code of the functions just names.
Is it possible to use a costume dll made in C or C++ in VB. If so How?
Also is it possible to add my own functions to a dll made in C or C++ from vb?
If I make a dll with functions it then use the applypatchtofile api function to a dll in c or c++ would the functions be added from my dll to the new dll containing both functions from the dll's?
Thanx in advance.
|
Last edited by Benzakhar; 08-18-2003 at 10:03 AM.
|

09-15-2003, 08:12 AM
|
 |
Algorithms 'R' Us
Forum Leader * Guru *
|
|
Join Date: Jun 2002
Location: Canberra
Posts: 4,123
|
|
|
I can answer some of your questions:
1. A WIn32 dll is a "Portable Executable" file, and so are "exe"'s. The list of function names exported by the dll are in an "Export Table". This is easily located and read - there are various freeware "PE file info" utilities around that will do the job for you. Note that you'll see the function names, but you will not know what (or how many) parameters are required.
2. Not sure what you mean by a "costume dll", but from VB you should be able to call any DLL function, just as long as the DLL uses the same calling convention as VB. There are 2 different calling conventions, "cdecl" and "stdcall". VB only supports "stdcall", and all Windows API dll's use it, but some 3rd-party DLL's may have been built using "cdecl" (which is the default mode in Unix) in which case you can't call them from VB (but you can from many other languages, e.g. C, PowerBasic)
3. You can't "add" functions to an existing dll
Hope this helps
|
__________________
Sept, 2006: 2 ^ 232,582,657 - 1 is prime!
At first, I was iridescent. Then, I became transparent. Finally, I was absent.
|

09-15-2003, 06:30 PM
|
|
Junior Contributor
|
|
Join Date: Mar 2003
Posts: 274
|
|
Quote:
|
1. A WIn32 dll is a "Portable Executable" file, and so are "exe"'s. The list of function names exported by the dll are in an "Export Table". This is easily located and read - there are various freeware "PE file info" utilities around that will do the job for you. Note that you'll see the function names, but you will not know what (or how many) parameters are required.
|
There Is stated that you can find the function names on the "Export Table" How can I read the export table? And I need to know the parameters. I know its posible becuase VB does this. How can I get the parameters for the functions. I have VB and Visual C++ both 6.0.
Thanx in advance!
|
|

09-15-2003, 09:28 PM
|
|
Iron-Fisted Programmer
Retired Moderator * Guru *
|
|
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
|
|
Quote:
|
...I know its posible becuase VB does this.
|
VB doesn't do this. Where did you get an idea like that???
|
|

09-16-2003, 03:29 AM
|
 |
Algorithms 'R' Us
Forum Leader * Guru *
|
|
Join Date: Jun 2002
Location: Canberra
Posts: 4,123
|
|
|
Sorry, VB does NOT do that - to call a function in a DLL you have to declare it, telling VB the function and DLL name, and what the parameters are - if you get this wrong the program will crash.
If you are unfamiliar with API programming, you'll have trouble writing code to look at Export Tables - search the web for something like "PE File Viewer", there are free and/or share programs available.
Assuming your aim is legitimate, and not an attempt to "hack" something, tell us more about what you're trying to do, what the DLL is you want to use, etc....
(Whoops - just saw Thinker had already replied! Just like old times!)
|
__________________
Sept, 2006: 2 ^ 232,582,657 - 1 is prime!
At first, I was iridescent. Then, I became transparent. Finally, I was absent.
|

09-16-2003, 05:48 AM
|
 |
Martian In Disguise
Retired Moderator * Guru *
|
|
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
|
|
|
I believe that what Benzakhar is referring to is that the Object Browser is capable of displaying the members, methods, and a method's arguments.
You could use the OLEView utility to view the Type Library of a library file. You will need to do some C type translations.
If you are looking to do this programmatically, this requires the use of the TypeLib Information library (TLBINF32.DLL) which if not already in the References dialog, can be browsed to. Depending on your OS, it either resides in the System or System32 directory.
This however, is not an easy library to use. You need to have an understanding of Type Libraries and how they are structured.
NOTE:
These will not work for libraries that don't expose a Type Library (like in the DLL's used in Win32 API calls).
|
__________________
The only stupid question is the one that goes un-asked.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|