////////////////////////////////////////////////////////////////////////////////
//
// 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.
};
};
};
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.