#include<iostream>
#include<windows.h>
#include<tchar.h>
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
void dumpModule() {
HMODULE hModule = GetModuleHandle(nullptr);
_tprintf(TEXT("with GetModuleHandel(nullptr)=0x%p \n"), hModule);
_tprintf(TEXT("with __ImageBase=0x%p \n"), (HANDLE)&__ImageBase);
hModule = nullptr;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,(PCTSTR)dumpModule,&hModule);
_tprintf(TEXT("with GetModuleHandleEx=0x%p \n"), hModule);
}
int _tmain() {
dumpModule();
system("pause");
return 0;
}