guide: debug pwi, find function addresses and offsets, write a bot(c++ code included)

10/23/2010 15:20 Interest07#76
well, it's such a basic structure that I doubt it has been changed in any patches.
11/03/2010 11:05 AEBus#77
Whether the program put in the game point coordinates and delete them?
11/03/2010 15:33 Interest07#78
I'm not sure what you mean?
11/03/2010 19:40 BuBucekTop#79
He probably mean navigation points on world map.
11/23/2010 21:22 sweetlady#80
Sorry guys, this is probably stupid but just for testing purposes I've tried to use these structures to display simple char info. But I just don't understand how am I supposed to use:
Code:
p_base0->p_base1->localplayer->dwHP
when I have:
Code:
base : 0x00a5bfcc
playerstruct base offset: 0x20
player HP: 0x474
So if p_base0 is 0x00a5bfcc, p_base1 points to what?
Aren't I supposed to get p_base0 + 0x20 == localplayer?
11/23/2010 21:58 Interest07#81
base_1 = [[baseAddress] + 0x1C]
player = [base_1 + 0x20]
11/23/2010 23:06 AEBus#82
please tell me clan offset
11/24/2010 01:37 sweetlady#83
Again, thx Interest. I haven't messed with the packet sending thingy yet cause I wanted to get some simple stuff from memory first. Well, I've tried packets and crashed the client :) so still needs some work on that. Keep you posted.
12/05/2010 21:14 blackmorpheus#84
Can anyone help me on the right track?
Just started with PWI, ( first time i'm touching this game) and i followed this tutorial the guy posted, i updated the PlayerOBJ struct manually lol, barely changed.
Ayway, this is what I have but i get a compiler error, I don't know too much about __thiscall, except that the "this" pointer is moved into ecx.

Code:
typedef void __thiscall _DoAction(void *p_localplayer, void *p_dap);
_DoAction * DoAction = (_DoAction *)0x459910;

bool bFly = false;
__tagBase0 *base = (__tagBase0 *)0xa5bfcc;

int MainThread()
{
	while(true)
	{
		if(GetAsyncKeyState(VK_F9) & 1)
		{
			DOACTIONPARAM dap;
			dap.dwAction = (bFly) ? 0x60 : 0x61;
			bFly = !bFly;
			DoAction(base->Unknown0->p_localplayer,&dap);
		}
	}
	return 0;
}
error C3865: '__thiscall' : can only be used on native member functions
12/21/2010 21:22 sweetlady#85
Anyone care to help me with this void* and pointer to pointer thingy I'm a little lost here.

Code:
typedef struct __tagWORLDOBJLISTENTRY                     // check GetObjByIdFromObjList    *** up to date ***
{
	__tagWORLDOBJLISTENTRY     *next;                     // 0x00
	void                       *p_obj;                    // 0x04       pointer to OBJ (player, mob/npc/pet, item/resource)
	DWORD                      dwId;                      // 0x08
} WORLDOBJLISTENTRY, *LPWORLDOBJLISTENTRY;


typedef struct __tagWORLDOBJLISTHEADER              // check GetObjByIdFromObjList     *** up to date ***
{
	char                 uk0[0x14];                 // 0x00
	DWORD                dwObjects;                 // 0x14       number of (valid) list entries (they are scattered over the entire list); invalid list entries == 0
	WORLDOBJLISTENTRY    **p_listentry;             // 0x18       pointer to sequential list of WORLDOBJLISTENTRYs
	void                 *lpEndOfList;              // 0x1c       either end of list or pointer to another structure
	DWORD                dwListEntries;             // 0x20       the size of the list in number of entries
	DWORD                dwIdEntryConversion;       // 0x24       Id / dwIdEntryConversion = List Entry to start
} WORLDOBJLISTHEADER, *LPWORLDOBJLISTHEADER;
So since p_listentry is a pointer to pointer, it points to what void* p_obj points to. But I just can't seem to use:
MOBLISTHEADER()->p_listentry->p_obj because I have to initialize the p_listentry first and then the p_obj. I gives me an error of type: error C2227: left of '->dwLevel' must point to class/struct/union/generic type when I test with offset 0x124 for mob level. Plus I have offset 0x50 and not 0x18 to get the moblist.

BTW localplayer works fine for me. It's really nice to have no ReadMemory.

Thx in advance
12/22/2010 12:39 blackmorpheus#86
sweetlady, here's my bot in c++. Might help you.
I've named the structures and shit different, but the idea is the same.
12/23/2010 01:12 sweetlady#87
Wow, a big thx morpheus. I just need to solve this pointer actually. Well, wanna get the bot to attack, loot. Then I'll work on other functions. I'll take a look and see how you solve my problem. Credits goes to you m8.

I see your hooking endscene with a vtable hook. Nice. I used Azorbix D3Dstarterkit so I detour the whole CreateDevice so I have access to all member functions. But it's a bit too much code for a simple drawn menu.

Good job m8!

Thanks

Although I'm still curious about the void* thing and pointer to pointer (**p_listentry).
12/26/2010 23:05 blackmorpheus#88
Quote:
Originally Posted by sweetlady View Post
Wow, a big thx morpheus. I just need to solve this pointer actually. Well, wanna get the bot to attack, loot. Then I'll work on other functions. I'll take a look and see how you solve my problem. Credits goes to you m8.

I see your hooking endscene with a vtable hook. Nice. I used Azorbix D3Dstarterkit so I detour the whole CreateDevice so I have access to all member functions. But it's a bit too much code for a simple drawn menu.

Good job m8!

Thanks

Although I'm still curious about the void* thing and pointer to pointer (**p_listentry).
You could see it as an array of pointers.

**p_listentry == *p_listentry[]
12/29/2010 00:53 sweetlady#89
Quote:
Originally Posted by blackmorpheus View Post
You could see it as an array of pointers.
**p_listentry == *p_listentry[]
Thx morph. Might endup doing like you with my structures cause I just can't seem to make it work. But I liked the idea of a void* that can be casted as mobobj, itemobj or playerobj.

It's really those two that are pissing me off:
Code:
WORLDOBJLISTENTRY    **p_listentry;     // 0x50
void                  *p_obj;           // 0x04
From what I understand of pointers to pointers is that if I assign p_listentry to p_obj, then p_listentry points to what p_obj points to. But then how the hell am I supposed to initialize and use MOBLISTHEADER()->p_listentry->p_obj
04/17/2011 10:38 shinichix#90
hey if I use this guide to make one for heroes of threekingdoms which owned by perfect word also, does it work? I just want to make simple bot like pressing tab then hotkeys after monster die then hotkey to loot, then over and over