通过DMA读取指定地址的双精度浮点数 - DmaReadDouble
函数简介
通过 DMA 读取指定地址的双精度浮点数。支持 CE 地址格式。(高级版功能,普通版无法使用)
接口名称
DmaReadDouble
DLL调用
double OLA_CALL_TYPE DmaReadDouble(int64_t instance, int64_t deviceId, int32_t pid, OLA_STRING_INPUT addr);
参数定义:
instance(长整型数): OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。deviceId(长整型数): 设备IDpid(整型数): 进程 PIDaddr(字符串): 地址,支持 CE 数据格式
示例:
// 读取双精度浮点数
double value = DmaReadDouble(instance, deviceId, 1234, "0x400000");
printf("双精度浮点数: %f\n", value);
// 使用 CE 格式地址读取
double value2 = DmaReadDouble(instance, deviceId, 1234, "[<Game.exe>+1234]+8+4");
printf("双精度浮点数: %f\n", value2);
// 读取多个浮点数
double x = DmaReadDouble(instance, deviceId, 1234, "0x400000");
double y = DmaReadDouble(instance, deviceId, 1234, "0x400008");
double z = DmaReadDouble(instance, deviceId, 1234, "0x400010");
printf("坐标: (%f, %f, %f)\n", x, y, z);
返回值
双精度浮点数:
返回读取到的双精度浮点数值
参数说明
addr(地址):
- 支持十六进制格式:
0x400000 - 支持 CE 格式:
[[[<module>+offset1]+offset2]+offset3] - 支持模块相对地址:
<Game.exe>+1234+8+4
应用场景
- 读取游戏中的浮点数据(坐标、血量等)
- 内存分析
- 数据提取
相关接口
- DmaReadDoubleAddr - 直接地址读取
- DmaReadFloat - 读取单精度浮点数
- DmaReadInt - 读取整数
