Originally Posted by
FinnX
How do you come to the objMgr offset 0x00BE1D2C? Its totally false.
You are false. There's just a problem with line:
Code:
nextObject = wow.ReadUInt(nextObject + 0x4);
in first post.
Originally Posted by
FinnX
And btw, you read the GUID wrong its more likely:
[[CurObj + Descriptor] + 0x0]
Guid is both in descriptors and [obj+0x30].
Code:
const int s_curMgr = 0x00BE1D2C;
const int FirstObjectOfs = 0xC; // or 0xCC
const int NextObjectOfs = 0x4; // or 0xC4
IntPtr objMgr = Memory.Read<IntPtr>(Memory.BaseAddress + s_curMgr);
IntPtr curObj = Memory.Read<IntPtr>(objMgr + FirstObjectOfs);
while (curObj != IntPtr.Zero && (curObj.ToInt64() & 1) == 0)
{
int type = Memory.Read<int>(curObj + 0x10);
ulong GUID = Memory.Read<ulong>(curObj + 0x30);
logText.Text += "Object: [" + GUID.ToString("X16") + "]" + type + "\r\n";
curObj = Memory.Read<IntPtr>(curObj + Memory.Read<int>(objMgr + NextObjectOfs) + 0x4);
}
If you use FirstObjectOfs = 0xC and NextObjectOfs = 0x4, Memory.Read<int>(objMgr + NextObjectOfs) will return 0x24, that's why you can do it like this as well:
Code:
curObj = Memory.Read<IntPtr>(curObj + 0x28);
and if you use FirstObjectOfs = 0xCC and NextObjectOfs = 0xC4, Memory.Read<int>(objMgr + NextObjectOfs) will return 0x38, that's why you can do it like this as well:
Code:
curObj = Memory.Read<IntPtr>(curObj + 0x3C);
Blizzard's code for those wondering:
Code:
bool __cdecl ClntObjMgrEnumVisibleObjects(int (__cdecl *callback)(QWORD, _DWORD), void *pData)
{
int current; // eax@1
int next; // esi@6
current = *(_DWORD *)(s_curMgr + 0xCC); // 0xCC - FirstObjectOfs
if ( current & 1 || !current )
current = 0;
while ( !(current & 1) && current )
{
next = *(_DWORD *)(*(_DWORD *)(s_curMgr + 0xC4) + current + 4); // 0xC4 - NextObjectOfs; *(_DWORD *)(s_curMgr + 0xC4) = 0x38 in this case
if ( !callback(*(QWORD *)(current + 0x30), pData) ) // 0x30 - ObjectGuidOfs
return 0;
current = next;
}
return 1;
}