SSA v1.0 - EE-modders/Empire-Earth-toolbox GitHub Wiki
by zocker_160 (updated 08.09.2022)
#pragma endian little
#include <std/io.pat>
#include <std/string.pat>
#include <std/core.pat>
struct Header {
char magic[4]; // always "rass"
u32 version_major; // always 1
u32 version_minor; // always 0
u32 data_start_offset; // also equals the size of all FileEntries
} [[static]]; // length of Header is always 16 bytes
struct FileEntry {
u32 path_length;
char path[path_length];
u32 start_offset;
u32 end_offset;
u32 size;
};
struct Attribute {
u32 key_length;
char key[key_length];
u32 value_length;
char value[value_length];
};
struct Intermediate {
u32 num_attributes;
Attribute attributes[num_attributes];
};
using entries;
struct DCL {
char magic[4]; // always "PK01"
u32 uncompressed_size;
u32 unknown; // always 0x00
char data[entries[std::core::array_index()].size-3*4];
};
struct FileData {
if (std::mem::read_string($, 4) == "PK01") {
DCL compressed_data;
} else {
char raw_data[entries[std::core::array_index()].size];
}
};
Header header @ 0x00;
FileEntry entries[while($ < (header.data_start_offset + sizeof(header)))] @ $;
Intermediate intermediate @ $;
FileData files[std::core::member_count(entries)] @ $;