How to get the Base Address of a DLL loaded in RAM

just write whatever you want
Post Reply
Mulin
Posts: 3
Joined: Sun Aug 01, 2004 2:14 pm

How to get the Base Address of a DLL loaded in RAM

Post by Mulin »

In Delphi,

How to get the Base Address of a DLL loaded in RAM ? the name of the DLL is known, let's say ABC.DLL.

And then how to disply the memory content of (Base address of that DLL +
0x009B468C) ?

Thanks.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Is it loaded in your own process? If not, do you know in which process it is loaded?
Mulin
Posts: 3
Joined: Sun Aug 01, 2004 2:14 pm

Post by Mulin »

Thanks. It is loaded by other process, but I know the process that loaded the DLL.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Then you can use this:

Code: Select all

uses madKernel;

begin
  baseAddr := Process('targetProcess.exe').FindModule('some.dll').Handle;
Alternatively you can use the toolhelp functions. Those are not available in NT4, though, while madKernel works in NT4, too.
Post Reply