Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Perfect World
You last visited: Today at 23:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PWI - Resources/Loot Structure

Discussion on PWI - Resources/Loot Structure within the Perfect World forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2010
Posts: 75
Received Thanks: 2
PWI - Resources/Loot Structure

Hi all,

Been working on a small project, so far with 2h of coding and reading I'm already able to read all the NPC's info and player info.

But can't seem to be able to read any resources info :/

I think I found the resource count at: baseCall + 0x1C + 0x1C + 0x28 + 0x18 + 0x4 + 0x4

Can anyone give me some insight off the loot struct offsets?

(To see if i can pass to the 2nd stage of my project -> do stuff lol)

Thx
Subzero12 is offline  
Old 04/24/2012, 01:24   #2
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
Unfortunately there is no sorted list of resources, so you need to scan all 768 entries in the list:
Code:
[[[[[[[baseCall]+0x1C]+0x1C]+0x28]+0x18]+i*4]+0x4]
where i is 0 to 767.

Here's a little C# demo:
Form1.cs

MemFunctions.cs

Form1.Designer.cs

Good luck
dumbfck is offline  
Thanks
1 User
Old 04/24/2012, 10:41   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 75
Received Thanks: 2
Thx I had a mistake in my item base pointer

I will try to correct it later and its time to start sending packets
Subzero12 is offline  
Old 04/24/2012, 11:15   #4
 
Interest07's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
Good luck

It's nice to see people programming their own stuff Your questions will be answered promptly if you have any I'm sure
Interest07 is offline  
Thanks
2 Users
Old 04/24/2012, 21:03   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 75
Received Thanks: 2
The problem was:
uint pointer = MemFunctions.MemReadUInt(p, MemFunctions.resolveNestedPointer(p, baseCall, 0x1C, 0x1C, 0x28, 0x18));
uint itemBase = MemFunctions.MemReadUInt(p, MemFunctions.resolveNestedPointer(p, pointer + (i * 0x4), 0x4));

It continues to be in the move action, because I'm having an hard time figuring out when to use a MemRead or a resolveNestedPointer, any guide/tutorial that i can read in order to better understand this?
Or this knowledge comes from using CE and browsing the memory for the game?
Subzero12 is offline  
Old 04/24/2012, 22:16   #6
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
You would use a MemRead to just read a single memory location, e.g.,
Code:
MemRead(processHandle, 0x123456);
resolveNestedPointer is a little function I made up to make searching for nested pointers a bit easier. You literally just feed it a base and any number of offsets and it automagically recurses through a bunch of MemReads.
Say for example, you had (in the notation you'll see around these forums)
Code:
[[[[[[baseCall]+0x1C]+0x1C]+0x28]+0x4]0x4]
You'd simple call it like:
Code:
uint baseCall = 0xA521C0;
MemFunctions.resolveNestedPointer(processHandle, baseCall, 0x1C, 0x1C, 0x28, 0x4, 0x4);
To get the address of that last pointer. If you wanted to read data in that last pointer, as long as you want it in uint form, you can just add a 0 to the end of that list.
If what you want to eventually read is not a uint, you'll need one of the other read functions to read the final address you get from resolveNestedPointer.
So, say for example, that pointer chain pointed to a float, you could do something like:
Code:
MemFunctions.MemReadFloat(p, MemFunctions.resolveNestedPointer(p, baseCall, , 0x1C, 0x1C, 0x28, 0x4, 0x4));
Which would be the equivalent of this if you broke it into two steps with an intermediate variable:
Code:
uint pointerToFloat = MemFunctions.resolveNestedPointer(p, baseCall, , 0x1C, 0x1C, 0x28, 0x4, 0x4);
float derp = MemFunctions.MemReadFloat(p, pointerToFloat);
If you were to look at that offset chain in CE, it would look like:


What language are you actualy using anyway? C#?
If you're using C#, you could try fiddling with it and setting breakpoints after your reads, then seeing if they match up with the values in CE. If your value matches one of the intermediate memory values shown in the CE window (see above) then you need another offset at the end of the chain.
Hope I'm making sense lol
dumbfck is offline  
Old 04/25/2012, 12:08   #7
 
Interest07's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
Quote:
Originally Posted by dumbfck View Post
You would use a MemRead to just read a single memory location, e.g.,
Code:
MemRead(processHandle, 0x123456);
resolveNestedPointer is a little function I made up to make searching for nested pointers a bit easier. You literally just feed it a base and any number of offsets and it automagically recurses through a bunch of MemReads.
Say for example, you had (in the notation you'll see around these forums)
Code:
[[[[[[baseCall]+0x1C]+0x1C]+0x28]+0x4]0x4]
You'd simple call it like:
Code:
uint baseCall = 0xA521C0;
MemFunctions.resolveNestedPointer(processHandle, baseCall, 0x1C, 0x1C, 0x28, 0x4, 0x4);
To get the address of that last pointer. If you wanted to read data in that last pointer, as long as you want it in uint form, you can just add a 0 to the end of that list.
If what you want to eventually read is not a uint, you'll need one of the other read functions to read the final address you get from resolveNestedPointer.
So, say for example, that pointer chain pointed to a float, you could do something like:
Code:
MemFunctions.MemReadFloat(p, MemFunctions.resolveNestedPointer(p, baseCall, , 0x1C, 0x1C, 0x28, 0x4, 0x4));
Which would be the equivalent of this if you broke it into two steps with an intermediate variable:
Code:
uint pointerToFloat = MemFunctions.resolveNestedPointer(p, baseCall, , 0x1C, 0x1C, 0x28, 0x4, 0x4);
float derp = MemFunctions.MemReadFloat(p, pointerToFloat);
If you were to look at that offset chain in CE, it would look like:


What language are you actualy using anyway? C#?
If you're using C#, you could try fiddling with it and setting breakpoints after your reads, then seeing if they match up with the values in CE. If your value matches one of the intermediate memory values shown in the CE window (see above) then you need another offset at the end of the chain.
Hope I'm making sense lol
In the end, if the nested pointer stuff confuses you, you don't have to use it.
using a pattern of:
Code:
uint basePointer = readMem(realBaseAddress);
uint pStructures = readMem(basePointer + 0x1C);
uint pPlayer = readMem(pStructures + 0x34);
uint hp = readMem(pPlayer+ 0xXXX);
works just as well, as that's what the resolve nested pointer does internally anyway (as far as i know )

It's the way I personally do it, as I have my classes structured in the same way as PW does, so it ends up doing one or two mem read calls in each class.
Interest07 is offline  
Old 04/25/2012, 12:42   #8
 
elite*gold: 0
Join Date: Jun 2010
Posts: 75
Received Thanks: 2
Hmmm I see.

Then if I need the action struct addresses:
PHP Code:
uint addr1 MemFunctions.MemReadUInt(pr_processHandle0x00A521C0);
uint addr2 MemFunctions.MemReadUInt(pr_processHandleaddr1 0x1C);
uint addr3 MemFunctions.MemReadUInt(pr_processHandleaddr2 0x34);
uint actionStruct MemFunctions.MemReadUInt(pr_processHandleaddr3 0x109c);
uint actionList MemFunctions.MemReadUInt(pr_processHandleactionStruct 0x30);
uint moveAction MemFunctions.MemReadUInt(pr_processHandleactionList 0x8); 
And then to move to X,Y,Z I just need:
PHP Code:
MemFunctions.MemWriteInt(pr_processHandle, (int) moveAction 0x80); 
MemFunctions.MemWriteInt(pr_processHandle, (int) moveAction 0x141);
MemFunctions.MemWriteFloat(pr_processHandle, (int) moveAction 0x28X);
MemFunctions.MemWriteFloat(pr_processHandle, (int) moveAction 0x2CY);
MemFunctions.MemWriteFloat(pr_processHandle, (int) moveAction 0x30Z);
MemFunctions.MemWriteInt(pr_processHandle, (int) moveAction 0x380);
MemFunctions.MemWriteInt(pr_processHandle, (int)actionStruct 0xC, (int) moveAction);
MemFunctions.MemWriteInt(pr_processHandle, (int)actionStruct 0x181);
MemFunctions.MemWriteInt(pr_processHandle, (int)actionStruct 0x14, (int) moveAction); 
Or I need to write any other value? (My char won't move xD)

Btw, Yes I'm using C# Trying to learn something more about it (so far seems very similar to C++/Java).
Subzero12 is offline  
Old 04/25/2012, 12:50   #9
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
I've never actually used action structs for moving, so I'm not sure about the process of doing so... However, check you don't have your Z and Y co-ordinates swapped. They're stored in X,Z,Y order, not X,Y,Z.
dumbfck is offline  
Old 04/25/2012, 12:53   #10
 
Interest07's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
Quote:
Originally Posted by dumbfck View Post
I've never actually used action structs for moving, so I'm not sure about the process of doing so... However, check you don't have your Z and Y co-ordinates swapped. They're stored in X,Z,Y order, not X,Y,Z.
>.> They ARE stored in X, Y, Z order. It's a good idea to check you are using the CORRECT order though
Interest07 is offline  
Old 04/25/2012, 12:56   #11
 
Sᴡoosh's Avatar
 
elite*gold: 20
Join Date: May 2009
Posts: 1,290
Received Thanks: 326
Everybody seems to have a knack with not accepting that Z is the "real" Y here, and Y is height. This is usual in d3d coordinate systems - even though I , for some reason, hate Y being height. No clue why. In my code internals, Y is always Z, and Z is height
Sᴡoosh is offline  
Old 04/25/2012, 12:56   #12
 
elite*gold: 10
Join Date: Sep 2010
Posts: 400
Received Thanks: 234
Quote:
Originally Posted by Interest07 View Post
>.> They ARE stored in X, Y, Z order.
Ok, they're not stored how normal people think of X,Y,Z lol. Your brain works in mysterious ways... Brilliant... but mysterious
dumbfck is offline  
Old 04/25/2012, 13:01   #13
 
Interest07's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
You people are hopeless

I'll have to send for the people with the nice white jackets that lets you hug yourself. Maybe they can teach you the error of your ways. The smart ones are always the craziest. Looking to see if the OP put the X Y Z values in the correct order was a good tip though, I'll give you that. Shame you're all so misguided in what correct means though.
Interest07 is offline  
Old 04/25/2012, 13:07   #14
 
Sᴡoosh's Avatar
 
elite*gold: 20
Join Date: May 2009
Posts: 1,290
Received Thanks: 326
For me :
X = X coordinate, 2D
Y = Y coordinate, 2D
Z = Height

Will always be manifested in my brain Probably from when I still played pw, people refered to it as X/Y to.

Interest, do pass me one of those fluffy, white jackets though, will you?
Sᴡoosh is offline  
Old 04/25/2012, 13:20   #15
 
elite*gold: 0
Join Date: Jun 2010
Posts: 75
Received Thanks: 2
Quote:
Originally Posted by Sᴡoosh View Post
For me :
X = X coordinate, 2D
Y = Y coordinate, 2D
Z = Height
To me too
Almost had forgotten about the time I used OpenGl and used the Y and Z switched.

But even switching Y and Z the small test char won't move :S
Subzero12 is offline  
Reply


Similar Threads Similar Threads
Xml Database Structure
02/28/2012 - CO2 PServer Guides & Releases - 11 Replies
Alright, this is still unfinished, At the moment it only supports MYSQL, but I will finish rest later, if I get time. It's untested so far and so, but looks like it would work. Anyways, when I get home I will test it and fix whatever I find of bugs etc. It also still contains the xml converter as it's under solution. The XmlLib is a DLL, which you just add as reference to your project, however there is some major things you need to do, before you actually use it. First of all you...
SQL-DB structure
05/29/2010 - Silkroad Online - 0 Replies
Hey folks, does anyone happen to have the structure of the official SRO SQL-DB? I need no more than the column names and their associated table names (usually located in the DB "INFORMATION_SCHEMA").
[C] Player Structure [PW-MS]
03/16/2010 - PW Hacks, Bots, Cheats, Exploits - 5 Replies
Hi everyone. Just wanna share the stuff i found out when reversing the game. Assuming you are using dll injectiong and you have the base pointer to all player stats, you can simply access all the data from a nice and userfriendly structure. Here how to read from memory: VARBASE *Stats = 0xBASEPOINTER; printf("Player HP: %d/%d", Stats->p_Player->Current_HP, Stats->p_Player->Maximum_HP); And here the structure you need to make this available: typedef unsinged char BYTE;
packet structure
03/09/2008 - Conquer Online 2 - 16 Replies
For what I'd like to do, I think packets are the place to start. After that, probably java then C and VB. This is a question for the people here who are self-taught... what resources would you recommend for... 1. understanding packet structure 2. learning some programming language without enrolling at the local university I'm mainly interested in packet structure and how to capture/decipher/edit/send them, and eventually I'd like to "automate" these functions by writing some programs. ...
Drop-Loot bug (Loot sichtbar vor dem kill)
03/28/2006 - WoW Exploits, Hacks, Tools & Macros - 1 Replies
So hi und zwar für alle die gerne mal etwas farmen aber kaum zeit haben ein kleiner Tipp der immo noch auch allen EU realms (ja auch auf Blizz-Servern) ghet. und zwar gibt es in den Blasted Lands den Altar of the Storms dort laufen mobs der LVL ca. 54 rum. Das geniale kommt est noch man sihet an den mobs bevor man sie killt, angreift was auch immer ob und welche Waffe sie droppe. Das system ist ganz einfach: es laufen dort z.B. Walocks rum diese habven immer so nen schwarzen staff in...



All times are GMT +1. The time now is 23:50.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.