READ THE RULES: Click here

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

Gothic 3 .pak extractor

Old posts about game archives and other formats.
Post Reply
Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

Gothic 3 .pak extractor

Post by Slaii » Mon Oct 16, 2006 1:47 pm

Hi
Especially Mr. Mouse :wink:

I would like to extract files from my Gothic 3 game, but I cannot open .pak file
Can anybody help me?
some .pak can be ound here:

Code: Select all

http://rapidshare.de/files/36954338/Strings.pak.html
It is strings.pak:: 2.5MB

I looked at it in hex and it looks similiar to some archives I saw before, but I duno.
See attachment
You do not have the required permissions to view the files attached to this post.

john_doe

Post by john_doe » Mon Oct 16, 2006 3:10 pm

Already done :)
http://gamefileformats.the-underdogs.in ... orer10.zip
The user interface is in German but it should work without knowing the language.

@MrMouse:
These are the specs, copied from another forum:

Code: Select all

////////////////////////////////////////////////////////////////////////////////
//
//  Gothic3 PAK file format specs.
//  (all values are little-endian)
//  Copyright (c) 2006 Nico Bendlin <nicode@gmx.net>
//
//  +----------------+
//  |  file header   |
//  +----------------+
//  |   file data    |
//  +----------------+
//  |    unknown     |
//  | (not present)  |
//  +----------------+
//  |   file table   |
//  +----------------+
//  |    unknown     |
//  | (empty string) |
//  +----------------+
//
////////////////////////////////////////////////////////////////////////////////

//
// Fix-sized file header
//
struct G3PakFileHeader {
    UInt32  Unknown0;   // Always 0x00000000. Might be part of the signature.
    UInt32  Signature;  // Always 0x30563347 ('G3V0').
    UInt64  Unknown1;   // Always 0x0000000000000000. Interpretation unknown.
    UInt64  Unknown2;   // Always 0x100067F800000001. Might be a UInt16[4] version (1.0.26616.16).
    UInt64  Unknown3;   // Always the same value as FileTable. Might be a file offset to an (currently) unused data block.
    UInt64  FileTable;  // File offset to the root entry of the file table.
    UInt64  Unknown4;   // File offset to an (currently) unused data block after the file table. Might be a comment string.
};

//
// String data (e.g. file names)
//
struct G3PakFileString {
    UInt32  Length;
    UInt8   Data[Length + 1];  // ANSI text. Only present if Length > 0. [Length] must be '\0'.
};

//
// File table entries (directories and files)
//
struct G3PakFileTableEntry {
    //
    // Fix-sized header for all entries
    //
    struct {
        UInt64  FileTime1;   // Windows FILETIME. Might be the CreationTime.
        UInt64  FileTime2;   // Windows FILETIME. Might be the LastAccessTime.
        UInt64  FileTime3;   // Windows FILETIME. Might be the LastWriteTime.
        UInt64  Unknown0;    // Always 0x0000000000000000. Interpretation unknown.
        UInt32  Attributes;  // Windows FILE_ATTRIBUTE_Xxx (other bits should be ignored).
    };
    //
    // Dynamically sized structures for directories and files
    //
    union {
        //
        // Directory entry (FILE_ATTRIBUTE_DIRECTORY in Attributes)
        //
        struct {
            G3PakFileString     FileName;     // String includes the relativ path to the root (path separator is '/') and ends with '/'.
            UInt32              DirCount;     // Count of directory entries that follow (directly after this count).
            G3PakFileTableEntry [DirCount];
            UInt32              FileCount;    // Count of file entries that follow (directly after this count).
            G3PakFileTableEntry [FileCount];
        };
        //
        // File entry (Attributes can include FILE_ATTRIBUTE_COMPRESSED)
        //
        struct {
            UInt64          Offset;    // File offset to raw data.
            UInt64          Bytes;     // Size of raw data in Bytes.
            UInt64          Size;      // Size of file data (uncompressed).
            UInt32          Unknown1;  // Always 0x00000000. Interpretation unknown.
            UInt32          Unknown2;  // 0x00000000 if uncompressed, 0x00000002 if compressed with ZLib (default compression level).
            G3PakFileString FileName;  // String includes the relativ path to the root (path separator is '/').
            G3PakFileString Comment;   // Includes the full native file name and path of the source file.
        };
    };
};

User avatar
lionheartuk
double-veteran
double-veteran
Posts: 686
Joined: Tue May 16, 2006 10:55 pm
Location: Tokyo, Japan
Has thanked: 26 times
Been thanked: 23 times

Post by lionheartuk » Mon Oct 16, 2006 4:11 pm

john_doe wrote:Already done :)
http://gamefileformats.the-underdogs.in ... orer10.zip
The user interface is in German but it should work without knowing the language.

@MrMouse:
These are the specs, copied from another forum:
nice man.
nice
what forum was it btw?
care to provide a link?
"Lemons are people nice hardworking & honest people too..."

Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

extractor

Post by Slaii » Mon Oct 16, 2006 4:35 pm

Thanks, it works....

john_doe

Post by john_doe » Mon Oct 16, 2006 5:16 pm

lionheartuk wrote:what forum was it btw?
care to provide a link?
Here: http://www.worldofgothic.de/foren/?go=index
It's in German, though.

I made the tool and NicoDE gave me his specs since I was missing some stuff (actually just the date/time fields :))

Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

Gothic 3 packer

Post by Slaii » Fri Oct 20, 2006 9:20 pm

And any tool for packing back the files?

I want to make a mod and I need to pack files back (or I should leave them in directory?)

john_doe

Post by john_doe » Sat Oct 21, 2006 8:19 am

Yes, NicoDE made two command line tools, one for extracting and one for creating new archives.
You can get his tool from here: http://forum.worldofplayers.de/forum/sh ... ost2487521
You need to be registered, though.

User avatar
Savage
VIP member
VIP member
Posts: 560
Joined: Sun Apr 17, 2005 11:00 am
Has thanked: 16 times
Been thanked: 17 times

Post by Savage » Sat Oct 21, 2006 10:33 am

The .pak it's a normal zlib no?

User avatar
john_doe
VIP member
VIP member
Posts: 80
Joined: Sat Oct 21, 2006 2:25 pm
Been thanked: 1 time

Post by john_doe » Sat Oct 21, 2006 2:35 pm

Yes, it uses the normal zlib library.

Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

packer

Post by Slaii » Sat Oct 21, 2006 6:57 pm

Great, thanks............

Post Reply