#[repr(C)]pub struct SectionHeader {
pub section_tag: [u8; 19],
pub section_tag_separator: u8,
pub absolute_data_start: u32,
pub local_fixups_offset: u32,
pub global_fixups_offset: u32,
pub virtual_fixups_offset: u32,
pub exports_offset: u32,
pub imports_offset: u32,
pub end_offset: u32,
}
Expand description
The 48bytes each HKX section header contains metadata information about the HKX file.
For SkyrimSE, the bytes are arranged in the following order.
__classnames__
48bytes__types__
48bytes__data__
48bytes
§Note
This information is placed immediately after the Hkx header. (In some cases, padding is inserted in between.)
Depending on the havok version, there may be padding after the section header group. (at least not in SkyrimSE).
Fields§
§section_tag: [u8; 19]
Section name.
For SkyrimSE, the bytes are arranged in the following order.
__classnames__
__types__
__data__
§Bytes Example
assert_eq!(
[0x5F, 0x5F, 0x63, 0x6C, 0x61, 0x73, 0x73, 0x6E, 0x61, 0x6D, 0x65, 0x73, 0x5F, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00],
*b"__classnames__\0\0\0\0\0"
);
section_tag_separator: u8
Always must be 0xFF
absolute_data_start: u32
Section start & fixup base offset.
§Example of position
hkx_header.section_count:3
& hkx_header.section_offset:0
=> 0x000000D0
bytes.
-
Calculation formula
Hkx header 64bytes + 48bytes * 3 sections = 208bytes ==
0xD0
(__classnames__
section abs)
local_fixups_offset: u32
Offset from absolute offset to local fixup map.
global_fixups_offset: u32
Offset from absolute offset to global fixup map.
virtual_fixups_offset: u32
Offset from absolute offset to virtual class fixup map.
exports_offset: u32
Unknown offset information.
Known information.
- This value is the end position of the virtual_fixups_offset.
- The
exports
,imports
andend
offsets are all the same value.
imports_offset: u32
Unknown offset information.
Known information.
- This value is the end position of the virtual_fixups_offset.
- The
exports
,imports
andend
offsets are all the same value.
end_offset: u32
Unknown offset information.
Known information.
- This value is the end position of the virtual_fixups_offset.
- The
exports
,imports
andend
offsets are all the same value.
Implementations§
Source§impl SectionHeader
impl SectionHeader
Sourcepub const DATA_SECTION_HEADER_TAG: [u8; 19]
pub const DATA_SECTION_HEADER_TAG: [u8; 19]
*b"__data__\0\0\0\0\0\0\0\0\0\0\0"
pub fn from_bytes<'a>( endian: Endianness, ) -> impl Parser<&'a [u8], Self, ContextError>
Sourcepub fn write_bytes<O>(&self, writer: impl WriteBytesExt) -> Result<()>where
O: ByteOrder,
pub fn write_bytes<O>(&self, writer: impl WriteBytesExt) -> Result<()>where
O: ByteOrder,
Sourcepub fn write_classnames<O>(
writer: impl WriteBytesExt,
section_offset: i16,
section_end_abs: u32,
) -> Result<()>where
O: ByteOrder,
pub fn write_classnames<O>(
writer: impl WriteBytesExt,
section_offset: i16,
section_end_abs: u32,
) -> Result<()>where
O: ByteOrder,
Sourcepub fn write_types<O>(writer: impl WriteBytesExt, abs_offset: u32) -> Result<()>where
O: ByteOrder,
pub fn write_types<O>(writer: impl WriteBytesExt, abs_offset: u32) -> Result<()>where
O: ByteOrder,
Trait Implementations§
Source§impl Clone for SectionHeader
impl Clone for SectionHeader
Source§fn clone(&self) -> SectionHeader
fn clone(&self) -> SectionHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SectionHeader
impl Debug for SectionHeader
Source§impl Default for SectionHeader
impl Default for SectionHeader
Source§fn default() -> SectionHeader
fn default() -> SectionHeader
Source§impl Display for SectionHeader
impl Display for SectionHeader
Source§impl Hash for SectionHeader
impl Hash for SectionHeader
Source§impl PartialEq for SectionHeader
impl PartialEq for SectionHeader
impl Eq for SectionHeader
impl StructuralPartialEq for SectionHeader
Auto Trait Implementations§
impl Freeze for SectionHeader
impl RefUnwindSafe for SectionHeader
impl Send for SectionHeader
impl Sync for SectionHeader
impl Unpin for SectionHeader
impl UnwindSafe for SectionHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more