Hello all,
As a last resort im going to post here in hope someone can help me solve this issue( probably a stupid mistake). Right now i have a basic LUA function calling application that i would like to expand upon by writing some c++ functions using the object manager and then register them for use in my lua scripts.
My problem lies with the code below. I never run into a time when my local GUID and the object GUID match. I'll admit im not an expert with pointers but im working from within the process and( endscene detour) and it seems that my GUIDs for the object come back like so. The object type seems to be working as when i log it i get correct values in the range 1-7.
Code:
objGuid 11070632
objGuid 11070632
objGuid 11078928
objGuid 11095056
objGuid 11070632
objGuid 11095056
objGuid 11070632
objGuid 11070632
--------------player 0x6482207
--------------playerBaseObj 0x0
--------------playerGuid 105390599
As you can see they are different lengths and I have repeats for GUIDs( are they not supposed to be unique?)
My looping code is posted below. If someone could point out my error or at least point me in the right direction that would be great.
Thanks,
Aeo
Code:
{
/*
Object
GuidOffset = 0x0
DescFieldsOffset = 0x4
TypeOffset = 0xC
DWORD ClientConnection = 0xEBF608;
DWORD ObjectMgrOffset = 0x462C;
DWORD PlayerGuidOffset = 0xE8;
DWORD FirstObjectOffset = 0xCC;
DWORD NextObjectOffset = 0x34;*/
DWORD playerObj = 0;
DWORD dwClientConnection = *(DWORD*)((DWORD)GetModuleHandle(NULL)+ClientConnection);
DWORD dwCurMgr = *(DWORD*)(dwClientConnection+ObjectMgrOffset);
INT64 GUID = *(INT64*)(dwCurMgr+PlayerGuidOffset); //105390599
DWORD dwCurrObj = *(DWORD*)(dwCurMgr+FirstObjectOffset);
DWORD player = (DWORD)oClntObjMgrGetActivePlayer();
while (dwCurrObj != 0 && dwCurrObj%2==0) {
DWORD nextObj= *(DWORD*)(dwCurrObj+NextObjectOffset);
INT64 objGuid = *(INT64*)(dwCurrObj+0x0);
int objType = *(int*)(dwCurrObj+0xC);
Log("objGuid %i",objGuid);
if(objGuid == GUID)
{
playerObj = dwCurrObj;
break;
}
else if (dwCurrObj == nextObj)
{
break;
}
else
{
dwCurrObj = nextObj;
}
}
Log("--------------player 0x%x",player);
Log("--------------playerBaseObj 0x%x",playerObj);
Log("--------------playerGuid %i",GUID);
}