- 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.
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
You must be registered to see links
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: