READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Problem with PAK-files: Hard To Be A God / Specnaz 2

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
User avatar
asmxtx
veteran
Posts: 127
Joined: Sun Jun 08, 2008 10:32 pm
Location: Developers Country
Has thanked: 1 time
Been thanked: 30 times

Problem with PAK-files: Hard To Be A God / Specnaz 2

Post by asmxtx » Thu Feb 05, 2009 12:27 am

I want to unpack PAK-files from these two games:

"Hard To Be A God" and
"Specnaz 2".

Both games use a similar file format with XOR-encryption.
The general structure of a PAK-file is:

<HEADER>
(XORed)<NUMBER_OF_FILES><FILE_TABLE_WITH_OFFSETS_AND_LENGTHS>
<DATA_AREA>

The filetable is XORed with a key (values see attachment).
Any first 100h bytes of a data entry are XORed with the same key.
After de-XORing the filetable one will recognize a well-known filename/offset/length-structure.

But that's not the problem.
The problem is the de-XORing of the first 100h bytes of a data entry, because the XOR-key starts with a relative offset, which is different for each data entry.

There must be a rule or formula for calculating this XOR-key-offset.

Has somebody got any clue or hint? Thank you in advance.
You do not have the required permissions to view the files attached to this post.

User avatar
evin
ultra-veteran
ultra-veteran
Posts: 330
Joined: Sat Aug 05, 2006 2:04 pm
Location: Hungary
Has thanked: 1 time
Been thanked: 136 times
Contact:

Re: Problem with PAK-files: Hard To Be A God / Specnaz 2

Post by evin » Thu Feb 05, 2009 11:25 am


Post Reply