Difference between revisions of "CRY"
Jump to navigation
Jump to search
(CPlugFileText) |
m (add wp link, grammar) |
||
Line 1: | Line 1: | ||
− | .cry files are | + | '''.cry files''' are weakly encrypted text files used in VirtualSkipper and early versions of TrackMania. For example, the VskBoatImporter of VirtualSkipper creates an Info.cry from the Info.txt with the basic information about the boat (name, website, author) and adds it to the boat zip file. |
− | As a cipher, | + | As a cipher, XOR encryption is used with a rotating key. After encryption, the ciphertext is compressed by {{wp|Lempel–Ziv–Oberhumer|LZO}}. |
== File structure == | == File structure == |
Revision as of 21:47, 12 June 2017
.cry files are weakly encrypted text files used in VirtualSkipper and early versions of TrackMania. For example, the VskBoatImporter of VirtualSkipper creates an Info.cry from the Info.txt with the basic information about the boat (name, website, author) and adds it to the boat zip file. As a cipher, XOR encryption is used with a rotating key. After encryption, the ciphertext is compressed by LZO.
File structure
uint32 uncompressedSize uint32 compressedSize compressedData[compressedSize]
Restore the plaintext
After the data block is decompressed, the text string can be decrypted by applying the bitwise XOR operator to each character with the given key. The default key is rotated bitwise to the left, depending on the length of the text. The new key is then extended to the text length by repeating it:
uint64 key = 0xCF08317C90460052; uint32 shift = uncompressedSize & 0x3F; uint64 rotkey = (key << shift) | (key >> (64 - shift)); for (int i = 0; i < uncompressedSize; i++) uncompressedData[i] ^= *( (byte*)&rotkey + (i & 0x7) );