c++代码收集

原创
2015/07/24 16:03
阅读数 255
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;}


展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部