2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 08:42:35 +00:00

chore: enable reading of big endian ipaks

This commit is contained in:
Jan Laupetin
2026-05-11 23:54:25 +02:00
parent 7ae7cf85ff
commit e1bb8ae4d2
7 changed files with 183 additions and 129 deletions
+10 -4
View File
@@ -6,7 +6,8 @@
namespace ipak_consts
{
static constexpr uint32_t IPAK_MAGIC = utils::MakeMagic32('K', 'A', 'P', 'I');
static constexpr uint32_t IPAK_MAGIC_LITTLE_ENDIAN = utils::MakeMagic32('K', 'A', 'P', 'I');
static constexpr uint32_t IPAK_MAGIC_BIG_ENDIAN = utils::MakeMagic32('I', 'P', 'A', 'K');
static constexpr uint32_t IPAK_VERSION = 0x50000;
static constexpr uint32_t IPAK_INDEX_SECTION = 1;
@@ -60,10 +61,15 @@ struct IPakIndexEntry
uint32_t size;
};
struct IPakDataBlockCountAndOffset
union IPakDataBlockCountAndOffset
{
uint32_t offset : 24;
uint32_t count : 8;
struct
{
uint32_t offset : 24;
uint32_t count : 8;
};
uint32_t raw;
};
static_assert(sizeof(IPakDataBlockCountAndOffset) == 4);