• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Creating Commands

Status
Not open for further replies.
Skilled Illusionist
Joined
Mar 5, 2015
Messages
308
Reaction score
119
I need to ask if someone can help me because I'm developing a dll for a gameserver, I have offsets of function but for example I'm trying to add /post Command,

This command requires objectStruct? , because i need this variables (I HAVE PDB AND MAP)

PHP:
#define gObjOffset 0x660F078
#define gObjSize 0x1968
#define gObjPlayer 0x1968
#define gObjMaxUsr 0x1CE7
#define gObj_isonline 0x04
#define gObjMapID 0x10D
#define gObjPosX 0x108
#define gObjPosY 0x10A
#define gObjClass 0x9E
#define gObjLupp 0xA4
#define gObjStr 0xB8
#define gObjDex 0xBA
#define gObjVit 0xBC
#define gObjEne 0xBE
#define gObjLead 0xDC
#define gObjLogin 0x68
#define gObjNick 0x73
#define gObjDir 0x10C
#define gObjExp 0xAC
#define gObjZen 0XB4
#define gObjLvl 0XA0
#define gObjCtl 0x1C4

BUT THIS OBJECT STRUCT IS FORM ANOTHER GAMESERVER.

What i need to do i order to have the correct objectstruct? or I'm confused?

Then after adding object struct? it loads Chat.cpp automatically?

Or I need to hook something for Post command and how to do thanks!

Please I'm stuck at this point
 
Kingdom of Shadows
Loyal Member
Joined
Jul 13, 2007
Messages
923
Reaction score
320
I moved your thread into help section.

gObjOffset represents the base offset of object struct (the location where it was allocated). gObjSize represents the size of that structure (used to navigate trough memory). Rest of them represents relative offsets to the gObjOffset for certain variables. If you want to access position 0 in object struct you need to calculate it's location in memory and you do it like this:
Code:
OBJECTSTRUCT * lpObj = gObjOffset + (gObjSize * position)
To get the right offsets for your gs you need to extract the information from your pdb. There are pdb explorers, if you're lucky you may find the complete OBJECTSTRUCT in that pdb.

As for .cpp file I suggest you to read about c/c++ language, how it is compiled, linked and other basic stuffs before you do anything else I doubt you will successfully do anything.
 
Upvote 0
Skilled Illusionist
Joined
Mar 5, 2015
Messages
308
Reaction score
119
I moved your thread into help section.

gObjOffset represents the base offset of object struct (the location where it was allocated). gObjSize represents the size of that structure (used to navigate trough memory). Rest of them represents relative offsets to the gObjOffset for certain variables. If you want to access position 0 in object struct you need to calculate it's location in memory and you do it like this:
Code:
OBJECTSTRUCT * lpObj = gObjOffset + (gObjSize * position)
To get the right offsets for your gs you need to extract the information from your pdb. There are pdb explorers, if you're lucky you may find the complete OBJECTSTRUCT in that pdb.

As for .cpp file I suggest you to read about c/c++ language, how it is compiled, linked and other basic stuffs before you do anything else I doubt you will successfully do anything.


Hi [RCZ]ShadowKing thanks! Finally the only problem i have is with the gObjOffset, Size, and Max and Min values, I have the OBJECTSTRUCT , but the only problem is trying to calculae the position. (The pdb explorer needs to throw me offsets o adresses?)

So the formula needs to be like this?:

OBJECTSTRUCT * lpObj = gObjOffset + (gObjSize * 0)??

Ihave ObjSize! Now gObjOffset ? How to please?
 
Last edited:
Upvote 0
Kingdom of Shadows
Loyal Member
Joined
Jul 13, 2007
Messages
923
Reaction score
320
Open your gameserver.exe with ollydbg (keep .pdb file in the same folder as gs) and it will automatically load all information then you will be able to see function names, global variables and things like this. Press CTRL + N and search for gObj, you'll see the offset in the first column (left side).
 
Upvote 0
Skilled Illusionist
Joined
Mar 5, 2015
Messages
308
Reaction score
119
Thanks for answer Ihave searched with ollydbg and throws this information? It is the first offset?

perez4all - Creating Commands - RaGEZONE Forums


I only need this to complete ! Thanks . Please :3

perez4all - Creating Commands - RaGEZONE Forums


Also in that names List appear a ObjInit (Don't know if it can be)
 
Last edited:
Upvote 0
Kingdom of Shadows
Loyal Member
Joined
Jul 13, 2007
Messages
923
Reaction score
320
0x00A22F00 should be your objectstruct pointer. All you need to do is cast it to the objectstruct your got from pdb explorer then you will be able to access all members.
 
Upvote 0
Skilled Illusionist
Joined
Mar 5, 2015
Messages
308
Reaction score
119
0x00A22F00 should be your objectstruct pointer. All you need to do is cast it to the objectstruct your got from pdb explorer then you will be able to access all members.

Thanks! Can you make me a little explanation Please. Imean for future proyects. Also and about gObjPlayer, And gObjMaxUser?(Equivalent ? In object struct or i need to calculate?)
 
Last edited:
Upvote 0
Kingdom of Shadows
Loyal Member
Joined
Jul 13, 2007
Messages
923
Reaction score
320
I don't know what is gObjPlayer. gObjMaxUser is a constant, you can check it with ollydbg in a function because it's not stored in pdb. Also you can look at GS sources so you understand better how the GS works.
 
Upvote 0
Skilled Illusionist
Joined
Mar 5, 2015
Messages
308
Reaction score
119
Help! Now after sending command it crahes? What can be the problem? Only canged those values

perez4all - Creating Commands - RaGEZONE Forums

What define of object pointer i need to use?

I correct the object size
 
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top