Retrieving the base address of a module in another process requires to enumerate the process' modules and retrieve the module names to find a match.
To enumerate the modules loaded into a process call EnumProcessModules
. Once you have the list of modules call GetModuleBaseName
for each module to find the one you are looking for (application_name.exe). The HMODULE
for this module is a pointer (in the target process' address space) to the beginning of the module, it's base address. You can use this to add your offset.