Ive been toying around some time now... cant get it to work. what i want to do is traverse the objectmanager.
code as follows:
[SPOILER]
Code:
namespace BlackRainTest
{
class WoWObject
{
public uint address = 0;
public WoWObject(uint address)
{
this.address = address;
}
public ulong GUID
{
get
{
BlackMagic wow = new BlackMagic();
wow.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle("World of Warcraft"));
return wow.ReadUInt64(this.address);
}
}
public int Type
{
get
{
BlackMagic wow = new BlackMagic();
wow.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle("World of Warcraft"));
return wow.ReadInt(this.address + 0x8);
}
}
}
class Program
{
public static uint CLIENT_CONNECTION = 0x8B3F78;
public static uint OBJECT_MANAGER_OFFSET = 0x462C;
public static uint FIRST_OBJECT = 0xB4;
public static uint NEXT_OBJECT = 0x3C;
public static uint LOCAL_GUID_OFFSET = 0xB8;
static void Main(string[] args)
{
BlackMagic wow = new BlackMagic();
wow.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle("World of Warcraft"));
uint clientconnection = 279883368; // wow.ReadUInt(CLIENT_CONNECTION);
uint objectmanager = wow.ReadUInt(clientconnection + OBJECT_MANAGER_OFFSET);
uint firstobject = wow.ReadUInt(objectmanager + FIRST_OBJECT);
ulong localplayerguid = wow.ReadUInt64(objectmanager + LOCAL_GUID_OFFSET);
WoWObject currentObject = new WoWObject(firstobject);
while (currentObject.address != 0 && currentObject.address % 2 == 0)
{
WoWObject wowobj = new WoWObject(currentObject.address);
if (wowobj.GUID == localplayerguid)
{
// Find myself
}
if (wowobj.Type == 4)
{
// If objecttype is 4
}
currentObject.address = wow.ReadUInt(currentObject.address + NEXT_OBJECT);
}
}
}
}
[/SPOILER]
And there are 2 problems:
1) Im not reading the type correct, it outputs (when it does) a number > 7
2) I never get to the part where i found myself
Please just look at the code and if you see anything obvious wrong, tell me. I've been lookin at my memoryreader and forum posts a couple of days now.
Don't mind the static connectionmanager unless you could tell me why i cant read the clientconnection address that way using blackmagic (what i did is read if from another application I made that fetches it for me).
Im using RivaLfr's offsets from http://www.mmowned.com/forums/world-...ml#post1985880
The way of traversing the objectmanager is fetched from "MBot", but I wanted to use Blackmagic (and there is where i got the clientconnection address).
I know the code is very crude, but I really wanted to prototype some stuff so made it as easy as I could.
I would really love it if someone could straighten out my errors. Ty ty in advance -yeahlol