I want to take my targetGUID and loop through my object manager and compare GUIDs until I have a match and when I do grab the X Y and Z coords of the object. I'm having trouble looping through the object manager though.
Here is my code I'm using the example from Shynd’s WoW Modification Journal and modifying it. My code never makes it to the loop.
Code:
uint s_curMgr = Memory.ReadUInt(hProcess, (0x011CA260 + 0x2864)); //client connection + curmgr offset
Console.WriteLine("0x{0:X08}",s_curMgr);
UInt64 targetGUID = Memory.ReadUInt64(hProcess, 0x010A58B8);
Console.WriteLine("0x{0:X016}",targetGUID);
uint curObj = Memory.ReadUInt(hProcess, (s_curMgr + 0xAC));
uint nextObj = curObj;
Console.WriteLine("0x{0:X08}",curObj);
UInt64 localGUID = Memory.ReadUInt64(hProcess, (s_curMgr + 0xC0));
Console.WriteLine("0x{0:X016}", localGUID);
while (curObj != 0 &&(curObj & 1) == 0)
{
Console.WriteLine("here");
UInt64 cGUID = Memory.ReadUInt64(hProcess, (curObj + 0x30));
if (cGUID == targetGUID)
{
Console.WriteLine("Match!");
float X = Memory.ReadFloat(hProcess, (curObj + 0x7D4));
float Y = Memory.ReadFloat(hProcess, (curObj + 0x7D0));
float Z = Memory.ReadFloat(hProcess, (curObj + 0x7D8));
Console.WriteLine("0x{0:X08} -- GUID: 0x{1:X016} | {2} {3} {4}", curObj, cGUID, X, Y, Z);
}
nextObj = Memory.ReadUInt(hProcess, (curObj + 0x3C));
if (nextObj == curObj)
break;
else
curObj = nextObj;
}
I don't even really understand what (curObj & 1) == 0 means but that is what is not true which makes me think my curObj is not right for whatever reason.
Any Ideas?