Struct infinite_rs::module::header::ModuleHeader
source · pub struct ModuleHeader {Show 14 fields
pub magic: String,
pub version: i32,
pub module_id: i64,
pub file_count: u32,
pub manifest0_count: u32,
pub manifest1_count: u32,
pub manifest2_count: u32,
pub resource_index: i32,
pub strings_size: u32,
pub resource_count: u32,
pub block_count: u32,
pub build_version: u64,
pub hd1_delta: u64,
pub data_size: u64,
}Expand description
Module Header structure containing info on the layout of the module file. Version 52+.
Fields§
§magic: StringShould be “mohd”.
version: i32Flight 1: 48 / Flight 2: 51 & Retail / Season 3+: 52
module_id: i64Unique identifier. (not a hash?)
file_count: u32Amount of files in module.
manifest0_count: u32Unknown: not in all modules.
manifest1_count: u32Unknown: present in most modules.
manifest2_count: u32Unknown: not present in any modules.
resource_index: i32Index of the first resource entry (file_count - resource_count)
strings_size: u32Total size in bytes of the string table.
resource_count: u32Number of resource files.
block_count: u32Number of data blocks.
build_version: u64Same between modules, changes per build?
hd1_delta: u64If non-zero, requires hd1 file.
data_size: u64Total size of packed data in module. Both compressed and uncompressed Starts after files, blocks, resources have been read.
Implementations§
source§impl ModuleHeader
impl ModuleHeader
sourcepub fn read(&mut self, reader: &mut BufReader<File>) -> Result<()>
pub fn read(&mut self, reader: &mut BufReader<File>) -> Result<()>
Reads the module header from the given buffered reader.
§Arguments
reader- A mutable reference to aBufReader<File>from which to read the data.
§Returns
Returns Ok(()) if the header is successfully read, or an Err if an I/O error occurs
or if the header data is invalid.
§Errors
This function will return an error if:
- The magic string is not “mohd”
- The version is less than or equal to 0x34
- Any I/O error occurs while reading