首页 > 编程语言 > 详细

c++代码收集

时间:2015-07-24 19:02:41      阅读:227      评论:0      收藏:0      [点我收藏+]
1.There‘s an undocumented hack that works on any version of 32-bit and 64-bit Windows that I‘ve seen. 
The HMODULE of a DLL is the same value as the module‘s base address:
static HMODULE GetThisDllHandle(){
  MEMORY_BASIC_INFORMATION info;
  size_t len = VirtualQueryEx(GetCurrentProcess(), (void*)GetThisDllHandle, &info, sizeof(info));
  assert(len == sizeof(info));
  return len ? (HMODULE)info.AllocationBase : NULL;}


c++代码收集

原文:http://my.oschina.net/yangxb0202/blog/483440

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!