[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Retrieving DLL Information

Posted on 2000-01-21
8
Medium Priority
?
219 Views
Last Modified: 2010-04-04
Hi,
I have been given a dll that contains a set of complicated procedures and functions that I require.

Unfortunatly I do not have to code or details of the procedures and functions ! ;-(

Is there any way I can extract both the exported procedure names and the variables needed to be passed to them?

Thanks in advance

Stu
0
Comment
Question by:StuartB_99
  • 4
  • 4
8 Comments
 
LVL 10

Expert Comment

by:Lischke
ID: 2374388
Hi Stuart,

you can export procedure/function names but not the parameter list.

Ciao, Mike
0
 

Author Comment

by:StuartB_99
ID: 2374408
Cheers Mike,
So if the DLL Contains a procedure called PrintThis; and the procedure looks like

Procedure PrintThis(PrintText : String;
                    X,Y       : Integer;
                    Colour    : TColor);

Is there no way I can find out that I need to pass a string, 2 X ints and a tcolor?

If not how can I find out what functions ect are exported ie.) how can I find out that there is a proc called printThis within the DLL and can I get a list of all the exported procedures within the Dll?

Sorry to be a neucense but I realy dont fancy re-writing the Dll ;-)

Cheers
Stu
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2374445
Well, with a lot of knowledge and a fair amount of luck and inspiration you might be able to get also the parameter list. E.g. if you know the stack depth clear after return of the proc or some internal variables etc.

Generally speaking, you only can get the procedure names. Depending on the needs you have there are several options:

- use QuickView (right click on the DLL file in Explorer to get a list of the names)
- for more and persistent information use TDump.exe from Delphi (option: dump exports)
- if you need the info in your program then you need to enumerate the export table of the DLL (that's what the mentioned programs do too), but this will become a bit messy

Tell what you need.

Ciao, Mike
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:StuartB_99
ID: 2374526
Exports from Utils.dll
  7 exported name(s), 7 export addresse(s).  Ordinal base is 1.
  Sorted by Name:
    RVA      Ord. Hint Name
    -------- ---- ---- ----
    00092A34    7 0000 Display
    00092DD4    3 0001 GetItemCost
    00092C48    4 0002 GetPOR
    00092F14    2 0003 GetRSP
    000930A4    1 0004 RunNewOrderWizard
    00092B90    5 0005 ShowAboutBox
    00092AE4    6 0006 ShowSplashScreen

I retrieved this from TDump which is definatly the first part of what I need. The big problem I have is when I now call these procedures in my app
ie

Function GetPOR; external 'Utils.Dll';

This is great, but I know for a fact that I need to pass the function some parameters? but I dont know what they are. This is the info that I would pay vast amounts of money for as there are about 4 Dlls that I need but dont want and havent got the time to re-write?

Please tell me you know exactly how to help me???????? ;-)

Stu
0
 
LVL 10

Accepted Solution

by:
Lischke earned 400 total points
ID: 2374661
Sorry Stu,

but even for one million dollar, you cannot read the parameter lists from a DLL. They aren't stored there!

You can only load the DLL and call the function in question. Step at assembler level to see how the function works with the stack (as that's the place where the parameter are passed on).

Ciao, Mike
0
 

Author Comment

by:StuartB_99
ID: 2374709
Oh well Mike,
Thanks for all your help you were the only one offering so heres some hard earned points for you ;-).

Ill try and step through it but I dont think Im expierienced enough to succeed but we can try ;-(..

Cheers mate

Stuart ;-)

PS: It was £2Million on the table ;-)
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2374733
:-))) good luck and thank you for the A grading

Ciao, Mike
0
 

Author Comment

by:StuartB_99
ID: 2374759
Pleasure...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question