-
Member
c++ internally using object manager
sorry if this is the wrong board. this is sort of a last resort for me. i dont know why this isnt working, all the offsets are from the 1.12.1 info dump thread, should be right. im trying to check object types by traversing the object manager object list, and it doesnt seem to be working correctly. to be quite honest thats all the information i can give, im drawing a blank here. ive already searched through the forum and looked at various githubs. if anyone can help me get this in working order, thatd be great. this is internal by the way.
i know that im not supposed to be looping to an arbitrary number like 30000 (just testing), but id think that thered be entities some where in there that are valid but the message box never appears.
i would like to avoid hooking and such as of right now, im just learning some basic things about wow programming before i dive into that
Code:
unsigned long __stdcall init(void* lpParam)
{
unsigned int handle = (unsigned int)GetCurrentProcess();
if (handle)
{
unsigned int *objmgr = (unsigned int*)((unsigned int)handle + 0x00B41414);
if (objmgr)
{
unsigned int *obj = (unsigned int*)((unsigned int)objmgr + 0xAC);
for (int i = 0; i < 30000; i++)
{
obj = (unsigned int*)((unsigned int)objmgr + 0xAC + (0x3C * i));
if (obj)
{
unsigned int type = *(unsigned int*)((unsigned int)obj + 0x14);
if (type == 3)
{
MessageBoxA(0, "!" "", 0);
}
}
}
}
}
return 0;
}
Last edited by xashh; 12-09-2018 at 01:42 AM.
-
You don't need to rebase the s_curMgr offset as you are doing. ASLR is not enabled in the 1.12.1 binary.
-
Post Thanks / Like - 1 Thanks
xashh (1 members gave Thanks to namreeb for this useful post)
-
Member
Originally Posted by
namreeb
You don't need to rebase the s_curMgr offset as you are doing. ASLR is not enabled in the 1.12.1 binary.
ok. i changed my code to just use unsigned int *objmgr = (unsigned int*)(0x00B41414). this works for getting the type of the object. however, when i try to access the hp like
Code:
int hp = *(int*)(((unsigned int)obj + 0x8) + 0x58);
it gives me some pretty wacky values, which makes me think im either accessing the descriptor wrong or still looping incorrectly.
Last edited by xashh; 12-09-2018 at 04:10 PM.
-
Originally Posted by
xashh
ok. i changed my code to just use unsigned int *objmgr = (unsigned int*)(0x00B41414). this works for getting the type of the object. however, when i try to access the hp like
Code:
int hp = *(int*)(((unsigned int)obj + 0x8) + 0x58);
it gives me some pretty wacky values, which makes me think im either accessing the descriptor wrong or still looping incorrectly.
Your code becomes this,
Code:
int hp = *(int*)((unsigned int)obj + 0x60);
You want,
Code:
int hp = *(uint32_t*)(*(uint32_t*)((uint32_t)obj + 0x8) + 0x58);
You need to dereference the pointers.
-
Post Thanks / Like - 1 Thanks
xashh (1 members gave Thanks to DarkLinux for this useful post)
-
Member
Originally Posted by
DarkLinux
Your code becomes this,
Code:
int hp = *(int*)((unsigned int)obj + 0x60);
You want,
Code:
int hp = *(uint32_t*)(*(uint32_t*)((uint32_t)obj + 0x8) + 0x58);
You need to dereference the pointers.
yikes lol ty for the help! i didnt realize the descriptor had its own pointer :/
Last edited by xashh; 12-15-2018 at 10:31 PM.
-
Originally Posted by
xashh
yikes lol ty for the help! i didnt realize the descriptor had its own pointer :/
You should really try out Reclass or Cheat Engines struct builder. Then you can visually see the data and know.
-
Contributor
Originally Posted by
DarkLinux
You should really try out Reclass or Cheat Engines struct builder. Then you can visually see the data and know.
I already use reclass and i find it very useful. Can you just give me a hint how to use CE builder? Thanks.