Re: How to get imagebase after a DLL gets loaded



FWIW: Another thing that you can do _after_ the load is to call
VirtualQuery() passing it the address of some function in the DLL. That will
yield the DLL's base address among other bits of information.

This is absolutely unnecessary step, which involves a system call. What
is the point of making function calls, especially the ones that involve
user-to-kernel mode transition, at the time when you already have DLL's
base address???? Just for the fun of doing it?????


Anton Bassov


William DePalo [MVP VC++] wrote:
"Jack" <jl@xxxxxxxxxx> wrote in message
news:uUz3aYFFHHA.2268@xxxxxxxxxxxxxxxxxxxxxxx
I am wondering whether I should use
MapViewofFile to get the imagebase of a DLL
after loading that module using LoadLibrary?

I see that you have already gotten a few suggestions.

FWIW: Another thing that you can do _after_ the load is to call
VirtualQuery() passing it the address of some function in the DLL. That will
yield the DLL's base address among other bits of information.

Regards,
Will

.



Relevant Pages

  • Re: How to pass object from dll to exe? error <98>
    ... But you didn't say you were passing an object, ... std exe maininjects dll into AutoCad process space (for speed reasons ... When an EXE launches, the Windows loader, loads the program into its ... Set MyDll = oAcadApp.GetInterfaceObject ...
    (microsoft.public.vb.general.discussion)
  • Re: Critical section shared betwen dll and main program
    ... I am discussing the case of dynamic DLL ... loading and passing PCRITICAL_SECTION between old version of DLL ... and an executable which was build in newer environment. ... without passing a pointer to the kernel32.dll? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Passing LPVOID between managed to unmanaged code
    ... You can completely bypass MC++ and use P/Invoke to call the unmanaged DLL ... Neither of these two options require IntPtr. ... LPVOID as a parameter for passing the structure. ...
    (microsoft.public.dotnet.framework)
  • Re: HANDLE * Error
    ... The DLL developers recommend passing a HANDLE object using the ... On successful execution of the code 'obj' is initialised to some ... In a VC++ Windows Form Application using VS2005, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: [OT] Re: pass char* over dll-boundaries
    ... >> Passing memory from an executable to a DLL is not something that is ... your original question *was* about passing between different ... If you need a *separate* char array, ...
    (comp.lang.cpp)

Quantcast