Painkiller PAK: Difference between revisions
Jump to navigation
Jump to search
imported>Fastman92 |
imported>Fastman92 |
||
| Line 27: | Line 27: | ||
<pre> | <pre> | ||
Formula: (Size % 5) | Formula: (Size % 5)+2 | ||
String Size 0 -> Code = -2 | String Size 0 -> Code = -2 | ||
| Line 41: | Line 41: | ||
. | . | ||
And so forth | And so forth | ||
</pre> | |||
C++ function to decrypt file names: | |||
<pre> | |||
void DecryptFilename(char *EntryName, char NameLength, char FileIndex) | |||
{ | |||
int i; // ecx@1 | |||
char v5; // al@3 | |||
i = 0; | |||
if ( NameLength > 0 ) | |||
{ | |||
do | |||
{ | |||
v5 = (NameLength % 5 + 2) * (i + (BYTE)NameLength); | |||
EntryName[i++] ^= FileIndex + v5; | |||
} | |||
while ( i < NameLength ); | |||
} | |||
} | |||
</pre> | </pre> | ||
Revision as of 07:35, 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; // ecx@1
char v5; // al@3
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