Is there a way in C++/windows to get the exe/DLL image base address? thanks :)
See Question&Answers more detail:osIs there a way in C++/windows to get the exe/DLL image base address? thanks :)
See Question&Answers more detail:osIf you load the binary into your own process you can use GetModuleHandle. It returns a HMODULE, but that is the same as HINSTANCE and the base address.
If you want to know what base address the binary prefers you should read the PE header. See here and look for the ImageBase field in IMAGE_OPTIONAL_HEADER.
Edit: GetModuleHandle(NULL) will return the base address (altough the specified type is HMODULE) for the current process.