Painkiller PAK: Difference between revisions
Jump to navigation
Jump to search
imported>Fastman92 |
imported>Fastman92 |
||
| Line 11: | Line 11: | ||
=== Format Specifications === | === Format Specifications === | ||
< | <tt><b> | ||
byte {1} - Determines if archive files are Zlib compressed. 0 - uncompressed, not zero - compressed<br/> | |||
uint32 {4} - position of file list described below | |||
</b></tt> | |||
Not written yet | Not written yet | ||
Revision as of 15:44, 19 April 2012
Choose archive extension:
PAK
- Format Type : Archive
- Endian Order : Little Endian
Format Specifications
byte {1} - Determines if archive files are Zlib compressed. 0 - uncompressed, not zero - compressed
uint32 {4} - position of file list described below
Not written yet
Encryption
Filenames are encrypted
EncryptedStringCharacter (n) = OriginalStringCharacter(n) XOR (shift left (string size) + 1 + FileNumber + Code(string size) + n*2) (Where n starts at character position 0)
The Code(string size) you can get from the following algorithm:
Formula: (Size % 5)+2 String Size 0 -> Code = -2 String Size 1 -> Code = -1 String Size 2 -> Code = 0 String Size 3 -> Code = 1 String Size 4 -> Code = 2 String Size 5 -> Code = -2 String Size 6 -> Code = -1 String Size 7 -> Code = 0 . . . And so forth
C++ function to decrypt file names:
/*
Two-way algorithm. Encoding a string two times will leave it decoded.
*/
void EncodeFilename(char *EntryName, BYTE NameLength, char FileIndex)
{
BYTE n = 0;
while ( n < NameLength )
EntryName[n++] ^= FileIndex + NameLength % 5 + 2 * (n + NameLength);
}
MultiEx BMS
- A plugin processes these archives
Notes and Comments
None