Exe base address

delphi package - easy access to kernel objects etc.
Post Reply
cata
Posts: 4
Joined: Sat Nov 20, 2004 6:31 pm

Exe base address

Post by cata »

Need to find exe file base address.

I used ExeMem:=CurrentProcess.HInstance; in dll initialisation

In XP everything works well, but in 98 is returned base address of dll

Any idea how to fix this in 9X ?

Thanks !
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

madKernel is quite a big thing, it adds a lot code footprint to your file. So for dlls I'd recommend to try to get along without madKernel. Except if you're using the VCL in your dll. In that case size doesn't seem to be an issue for you, anyway... :-)

But back to your question: Simply use "GetModuleHandle(0)" will get you the exe image base address.
Post Reply