2022-09-04 23:21:59 -04:00
|
|
|
//
|
|
|
|
// EuropaTools
|
|
|
|
//
|
|
|
|
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
|
|
|
//
|
2022-09-21 03:49:57 -04:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2022-09-04 23:21:59 -04:00
|
|
|
//
|
2022-09-04 17:11:14 -04:00
|
|
|
|
|
|
|
#pragma endian little
|
2022-09-07 05:07:40 -04:00
|
|
|
// Big archives need a big pattern limit
|
2022-09-21 03:49:57 -04:00
|
|
|
#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;
|
|
|
|
|
|
|
|
// 0x4 - Starfighter
|
|
|
|
// 0x5 - other game
|
|
|
|
u16 Version;
|
|
|
|
u8 pad;
|
|
|
|
|
|
|
|
u32 tocOffset;
|
|
|
|
|
|
|
|
// Dunno what this is
|
|
|
|
u32 unk;
|
|
|
|
|
|
|
|
u32 fileCount;
|
|
|
|
|
|
|
|
// Labeled as this in the quickbms script
|
|
|
|
u32 archiveCreationTime;
|
|
|
|
|
|
|
|
u32 reserved;//?
|
|
|
|
};
|
|
|
|
|
|
|
|
// "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;
|
2022-09-07 05:07:40 -04:00
|
|
|
PakTocEntry toc[header.fileCount] @ header.tocOffset;
|
2022-09-04 17:11:14 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace europa
|
|
|
|
|
|
|
|
europa::PakFile pak @ 0x0;
|