?
Solved

get a dll's export functions

Posted on 2003-03-18
6
Medium Priority
?
422 Views
Last Modified: 2010-04-04
hey, how can i get the list of a .dll's export functions ?
0
Comment
Question by:wsock32_
[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
 
LVL 6

Expert Comment

by:DaFox
ID: 8162835
Hi.

C:\Program Files\Borland\DelphiX\Bin\tdump.exe ;-)

Markus
0
 
LVL 3

Expert Comment

by:emadat
ID: 8162940
Use the following procedure -I got from http://delphi.about.com/gi/dynamic/offsite.htm?site=http://delphifaq.com/fq/q2133.shtml-

procedure ListDLLFunctions(DLLName: String; List: TStrings);
type
  chararr = array [0..$FFFFFF] of Char;
var
  H: THandle;
  I,
  fc: integer;
  st: string;
  arr: Pointer;
  ImageDebugInformation: PImageDebugInformation;
begin
  List.Clear;
  DLLName := ExpandFileName(DLLName);
  if FileExists(DLLName) then
  begin
    H := CreateFile(PChar(DLLName), GENERIC_READ, FILE_SHARE_READ or
      FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    if H<>INVALID_HANDLE_VALUE then
      try
        ImageDebugInformation := MapDebugInformation(H, PChar(DLLName), nil, 0);
        if ImageDebugInformation<>nil then
          try
            arr := ImageDebugInformation^.ExportedNames;
            fc := 0;
            for I := 0 to ImageDebugInformation^.ExportedNamesSize - 1 do
              if chararr(arr^)[I]=#0 then
              begin
                st := PChar(@chararr(arr^)[fc]);
                if Length(st)>0 then
                  List.Add(st);
                if (I>0) and (chararr(arr^)[I-1]=#0) then
                  Break;
                fc := I + 1
              end
          finally
            UnmapDebugInformation(ImageDebugInformation)
          end
      finally
        CloseHandle(H)
      end
  end
end;

0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8164302
I prefer http://sourceforge.net/projects/jvcl
In the examples of the included JCL there is PeViewer which has all you need.
0
Industry Leaders: 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:wsock32_
ID: 8166048
hmmz emadat ur example doesnt seem to work.. if someone can provide me a function just like emadat, that works. then that would solve my problem. thx
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 75 total points
ID: 8166317
Try the JVCL. PeViewer can be compiled without installing the JVCL.
The functions and classes to access the PE format (EXE and DLL format) are part of the Jedi Code Library (JclPeImage.pas = 191K).
It is not easy to correctly parse the PE format so a simple function is not possible. The classes of JclPeImage.pas should be as simple as possible.
0
 

Author Comment

by:wsock32_
ID: 8167490
robert, can u give me a direct link to that component.. i cant find it
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

801 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