通过DMA搜索整数 - DmaFindInt
函数简介
通过 DMA 搜索指定范围内的整数。支持多种整数类型。(高级版功能,普通版无法使用)
接口名称
DmaFindInt
DLL调用
OLA_STRING_RETURN OLA_CALL_TYPE DmaFindInt(int64_t instance, int64_t deviceId, int32_t pid, OLA_STRING_INPUT addr_range, int64_t int_value_min, int64_t int_value_max, int32_t type);
参数定义:
instance(长整型数): OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。deviceId(长整型数): 设备IDpid(整型数): 进程 PIDaddr_range(字符串): 地址范围int_value_min(长整型数): 最小值int_value_max(长整型数): 最大值type(整型数): 整数类型
示例:
// 搜索 32 位有符号整数(范围 100-200)
const char* results = DmaFindInt(instance, deviceId, 1234, "0x400000-0x500000", 100, 200, 0);
if (results != NULL && strlen(results) > 0) {
printf("搜索结果: %s\n", results);
FreeStringPtr(instance, results);
}
// 搜索 16 位有符号整数
const char* results2 = DmaFindInt(instance, deviceId, 1234, "0x400000-0x500000", 50, 150, 1);
if (results2 != NULL && strlen(results2) > 0) {
printf("搜索结果: %s\n", results2);
FreeStringPtr(instance, results2);
}
// 搜索 64 位整数
const char* results3 = DmaFindInt(instance, deviceId, 1234, "0x400000-0x500000", 1000, 2000, 3);
if (results3 != NULL && strlen(results3) > 0) {
printf("搜索结果: %s\n", results3);
FreeStringPtr(instance, results3);
}
返回值
字符串:
返回二进制字符串的指针,数据格式为 addr1|addr2|addr3...|addrn
示例:123456|ff001122|dc12366
注意: 返回的字符串指针需要调用 FreeStringPtr 接口释放内存
参数说明
type(整数类型):
- 0: 32 位有符号
- 1: 16 位有符号
- 2: 8 位有符号
- 3: 64 位
- 4: 32 位无符号
- 5: 16 位无符号
- 6: 8 位无符号
int_value_min 和 int_value_max:
- 定义搜索范围
- 包含边界值
应用场景
- 搜索特定数值
- 内存分析
- 游戏数据查找
相关接口
- DmaFindIntEx - 高级搜索选项
- DmaFindFloat - 搜索浮点数
- DmaFindDouble - 搜索双精度浮点数
