开发者

module handle through base address

开发者 https://www.devze.com 2023-04-05 08:27 出处:网络
Im\' trying to get the module h开发者_开发问答andle of a module in C++ on windows. My problem is that I have only the base address and File handle of the module but GetModuleHandle receives only its n

Im' trying to get the module h开发者_开发问答andle of a module in C++ on windows.

My problem is that I have only the base address and File handle of the module but GetModuleHandle receives only its name as a parameter.

Is there a way in c++ on windows to obtain a module handle without knwoing the module's name?


Have you tried using GetModuleHandleEx (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)lpBaseAddress, &module)?


Use GetModuleHandleEx if you use WindowsXP or later. For previous Windows versions like Windows2000 this function is not available, but there is alternate solution, check comments at the bottom of this page: http://msdn.microsoft.com/en-us/library/ms683200(v=VS.85).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号