Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   DLL desmistificada (https://www.clubdelphi.com/foros/showthread.php?t=54355)

MaMu 15-03-2008 16:23:01

DLL desmistificada
 
Yo tengo una pregunta, por un lado yo puedo saber si una DLL contiene determinada función, haciendo:

Código Delphi [-]
function AsignaProcedure(EnQueDll,Procedimiento: string):TFarProc;
   var
     MangoProc,
     MangoLib    : THandle;

   begin
     Result:=nil;
     MangoLib:=GetModuleHandle(Pchar(EnQueDll));
     if MangoLib <> 0 then
       Result:=GetProcAddress(MangoLib,Pchar(Procedimiento));
     {Si la DLL o la procedure no esta disponible... error}
     if (MangoLib=0) or (Result=nil) then
       raise Exception.create( Procedimiento+
                               ' en '+
                               EnQueDll+
                               ' no encontrado.');
   end;

Pero, es posible obtener todos los exports? es decir, sabiendo la DLL obtener un listado de las funciones que contiene?

Saludos

Robert01 15-03-2008 16:32:21

Hola

Yo probaría con TDump que viene con Borland.

TDump nombreDll.dll -ee, si no me equivoco. Mira la ayuda para más seguridad.

Saludos

JXJ 15-03-2008 19:00:12

¿Te refieres a esto manu¡?

This utility displays the list of all exported functions and their virtual memory addresses for the specified DLL files. You can easily copy the memory address of the desired function, paste it into your debugger, and set a breakpoint for this memoery address. When this function is called, the debugger will stop in the beginning of this function.
For example: If you want to break each time that a message box is going to be displayed, simply put breakpoints on the memory addresses of message-box functions: MessageBoxA, MessageBoxExA, and MessageBoxIndirectA (or MessageBoxW, MessageBoxExW, and MessageBoxIndirectW in unicode based applications) When one of the message-box functions is called, your debugger should break in the entry point of that function, and then you can look at call stack and go backward into the code that initiated this API call.

http://www.nirsoft.net/utils/dll_export_viewer.html

luisgutierrezb 15-03-2008 19:03:09

Tambien lo puedes saber con "dependency walker" asi busca el programita, es gratis

MaMu 17-03-2008 00:06:20

Cita:

Empezado por JXJ (Mensaje 273551)
¿Te refieres a esto manu¡?

This utility displays the list of all exported functions and their virtual memory addresses for the specified DLL files. You can easily copy the memory address of the desired function, paste it into your debugger, and set a breakpoint for this memoery address. When this function is called, the debugger will stop in the beginning of this function.
For example: If you want to break each time that a message box is going to be displayed, simply put breakpoints on the memory addresses of message-box functions: MessageBoxA, MessageBoxExA, and MessageBoxIndirectA (or MessageBoxW, MessageBoxExW, and MessageBoxIndirectW in unicode based applications) When one of the message-box functions is called, your debugger should break in the entry point of that function, and then you can look at call stack and go backward into the code that initiated this API call.

http://www.nirsoft.net/utils/dll_export_viewer.html

Si, tal cual lo que decía.
Ahora me pregunto, habrá forma de abrir una DLL?, es decir, ver el source.

Saludos

Robert01 17-03-2008 00:19:25

Cita:

Empezado por mamu (Mensaje 273676)
Si, tal cual lo que decía.
Ahora me pregunto, habrá forma de abrir una DLL?, es decir, ver el source.

Saludos

No, no creo que exista una forma de hacerlo. Además el ilegal y contrario a la ética


La franja horaria es GMT +2. Ahora son las 06:55:54.

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