From d0c40c50cd34ba18f6a52d7182e27eddfc605f60 Mon Sep 17 00:00:00 2001 From: a2x <45197573+a2x@users.noreply.github.com> Date: Sun, 21 Apr 2024 00:31:51 +1000 Subject: [PATCH] Reorganize schema system structures into separate files --- src/analysis/buttons.rs | 3 +- src/analysis/interfaces.rs | 4 +- src/analysis/mod.rs | 1 - src/analysis/offsets.rs | 2 +- src/analysis/schemas.rs | 32 ++- src/mem.rs | 1 - src/output/mod.rs | 7 +- src/source2/schema_system/mod.rs | 263 ++---------------- .../schema_base_class_info_data.rs | 11 + .../schema_system/schema_class_field_data.rs | 13 + .../schema_system/schema_class_info_data.rs | 30 ++ .../schema_system/schema_enum_info_data.rs | 24 ++ .../schema_enumerator_info_data.rs | 23 ++ .../schema_metadata_entry_data.rs | 35 +++ .../schema_system/schema_static_field_data.rs | 14 + src/source2/schema_system/schema_system.rs | 15 + .../schema_system/schema_system_type_scope.rs | 18 ++ src/source2/schema_system/schema_type.rs | 97 +++++++ src/source2/tier1/utl_memory.rs | 3 - src/source2/tier1/utl_memory_pool.rs | 3 +- src/source2/tier1/utl_ts_hash.rs | 4 - src/source2/tier1/utl_vector.rs | 2 - 22 files changed, 325 insertions(+), 280 deletions(-) create mode 100644 src/source2/schema_system/schema_base_class_info_data.rs create mode 100644 src/source2/schema_system/schema_class_field_data.rs create mode 100644 src/source2/schema_system/schema_class_info_data.rs create mode 100644 src/source2/schema_system/schema_enum_info_data.rs create mode 100644 src/source2/schema_system/schema_enumerator_info_data.rs create mode 100644 src/source2/schema_system/schema_metadata_entry_data.rs create mode 100644 src/source2/schema_system/schema_static_field_data.rs create mode 100644 src/source2/schema_system/schema_system.rs create mode 100644 src/source2/schema_system/schema_system_type_scope.rs create mode 100644 src/source2/schema_system/schema_type.rs diff --git a/src/analysis/buttons.rs b/src/analysis/buttons.rs index 5fc577b7..6016b8da 100644 --- a/src/analysis/buttons.rs +++ b/src/analysis/buttons.rs @@ -51,7 +51,7 @@ fn read_buttons( ((cur_button.address() - module.base) + offset_of!(KeyButton.state) as i64) as u32; debug!( - "found button: {} at {:#X} ({} + {:#X})", + "found button: {} @ {:#X} ({} + {:#X})", name, value as u64 + module.base.to_umem(), module.name, @@ -63,7 +63,6 @@ fn read_buttons( cur_button = button.next; } - // Sort buttons by name. buttons.sort_unstable_by(|a, b| a.name.cmp(&b.name)); Ok(buttons) diff --git a/src/analysis/interfaces.rs b/src/analysis/interfaces.rs index bbe5ccfb..c5590e5f 100644 --- a/src/analysis/interfaces.rs +++ b/src/analysis/interfaces.rs @@ -58,10 +58,11 @@ fn read_interfaces( while !cur_reg.is_null() { let reg = cur_reg.read(process)?; let name = reg.name.read_string(process)?.to_string(); + let value = (reg.create_fn.address() - module.base) as u32; debug!( - "found interface: {} at {:#X} ({} + {:#X})", + "found interface: {} @ {:#X} ({} + {:#X})", name, value as u64 + module.base.to_umem(), module.name, @@ -73,7 +74,6 @@ fn read_interfaces( cur_reg = reg.next; } - // Sort interfaces by name. ifaces.sort_unstable_by(|a, b| a.name.cmp(&b.name)); Ok(ifaces) diff --git a/src/analysis/mod.rs b/src/analysis/mod.rs index 619bef93..d126b2c8 100644 --- a/src/analysis/mod.rs +++ b/src/analysis/mod.rs @@ -12,7 +12,6 @@ mod interfaces; mod offsets; mod schemas; -#[derive(Debug)] pub struct AnalysisResult { pub buttons: Vec