通过DMA搜索二进制数据 - DmaFindData
函数简介
通过 DMA 搜索指定的二进制数据,默认步长为 1,默认开启多线程,默认搜索全部内存类型。(高级版功能,普通版无法使用)
接口名称
DmaFindData
DLL调用
OLA_STRING_RETURN OLA_CALL_TYPE DmaFindData(int64_t instance, int64_t deviceId, int32_t pid, OLA_STRING_INPUT addr_range, OLA_STRING_INPUT data);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| deviceId | 长整数型 | 设备ID |
| pid | 整数型 | 进程 PID |
| addr_range | 字符串 | 地址范围,格式:0x开始地址-0x结束地址 |
| data | 字符串 | 要搜索的二进制数据,支持 CE 数据格式(??=任意字节, ?b=低4位任意, c?=高4位任意, *=跳过任意字节) |
示例
const char* results = DmaFindData(instance, deviceId, 1234, "0x400000-0x500000", "00 01 ?? 45");
if (results != NULL && strlen(results) > 0) {
printf("搜索结果: %s\n", results);
FreeStringPtr(instance, results);
}
返回值
字符串指针,数据格式为 addr1|addr2|addr3...,示例:123456|ff001122|dc12366。
返回的字符串指针需要调用 FreeStringPtr 释放内存。
