Painkiller PAK

From XentaxWiki
Revision as of 14:13, 9 April 2012 by imported>Fastman92 (→‎Encryption)
Jump to navigation Jump to search

Back to index

Choose archive extension:

PAK


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:

/*
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


Supported by Programs