Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Exportierte Funktionen einer DLL auslesen (https://www.delphipraxis.net/95684-exportierte-funktionen-einer-dll-auslesen.html)

sk0r 11. Jul 2007 14:45


Exportierte Funktionen einer DLL auslesen
 
Guten Mittag,

ich möchte gerne alle Funktionen, welche von einer DLL exportiert werden, in ein TStringList Objekt auflisten.
Das Problem ist, dass ich schon am Anfang scheitere.

Delphi-Quellcode:
function GetFunctions(lpDllName: String):TStringList;
var
  hFile: THandle;
  ofStct: OFSTRUCT;
  IMGDebugInfo: PImageDebugInformation;
  pExportNames: Pointer;
  pExportSize: Cardinal;
begin
  hFile := OpenFile(PChar(lpDllName), ofStct, OF_READ);
  if (hFile <> 0) and (hFile <> INVALID_HANDLE_VALUE) then
  begin
    IMGDebugInfo := MapDebugInformation(hFile, PChar(lpDllName), nil, 0);
    if IMGDebugInfo <> nil then
    begin
      pExportNames := IMGDebugInfo.ExportedNames;
      pExportSize := IMGDebugInfo^.ExportedNamesSize; //<-- ist immer 0 :-(
      //Continue with the Code.
      UnmapDebugInformation(IMGDebugInfo);
    end;
    CloseHandle(hFile);
  end;
end;
Ich habe noch nie mit den obigen Funktionen gearbeitet, desshalb erhoffe ich Hilfe von euch ;)
Also, das Problem ist, dass ExportNameSize immer 0 ist. Aber wie ich aus MSDN gelesen habe
brauch ich die ja um dann an die Funktionen zu kommen.

Zitat:

ExportedNamesSize
The size of the ExportedNames member, in bytes.
ExportedNames
A pointer to a series of null-terminated strings that name all the functions exported from the image.
Da es 0 ist, gehe ich davon aus, dass er irgendwie nicht an die Funktionen kommt,
bzw. irgendwo ein Fehler ist. :(

Weiß da jemand Rat? Über Hilfe würde ich mich wirklich freuen.

MfG: sk0r

Luckie 11. Jul 2007 14:47

Re: Exportierte Funktionen einer DLL auslesen
 
Guck dir mal mein DLLExports an:
http://www.michael-puff.de/dirindex....phi/Programme/

sk0r 11. Jul 2007 21:52

Re: Exportierte Funktionen einer DLL auslesen
 
Hi, danke für den Link.

Wow, das ist echt viel komplizierter als ich angenommen habe.

Trotzdem, Danke für den Link.


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz