The Forum is up for sale: XeNTaX Forum looking for new owner

Silent Hill:Homecoming pak files?

The Original Forum. Game archives, full of resources. How to open them? Get help here.
gamemaster
n00b
Posts: 18
Joined: Mon Jul 21, 2008 1:07 am

Silent Hill:Homecoming pak files?

Post by gamemaster »

The contents of this post was deleted because of possible forum rules violation.
MrDeviance
ultra-n00b
Posts: 5
Joined: Thu Nov 27, 2008 5:05 am

Re: Silent Hill:Homecoming pak files?

Post by MrDeviance »

The contents of this post was deleted because of possible forum rules violation.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Rheini »

Code: Select all

char magic[4]; // PAK_
uint version; // ?, =1
uint numFiles;
uint uk;

struct Entry
{
    char name[64];
    uint uk1; // 1 or 33
    time_t timestamp;
    uint offset;
    uint size1;
    uint flags<format=hex>; // ?
    uint size2; // guess the 2 sizes are compressed size and uncompressed size, but I haven't seen any compressed file yet
} directory[numFiles];
Strangely this doesn't work for all entries. For example entry 1910 has offset 0, size1 0xFFFF, size2 0
MrDeviance
ultra-n00b
Posts: 5
Joined: Thu Nov 27, 2008 5:05 am

Re: Silent Hill:Homecoming pak files?

Post by MrDeviance »

So, by that you are saying you can't figure it out?
Should I be waiting on a fix here anymore or should I aknoledge that the format is impossible to crack by this community?
The reason I am asking this, is because I don't like to come to a forum and wait for new posts if nobody will ever post back.
If possible, I would like a final conclusion on this file.
A yes, no or please wait some more will do.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Rheini »

You can at least extract the entries with valid offsets and sizes.
Somebody just needs to write a BMS. I don't have time for that.
MrDeviance
ultra-n00b
Posts: 5
Joined: Thu Nov 27, 2008 5:05 am

Re: Silent Hill:Homecoming pak files?

Post by MrDeviance »

Oh well, I didn't expect much from here anyway so thanks for caring to check those files.
When it will support this game I will buy the app till then good luck.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Rheini »

To finish this:
(code is not tested)

Code: Select all

GetDString magic 4 0;
If magic <> "PAK_";
CleanExit;
EndIf;
Get Dummy Long 0;
Get numFiles Long 0;
Get Dummy Long 0;

For i = 1 to numFiles;
GetDString filename 64 0;
Get Dummy Long 0;
Get timestamp Long 0;
Get offset Long 0;
Get size Long 0;
Get Dummy Long 0;
Get Dummy Long 0;
If offset <> 0;
Log filename offset size;
EndIf;
Next i;
User avatar
Gocha
veteran
Posts: 109
Joined: Fri Dec 12, 2008 8:16 pm
Location: Batumi, Georgia, GE
Has thanked: 57 times
Been thanked: 9 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Gocha »

Rheini
What does it means your CODEs?

Here are peaople who do not know any programming lang.
Last edited by Gocha on Wed Nov 18, 2009 4:57 pm, edited 1 time in total.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Rheini »

This is a MultiEx Commander script to support this file type.
Think you can also use it with GameExtractor.
User avatar
Gocha
veteran
Posts: 109
Joined: Fri Dec 12, 2008 8:16 pm
Location: Batumi, Georgia, GE
Has thanked: 57 times
Been thanked: 9 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Gocha »

Rheini
either it doesn't works or I'm doin' somthin' wrong!

How to use it by GExtractor i've no clue!

Please tell me what to do
My great respect and appreciation for them, who research game files! Special thanks to: aluigi, bacter, DerPlaya, Rick, Turfster, twig, Zench. Sorry if someone is missing in my list, I'll update when I'll notice it again
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Rheini »

In the scripts folder there is a scripts.zip.
You may add files in there:

Code: Select all

<bms author="Trass3r" games="'Silent Hill'" platforms="'PC', 'PC'" ext="PAK">
GetDString magic 4 0;
If magic <> "PAK_";
CleanExit;
EndIf;
Get Dummy Long 0;
Get numFiles Long 0;
Get Dummy Long 0;

For i = 1 to numFiles;
GetDString filename 64 0;
Get Dummy Long 0;
Get timestamp Long 0;
Get offset Long 0;
Get size Long 0;
Get Dummy Long 0;
Get Dummy Long 0;
If offset <> 0;
Log filename offset size;
EndIf;
Next i;
</bms>
User avatar
Gocha
veteran
Posts: 109
Joined: Fri Dec 12, 2008 8:16 pm
Location: Batumi, Georgia, GE
Has thanked: 57 times
Been thanked: 9 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by Gocha »

:[ it coudn't open the archive!
It says: "The selected script wasn't able to open the archive."
Last edited by Gocha on Wed Nov 18, 2009 5:00 pm, edited 1 time in total.
My great respect and appreciation for them, who research game files! Special thanks to: aluigi, bacter, DerPlaya, Rick, Turfster, twig, Zench. Sorry if someone is missing in my list, I'll update when I'll notice it again
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Silent Hill:Homecoming pak files?

Post by MrAdults »

I hope resurrecting a 3-month-old thread isn't too taboo here, but there is a good reason for it. :) I was looking into this format myself, and have hammered out all of the specifics. Then I went on to figure out all of the custom container formats and the models. A complete viewer and extractor for all of the resources can be obtained here:

http://www.richwhitehouse.com/index.php?postid=32

Specs on the actual PAK files are as follows:

Code: Select all

typedef struct shPakHdr_s
{
	char			id[4]; //PAK_
	uint			unknownA;
	uint			numFiles;
	uint			unknownB;
} shPakHdr_t;

//skip ahead sizeof(header), and for each entry up to numFiles:

typedef struct shPakEntry_s
{
	char			name[64];
	uint			indexFlag;
	uint			timestamp;
	int			ofs;
	int			size;
	short			fileIndex;
	ushort		unknownB;
	uint			unknownC;
} shPakEntry_t;
If fileIndex is -1, the ofs is the location of bytes of the file from the beginning of the main PAK file. Otherwise, fileIndex directly corresponds to the numbered file extension (e.g. fileIndex 9 is for pakname_09.pak), while the offset is relative to the beginning of that file. There is one exception, though. When fileIndex >= 0, and unknownB is 3, the offset is still for the main PAK file. Not sure what the significance is, but with these rules, every file in the game can be extracted reliably. Also be aware that multiple entries can have the same "name", while having different offsets to different data (for example, a model and a material file with the same base file name).

Additionally, SHADERS.PAK and SHADERSL.PAK have special half-sized pak entries, with no header bytes to indicate such, for some reason. Their entry structure is as follows.

Code: Select all

typedef struct shMiniPakEntry_s
{
	char		name[64];
	int			ofs;
	int			size;
	int			unknownA;
} shMiniPakEntry_t;
Some files in the PAKs are LZO-compressed. They begin with a 12 byte header, "LZO ", followed by 2 big-endian 32-bit integers. The first int is the size once decompressed, and the second int is the size of the compressed data. Run the data that follows the 12 bytes through a standard LZO decompression algorithm up to the value of the second int, and you will have your original file data. This compression is often used on DDS textures in the PAK files.

Some main data types include Ogg files, "SYT" files (which are DDS files with a custom header), and "EIFF" files (a media container header used on models and particle systems - the container includes resource dependencies for materials or other files that the model/particle system references). I will eventually document my findings on these media formats as well if anyone is interested, but in the mean time, feel free to contact me if you're working on deciphering the formats yourself and want some pointers.
User avatar
shekofte
mega-veteran
mega-veteran
Posts: 221
Joined: Sun Jan 18, 2009 1:45 pm
Location: Sagittarius
Has thanked: 299 times
Been thanked: 20 times
Contact:

Re: Silent Hill:Homecoming pak files?

Post by shekofte »

I hope you become success ,masters ! that is really a beautiful game !
ILLUSORY VIDEO GAMES ARE MORE IMPORTANT THAN PRECIOUS INTERNATIONAL FOOTBALLs
onionhead
beginner
Posts: 37
Joined: Tue Oct 27, 2009 3:02 am
Has thanked: 8 times
Been thanked: 1 time

Re: Silent Hill:Homecoming pak files?

Post by onionhead »

can anyone find the siam model from the pak files? cuz all i c is alex and his weapons?
Post Reply