Files
unixtract/src/formats/slp/include.rs
T
theubusu aa2249f024 RESTRUCTURING 1
- change formats to have their own folders with mod + include files + anything they want
- change format list to be defined in formats.rs instead of in each format
- move utils to their respective formats
- some minor code changes in some formats
2026-02-17 17:28:59 +01:00

43 lines
892 B
Rust

use crate::utils::common;
use binrw::BinRead;
#[derive(BinRead)]
pub struct Header {
_magic_bytes: [u8; 4],
version_bytes: [u8; 8],
model_bytes: [u8; 16],
firmware_bytes: [u8; 16],
_unk: u32,
check: [u8; 8],
_unk2: [u8; 8],
}
impl Header {
pub fn version(&self) -> String {
common::string_from_bytes(&self.version_bytes)
}
pub fn model(&self) -> String {
common::string_from_bytes(&self.model_bytes)
}
pub fn firmware(&self) -> String {
common::string_from_bytes(&self.firmware_bytes)
}
pub fn is_new_type(&self) -> bool {
&self.check == b"\x01VER_PR1"
}
}
#[derive(BinRead)]
pub struct EntryOld {
pub size: u32,
pub _unk: u32,
pub offset: u32,
pub _unk2: u32,
}
#[derive(BinRead)]
pub struct EntryNew {
pub size: u32,
_unk: u32,
pub offset: u32,
_unk2: [u8; 12],
}