EuropaTools/hexpat/pak.hexpat

68 lines
1.1 KiB
Text
Raw Normal View History

//
// EuropaTools
//
// (C) 2021-2025 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: MIT
//
2022-09-04 17:11:14 -04:00
#pragma endian little
// Big archives need a big pattern limit
#pragma pattern_limit 0x40000
#pragma array_limit 0x40000
2022-09-04 17:11:14 -04:00
namespace europa {
struct PakHeader {
char magic[16]; // "Europa Packfile\0"
// Doesn't include magic
u16 headerSize;
// 0x3 - PMDL
2022-09-04 17:11:14 -04:00
// 0x4 - Starfighter
// 0x5 - Jedi Starfighter
2022-09-04 17:11:14 -04:00
u16 Version;
u8 pad;
u32 tocOffset;
u32 tocSize;
2022-09-04 17:11:14 -04:00
u32 fileCount;
// Unix epoch timestamp (libc time()) of when the archive was created
2022-09-04 17:11:14 -04:00
u32 archiveCreationTime;
// Set to 0 in basically every file
u32 reserved;
2022-09-04 17:11:14 -04:00
};
// "Pascal" string used
// in the TOC.
struct PakTocPString {
u8 len;
if(len != 0)
char string[len];
};
// A Toc entry
struct PakTocEntry {
PakTocPString fileName;
u32 offset;
u32 size;
// Seems to be the same as he header.
u32 creationTime;
};
struct PakFile {
PakHeader header;
PakTocEntry toc[header.fileCount] @ header.tocOffset;
2022-09-04 17:11:14 -04:00
};
} // namespace europa
europa::PakFile pak @ 0x0;