Link to home
Start Free TrialLog in
Avatar of StuartB_99
StuartB_99

asked on

Retrieving DLL Information

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
Avatar of Lischke
Lischke

Hi Stuart,

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

Ciao, Mike
Avatar of StuartB_99

ASKER

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
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
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
ASKER CERTIFIED SOLUTION
Avatar of Lischke
Lischke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 ;-)
:-))) good luck and thank you for the A grading

Ciao, Mike
Pleasure...