获取模块基址 - DmaGetModuleBase
函数简介
获取指定进程中模块的基址,空字符串表示主模块。(高级版功能,普通版无法使用)
接口名称
DmaGetModuleBase
DLL调用
int64_t OLA_CALL_TYPE DmaGetModuleBase(int64_t instance, int64_t deviceId, int32_t pid, OLA_STRING_INPUT moduleName);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| deviceId | 长整数型 | 设备ID |
| pid | 整数型 | 进程 PID |
| moduleName | 字符串 | 模块名,空字符串表示主模块,不区分大小写 |
示例
int64_t mainBase = DmaGetModuleBase(instance, deviceId, 1234, "");
if (mainBase > 0) {
printf("主模块基址: 0x%llx\n", mainBase);
}
int64_t dllBase = DmaGetModuleBase(instance, deviceId, 1234, "kernel32.dll");
if (dllBase > 0) {
printf("kernel32.dll 基址: 0x%llx\n", dllBase);
}
返回值
长整数型:成功返回模块基址 (>0),失败返回 0。
