Painkiller PAK: Difference between revisions
Jump to navigation
Jump to search
imported>Fastman92 |
imported>Fastman92 |
(No difference)
| |
Revision as of 07:36, 8 April 2012
Choose archive extension:
PAK
- Format Type : Archive
- Endian Order : Little Endian
Format Specifications
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:
void DecryptFilename(char *EntryName, char NameLength, char FileIndex)
{
int i;
char v5;
i = 0;
if ( NameLength > 0 )
{
do
{
v5 = (NameLength % 5 + 2) * (i + (BYTE)NameLength);
EntryName[i++] ^= FileIndex + v5;
}
while ( i < NameLength );
}
}
MultiEx BMS
- A plugin processes these archives
Notes and Comments
None