Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   saber Funciones de una DLL (https://www.clubdelphi.com/foros/showthread.php?t=11611)

cesar_picazo 18-06-2004 21:02:58

saber Funciones de una DLL
 
Estoy utilizando delphi 6 y estoy agregando dlls

Hola buenas tardes, estoy intentando usar una dll de un cliente, pero no tienen la documentaciòn de las funciones que componen dicha dll, existe alguna forma de obtener los nombres de las funciones y sus parametros.

Sin màs por el momento me despido

delphi.com.ar 18-06-2004 21:07:14

Los nombres de las funciones de exportación, si!.. puedes buscar una herramienta llamada "Dependency Walker". Pero no hay forma de conocer los parámetros de las mismas.

Saludos!

__marcsc 18-06-2004 21:11:41

Si te interesa tengo este código para obtener la lista de funciones de una DLL.

Código Delphi [-]
procedure ListDLLFunctions(DLLName: String; List: TStrings);
var
  Image: TLoadedImage;
  PExpDir: PImageExportDirectory;
  PExportedNames: Pointer; //pointer to list of exported functions
  Ptr: PImageSectionHeader;
  i: Integer;
  ExportedFunctionName: PChar;
begin
  List.Clear;
  //load the file into memory.
 if FileExists(DLLName) then
 begin
   try
      MapAndLoad(PChar(DLLName),PChar('#0'),@Image,True,True);
      pExpDir:= PImageExportDirectory(Image.FileHeader.OptionalHeader.DataDirectory
       [IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
      pExpDir:= PImageExportDirectory(ImageRvaToVa(Image.FileHeader,
       Image.MappedAddress,DWORD(pExpDir),Ptr));
      PExportedNames:= pExpDir.AddressOfNames;
      PExportedNames:= ImageRvaToVa(Image.FileHeader,Image.MappedAddress,DWORD(PExportedNames),Ptr);
      for i:= 0 to pExpDir.NumberOfFunctions - 1 do
      begin
        ExportedFunctionName:= PChar(ImageRvaToVa(Image.FileHeader,
         Image.MappedAddress,DWORD(PExportedNames^),Ptr));
        List.Add(ExportedFunctionName);
        inc(PInteger(PExportedNames));
      end;
  finally         
     UnMapAndLoad(@Image); //Unload the mapped file from memory.
  end;
 end;
end;

Si no te interesa hacerlo por código, puedes utilizar, en el intérprete de comandos:

Código:

tdump -ee Midll.dll
No hay forma de conocer los parámetros, para eso necesitarás la documentación. Sorry.

Saludos!


La franja horaria es GMT +2. Ahora son las 13:07:03.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi