Ok so i've been trying to get the object manager to work for a few days now and I haven't had any success :S. I read through
http://www.mmowned.com/forums/wow-me...e-objects.html and [Tut] Using Object Manager as well as looked for questions people have asked on the same topic and the source of a radar hack...., still no dice.
So basicly I came to the conclusion that a) I'm retarded and can't code for shit, b) im using the wrong offsets c) theres a error in my code or d) Im Doing It Wrong. Or all of the above.
I need a bit of help/guidence :S anyway heres what I can do:
uint CurrMgr = readmem(readmem(ClientConnection ) + CurrMgrOffset )
int64 LocalGuid = readmem(CurrMgr + LocalGUIDOffset )
Offsets i'm using:
ClientConnection = $00BB43F0;
CurrMgrOffset = $2EB0;
FirstObjectOffset = $AC;
NextObjectOffset = $3C;
LocalGUIDOffset = $C0; //Offset from currmanager
GuidOffset = $30;
TypeOffset = $14;
How i've gathered that the object manager works:
Find the CurrMgr/make function that returns it
FirstAddress = The base address of the first object in the list, from which you can get the GUID, type, descriptors etc = Readmem(CurrMgr + FirstObjectOffset)
All addresses after that: ReadMem(Base address of the object before them + NextObjectOffset)
So if you wanted to find the base address of the second object you would go Readmem(Readmem(CurrMgr + FirstObjectOffset) + NextObjectOffset)
So then, in order to construct a array of objects that are loaded, you loop adding the NextObjectOffset to the previousobject.baseaddress until nextobject.baseaddress = 0, which will happen when it is at the end of the object manager. Inside that loop you can do things like create a new object in a array of (whatever class you made to hold for example gameobjects, which class you use is defined by readmem(baseaddress+TypeOffset).
Sooo in delphi code:
Code:
function TWoWObjectManager.Count(WoWMaster: TWoWMaster): integer;
//Returns how many objects are loaded
var
LastAddress: Cardinal;
begin
result:= 0;
lastAddress:= Read4byteint( (CurrMgr(WoWMaster) + FirstObjectOffset), WoWMaster );
while (lastAddress <> 0) do
begin
result:= Result + 1;
lastAddress:= Read4byteint( (lastAddress + NextObjectOffset), WoWMaster );
end;
end;
Ignore the retarded wowmaster, thats just the HWND/Class I use to set it up.
Well that was a long ramble :S I think I better sleep on it since its 2am, hope someone can help or at least point me in the right direction
EDIT: Fixed it it was running in an infinite loop because my nextObject.baseaddress wasn't 0 at the end of the list
Somewhat fixed:
Code:
function TWoWObjectManager.Count(WoWMaster: TWoWMaster): integer;
var
NextObject, LastObject, ObjType: Cardinal;
x: Integer;
begin
NextObject:= Read4ByteInt((CurrMgr(WoWMaster)+ xFirstObject), WoWMaster);
x:= 0;
While (NextObject <> 0) do
begin
LastObject:= NextObject;
NextObject:= Read4ByteInt((LastObject+ xNextObject), WoWMaster);
ObjType:= Read4byteInt((NextObject + xType), WoWMaster);
{OK so this is what I had trouble with - NextObject does NOT return 0 when end of struct
so I basicly made this dodgy fix, if the objects type is >7 ie NOT AN OBJECT then
cancel the loop, so it doesnt go on forever....}
if (ObjType > 7) then
NextObject:= 0;
x:= x + 1;
end;
result:= x;
end;