GetModuleHandleA
HMODULE GetModuleHandleA(
[in, optional] LPCSTR lpModuleName // 모듈 이름
);Example
#include <windows.h>
#include <iostream>
int main() {
HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");
if (!hKernel32) {
std::cout << "kernel32.dll not loaded\n";
return 1;
}
std::cout << "kernel32.dll base address: 0x"
<< std::hex << hKernel32 << std::endl;
return 0;
}References
Last updated