change epk1 to structs and more

This commit is contained in:
theubusu
2025-10-10 22:04:51 +02:00
parent 9bb61f893e
commit 6940f13b25
6 changed files with 91 additions and 101 deletions
+2 -6
View File
@@ -12,8 +12,7 @@ use binrw::{BinRead, BinReaderExt};
use crate::common;
use crate::keys;
#[derive(Debug, BinRead)]
#[br(little)]
#[derive(BinRead)]
struct Header {
#[br(count = 8)] _magic_bytes: Vec<u8>,
header_size: u32,
@@ -24,15 +23,13 @@ struct Header {
_padding2: u32,
#[br(count = 512)] description_bytes: Vec<u8>,
}
impl Header {
fn description(&self) -> String {
common::string_from_bytes(&self.description_bytes)
}
}
#[derive(Debug, BinRead)]
#[br(little)]
#[derive(BinRead)]
struct FileHeader {
#[br(count = 60)] file_name_bytes: Vec<u8>,
real_size: u32,
@@ -40,7 +37,6 @@ struct FileHeader {
_header_size: u32,
_attributes: u32,
}
impl FileHeader {
fn file_name(&self) -> String {
common::string_from_bytes(&self.file_name_bytes)