Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Changing the header of PT assets ... mesh data

Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
[Size=+2]Guide to Changing PT Asset Headers[/Size]
Okay, I always figured this was one of the most simplistic modifications implemented by Sandurr in all of his servers. However, complements to him, it did confuse a lot of people trying to steal custom items from his server to use on their own.

I realise that making this guide will probably reduce the effectiveness of this method, but since it is so easy to implement, I don't see why more private servers shouldn't do the same, and I've discussed the method used in general threads before already... so making a proper guide of it only make it more accessible.

To start off, take a look at the SMD / SMB files in your client. You can see that each one begins "SMD Model data Ver 0.62"

Fine. This is what we call a distinguishing header. It's the sort of thing you look at to check a MIME type.

Open your client, either in OllyDbg or a hex editor and search for this text.
dPVw2 - Changing the header of PT assets ... mesh data - RaGEZONE Forums
You can place anything you like in there. I'm not going to quote Sandurrs' favourite because that's not the point. I will tell you that he doesn't even use text. (You may want to avoid 0 bytes, but I haven't tried)

Once you have made this change, your client will no longer accept models which have the normal header. Therefore, when you change the header of all your assets, to match the one in your client executable, they won't be accepted by any other client either.

You may like to perform a similar change to the file extensions. SMD & SMB. Just so you, and everyone else knows these files won't work right away in another client.

Now that I've explained all of that, you may want to think about other ways to make that even more unique. ^_^

Enjoy.

--- EDIT ---
Even after I pointed people at this guide, they still didn't seem to understand how simple this concept is, so I gave the following further explanation
bobsobol said:
You know if you open up a Windows Bitmap, and the first 2 bytes are always the ascii characters "BM" and the third is usually ascii "0"? Or if you open an executable and the first two bytes are always "MZ"? If you changed those first two bytes you could still read all the data right? But most programs would refuse to touch it, because it just doesn't look like it's the right kind of file.

This is common practice, since most OS don't specify "file extensions" like .exe or .bmp so programs should make sure that the file a user has asked them to load is actually the kind of data this program is designed to handle. Even in DOS / Windows, it's too easy to change the extension from .exe to .bmp and try to open a program in MSPaint.exe. If it didn't check something very simple at the start of the file, the potential for disastrous crashes while reading completely unrelated data in a specific format which it may not fit is usually considered too great.

That "unique identifier" is usually only between 2 and 4 bytes long, and is typically stored (officially) as a 16 or 32 bit integer which, for convenience, is often visibly recognisable in ascii text. Other common ones are "RIFF" used in AIFF, WAV, AVI and QT (all matching International File Format standards for interleaved data chunks) "JFIF" for jpeg images, "TIFF" for Tiff images, and "PNG" in Portable Network Graphics files.

The one in PT for it's binarized ASE files is really long. 23 bytes long. It's just "SMD Model data Ver 0.62". If you tell the PT client to only read "SMD Model data Ver 0.63" it won't touch any of your meshes any more. If you run a search and replace on all your SMDs and SMBs to "update" them all to ""SMD Model data Ver 0.63" as well, then your PT client will only read your meshes, and won't load any from another PT client.

You can actually use any sequence of 23 non-zero bytes to make sure that only SMDs and SMBs with that exact sequence of starting bytes is ever read by your client.

That's what rPT did.

You can make your client read only rPT client SMDs and SMBs by changing the string in your client, or you can make rPT models work in a regular client by replacing the first 23 bytes with ""SMD Model data Ver 0.62"".
 

Attachments

You must be registered for see attachments list
Last edited:
Elite Diviner
Joined
Aug 10, 2006
Messages
429
Reaction score
119
I thought you meant something else when you were talking about this before, still, a good guide :thumbup1:, does this mean that one would have to go through and change all of the smd file headers by themself?

i guess the sensible resolution would be to write a program to do it for you? :glare:

ps. is it possible to change the attribute headers also? such as blend_shadow and such like? i assume it would be fine as long as you change the smd data files to the same formatting yea?
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
i guess the sensible resolution would be to write a program to do it for you? :glare:
If you don't want to convert all the meshes back to ASE and have the client create fresh SMD / SMB for you, you could either write a program, or use a generic stream manipulation tool, yea.

Between NT4+ CMD processing FOR, Copy /b and John Newbigins' conversion of Gnu (for Windows) all can be done (I guess) in a single line of code from the NT command line. :eek:tt1:

could probably make the required change "on mass" too. :wink:

As for changing the attributes for the model parts (ScreemingFox has proven that different parts of a model can have different "effect" attributes applied very well, I think) I would definitely do that in the ASE before it's "binarized". (yea, that's a kind of mixed-up term, but I'm not the first to coin it)
 
Back
Top