How to get the process's DLL module address?
-
How to get the process's DLL module address? And How to get process imagebase?
-
How to get the process's DLL module address? And How to get process imagebase?
-
How to get the process's DLL module address? And How to get process imagebase?
Enumerating all modules in a process can be done by EnumProcessModules(). Here is an example of enumerating all modules in a process and displaying its names. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682621(v=vs.85).aspx Load address of each modules can be retrieved by calling GetModuleInformation() for each modules. lpBaseOfDll of MODULEINFO holds the load address of the corresponding module. BOOL WINAPI GetModuleInformation( __in HANDLE hProcess, __in HMODULE hModule, __out LPMODULEINFO lpmodinfo, __in DWORD cb );
-
How to get the process's DLL module address? And How to get process imagebase?
HMODULE hMod = LoadLibrary("mydll.dll"); // load library
if (hMod) {
void (*)() myfn = (void (*)())GetProcAddress(hMod, "myfn"); // initialize pointer to myfn function inside dll
if (myfn) myfn(); // call it if it exists
FreeLibrary(hMod); // free the library
}EDIT: Wasn't exactly sure what you're asking...