Solved

DLL import functions???

Posted on 1997-10-31
6
293 Views
Last Modified: 2010-04-04
Given a DLL with no supporting documentation around what functions it contains, and what parameters it takes for each function, how would you go about finding this information out?

I know how to get hold of the functions that it contains, the main problem that I have is I don't know what parameters each function takes...


I won't accept the response 'Talk to the author, what DLL is it' and other related statements.
0
Comment
Question by:john_m
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:john_m
ID: 1349209
Edited text of question
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1349210
Unfortunatelly you can't. You can get names of exported function and paramcount for this, however you don't know what you can do with this. If this can help you then try find NEWEXE.ZIP at FtpSearch. This is utility for dumping exe and dll (without flat drivers).

good luck.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1349211
You can get a decompiler, and decompile the dll. then you can check the parametrs of the function, and what it does
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:john_m
ID: 1349212
Unfortunately I know all this already. If you could recommend a decompiler though, maybe that would be worth some points...
0
 
LVL 1

Accepted Solution

by:
ergates earned 350 total points
ID: 1349213
This is obviously a tough one.

I managed to reverse engineer an interface in the Trumpet Winsock  
DLL, which is used by the Trumpet "TCP meter" application. (It's probably all changed now).

What I did was put the DLL call into my code, and then step through the code by assembler instructions. When you step into the called routine, you can see the assembler code for it. Now you need to 80x86 assembler and know what calling conventions are used, i.e. where and how parameters are passed. They are usually passed on stack, but may also be passed in registers. In the called routine look for access to the stack to get parameters. You can tell if the called routine is expecting an address.

Similarly, returned parameters are left in registers or are pushed back onto the stack before the routine returns.

Using this I was able to deduce the interface, though there was one parameter I never worked out! I had a pretty good idea that the routine returned two ints, one for received and transmitted bytes.

Note the above was done with BPW not Delphi, but the principle is the same. I have seen a decompiler that works on TPUs, and also on (C) .exe programs. Working out the types is possible, if you know how compilers generate code (which I do) to access them. It would be very difficult without knowledge of what the routines are supposed to do.

I would be interested to know what DLL you want to decode and why, unless it is just an academic exercise.

Regards,
0
 

Author Comment

by:john_m
ID: 1349214
egrates,
Cheers for the info. Although I don't have enough information to continue with what I wanted to do, you did at least give a fair answer to a fair question. FYI the DLL I have been looking at is DCC.DLL as supplied with Delphi 3... Doubtful that I'll get anywhere with it though...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
TServerSocket - file via sendbuf or Text via sendtext ? 1 76
Multiple image collision 13 89
Create a path if not exists 7 108
delphi popmenu non latine charcters 3 35
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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