Difference between revisions of "CRY"

From Mania Tech Wiki
Jump to navigation Jump to search
m (add wp link, grammar)
m (space in name)
 
Line 1: Line 1:
'''.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.
+
'''.cry files''' are weakly encrypted text files used in Virtual Skipper and early versions of TrackMania. For example, the VskBoatImporter of Virtual Skipper 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 {{wp|Lempel–Ziv–Oberhumer|LZO}}.
 
As a cipher, XOR encryption is used with a rotating key. After encryption, the ciphertext is compressed by {{wp|Lempel–Ziv–Oberhumer|LZO}}.
  

Latest revision as of 09:57, 19 June 2017

.cry files are weakly encrypted text files used in Virtual Skipper and early versions of TrackMania. For example, the VskBoatImporter of Virtual Skipper 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) );