I've been working on getting attributes from actors for a while now, and I can't seem to get it down. Right now, I'm getting access violations when I call GetInt(). Can anyone share some insight?
For 1.0.3.10485 I have this setup:
Code:
int __cdecl GetPlayerGUID() //0x97EBF0
void* __cdecl GetActorPtrFromGUID(int) //0x829F90
int __thiscall GetInt(void*, int) //0x8C7700
#define Hitpoints_Cur 103
And I'm running in EndScene:
Code:
int myGuid = GetPlayerGUID();
void* myPtr = GetActorPtrFromGUID(myGuid);
// Everything OK up to this point
// Fails here (access violation)
int hp = GetInt(myPtr, Hitpoints_Cur);
// Also fails (access violation):
int hp = GetInt(myPtr, Hitpoints_Cur | 0xfffff000);
The access violation is in GetAttributeFromFAG (0x870f60)
Code:
00870F60 push ebp
00870F61 mov ebp,esp
00870F63 mov eax,dword ptr [ebp+10h]
00870F66 mov ecx,eax
00870F68 sar ecx,10h
00870F6B xor ecx,eax
00870F6D push esi
00870F6E mov esi,dword ptr [ebp+0Ch] ; here
00870F71 and ecx,dword ptr [esi+0C8h]