View Single Post
Chrissy
Member
Join Date: May 2013
Old 12-12-2019 , 18:19   Re: Offsets and signatures
Reply With Quote #3

Quote:
Originally Posted by Fyren View Post
A simplified explanation of netprops is they're properties of C++ objects on the server that, when changed, get transmitted to clients so that the values stay in sync.

A simplified explanation of datamaps is they're properties of C++ objects on the server that get written/read when saves and loads happen.

Perhaps more relevant to people writing SM scripts is these properties end up being easily enumerated and accessed. For example, you only need to know the name of the class and property to get the value or modify it.



As the docs for FindSendPropInfo say, it returns the offset of the property. If you know where the object is in memory, then adding the offset to it gets you the address of that particular property. A SM scripter should rarely actually need to use FindSendPropInfo, though. If the offset is being passed through to like GetEntData*, it's likely just GetEntProp* is the better choice.

To get a non-simplified/superficial/shortcut understanding of offets and signatures (what they are, how to find them, what SM is actually doing with them), the path is probably first learning C++, then some basic assembly, then some basic reverse engineering.
Amazing explanation, thank you! I just have a few questions, if that's cool.

The in the case I supplied, CCSPlayerResource is a class and m_bAlive is a property within the class. And to get m_bAlive, you apply a specific offset to the memory address of the object that points to the memory address of the required property?

And in regards to gamedata files, is there a page I can read to learn more about how to utilise them? I read the wiki page but I didn't really understand where you're meant to find offsets/signatures/functions to put into a file.

Many thanks
Chrissy is offline