获取模块基地址 - GetModuleBaseAddr
函数简介
获取模块基地址。
接口名称
GetModuleBaseAddr
DLL调用
long GetModuleBaseAddr(long instance, long hwnd, string module_name);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| hwnd | 长整数型 | 窗口句柄 |
| module_name | 字符串 | 模块名 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// hwnd 为目标窗口句柄
// 获取模块基地址
long baseAddr = GetModuleBaseAddr(instance, hwnd, "game.exe");
printf("模块基地址: 0x%lX\n", baseAddr);
Python
# 待补充
返回值
成功返回模块基地址,失败返回0。
