### Define RSZ Struct Source: https://github.com/wwylele/mhrice/wiki/RSZ Example of defining a new data structure using the rsz_struct macro to map TDB types to Rust. ```rust rsz_struct! { // wrap everything in this macro // define the type like a normal rust struct // but with an important attribute "rsz". The name in rsz(...) // must match exactly the full name you found in TDB #[rsz("snow.enemy.EnemyConditionDamageData.StockData")] #[derive(Debug, Serialize)] // optional, but you need these if you want to get json pub struct StockData { // struct name can be anything, but preferably match the name in TDB // now for every non-static field you see in TDB, add a field here. // also add a field for the base class if it has one. // ... but there maybe exceptions. This is where you need to use your reverse engineering brain // the field name can be anything, but preferably match the name in TDB // the type must be translated in the following rules // - primitive types (integer, bool, float, String...) are translated to rust primitive types // - list-like types (array, IList, ...) are translated to `Vec<_>` // - enum types are translated to rust's fieldless enum. The enum type itself must be wrapped in rsz_enum! macro // - for user-defined C# value types, either expand all children fields, or define the struct using // rsz_struct! {#[rsz()] ...} (empty rsz() string). // - for user-defined C# reference types, the corresponding struct type should be either already defined in other files, // or you will define them in this file. Simply use that type. pub default_limit: f32, pub add_limit: f32, pub max_limit: f32, pub sub_value: f32, pub sub_interval: f32, } } ``` -------------------------------- ### Extract TDB from Switch ExeFS Source: https://github.com/wwylele/mhrice/wiki/TDB Use the mhrice tool to read the decompressed main file from the Switch ExeFS and generate a C# representation. ```bash mhrice read-tdb -t main --cs tdb.cs ``` -------------------------------- ### Extract TDB from PC Minidump Source: https://github.com/wwylele/mhrice/wiki/TDB Use the mhrice tool to read a full minidump from the PC game process and generate a C# representation. ```bash mhrice read-dmp-tdb -d dump.dmp --cs tdb.cs ``` -------------------------------- ### Define RSZ Module Header Source: https://github.com/wwylele/mhrice/wiki/RSZ Standard imports required at the top of a new RSZ module file. ```rust use super::*; use crate::rsz_bitflags; use crate::rsz_enum; use crate::rsz_struct; use bitflags::*; use serde::*; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.