From d8d00eb146241978ef21ed4d6c35ac9c68b1a86e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 10 Feb 2025 17:38:55 +0100 Subject: read serialized file tables --- src/serialized_file.rs | 248 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 src/serialized_file.rs (limited to 'src/serialized_file.rs') diff --git a/src/serialized_file.rs b/src/serialized_file.rs new file mode 100644 index 0000000..becf1d7 --- /dev/null +++ b/src/serialized_file.rs @@ -0,0 +1,248 @@ +use crate::{ + common_strings::COMMON_STRINGS, + helper::{AlignExt, Endianness, ReadExt}, +}; +use anyhow::Result; +use log::{debug, trace}; +use std::io::{Cursor, Read, Seek}; + +#[derive(Debug)] +pub struct TypeTreeNode { + pub version: u16, + pub level: u8, + pub type_flags: u8, + pub type_string: String, + pub name_string: String, + pub byte_size: i32, + pub index: i32, + pub flags: i32, + pub ref_type_hash: u64, +} + +#[derive(Debug)] +pub struct SeralizedType { + pub class_id: i32, + pub stripped_type: bool, + pub script_type_index: i16, + pub script_id: u128, + + pub type_tree: Vec, + pub type_deps: Vec, +} + +#[derive(Debug)] +pub struct ObjectInfo { + path_id: i64, + data_offset: u64, + data_size: u32, + type_id: i32, +} + +#[derive(Debug)] +pub struct Script { + file_index: u32, + identifier: i64, +} + +#[derive(Debug)] +pub struct External { + something: String, + guid: u128, + r#type: i32, + path_name: String, +} + +#[derive(Debug)] +pub struct SerializedFile { + pub types: Vec, + pub externals: Vec, + pub scripts: Vec