使用c++中从IDA导出的带有指针的结构体
Using a struct exported from IDA with pointers in C++
所以我已经从IDA Pro导出了一个结构体,并把它放在一个头文件中,像这样:
#pragma pack(push, 1)
struct CPed
{
float health;
CPed *closestPeds[10];
};
#pragma pack(pop)
在主界面中我是这样使用的:
unsigned int ClosestPed = *(unsigned int *)(*(unsigned int *)PlayerPointer + NearestPeds);
CPed *nearestPed = (CPed *)ClosestPed;
nearestPed->health = 0;
正如我所看到的,主代码中的第一行代码应该将NearestPeds
的偏移量添加到PlayerPointer
中,并将其放入ClosestPed
中。
现在ClosestPed
保存了最近的ped的地址。
现在我将该地址传递给*nearestPed
,然后最后将最近的ped的健康值设置为0
,只是,ped的健康值永远不会设置为0
。它永不消逝。
你想做这样的事情吗?
CPed* nearestPed = (CPed*)(*(PlayerPointer+9));
nearestPed->health = 0;
相关文章:
- C++ 使用成员函数返回结构体指针属性的值
- 在使用结构体和用函数填充其变量(使用指针)时遇到问题
- 如何使用结构体作为接口从函数返回指向数组的指针
- 如何在结构体中传递指向CURL的指针到向量
- 使用c++中从IDA导出的带有指针的结构体
- 设置两个结构体相等后,指针为NULL
- 结构体中的指针
- 指向结构体的向量指针错误
- 指向结构体的Void *指针
- 返回指向类定义的结构体的指针,多个作用域操作符
- 带有指针的结构体向量
- 你能解释一下指针和递归结构体吗?
- c语言中具有指针数组的结构体
- c++用数组、结构体和指针排序
- 初始化没有指针的结构体
- 如何在不激怒编译器的情况下传递指向结构体的指针?
- 如何释放一个结构体的内存,每次循环迭代的指针
- 如何根据结构体的字段之一对结构指针列表进行排序?
- 从c#调用c++函数-结构体,指针,函数指针
- /a.检测到Glibc.out: munmap_chunk():无效指针- c++结构体的动态数组