pub struct ModuleHeader {Show 14 fields
magic: u32,
version: i32,
module_id: i64,
pub(super) file_count: u32,
manifest0_count: u32,
manifest1_count: u32,
manifest2_count: u32,
resource_index: i32,
strings_size: u32,
pub(super) resource_count: u32,
pub(super) block_count: u32,
build_version: u64,
pub(super) hd1_delta: u64,
pub(super) data_size: u64,
}
Expand description
Module Header structure containing info on the layout of the module file. Version 53+.
Fields§
§magic: u32
Should be “mohd” (0x64686F6D)
version: i32
Flight 1: 48 / Flight 2: 51 & Retail / Season 3+: 52 CU30+: 53
module_id: i64
Unique identifier. (not a hash?)
file_count: u32
Number of files in the module.
manifest0_count: u32
Unknown: not in all modules.
manifest1_count: u32
Unknown: present in most modules.
manifest2_count: u32
Unknown: not present in any modules.
resource_index: i32
Index of the first resource entry (file_count
- resource_count
).
strings_size: u32
Total size in bytes of the string table.
resource_count: u32
Number of resource files.
block_count: u32
Number of data blocks.
build_version: u64
Same between modules, changes per build?
hd1_delta: u64
If non-zero, requires hd1 file.
data_size: u64
Total size of packed data in the module. Both compressed and uncompressed. Starts after files, blocks, and resources have been read.
Implementations§
Source§impl ModuleHeader
impl ModuleHeader
Sourcepub(super) fn read(&mut self, reader: &mut BufReader<File>) -> Result<()>
pub(super) 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 Error
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