[英]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;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.