Remove leftover binrw debugging
This commit is contained in:
parent
e5b9e9150e
commit
a4615b29ce
6 changed files with 27 additions and 28 deletions
|
@ -9,7 +9,6 @@ fn custom_parser(size_in_bytes: u32, value_type: &str) -> BinResult<Vec<ArrayEnt
|
||||||
let end = current + size_in_bytes as u64 - 4;
|
let end = current + size_in_bytes as u64 - 4;
|
||||||
|
|
||||||
while current < end {
|
while current < end {
|
||||||
println!("current: {}, end: {}", current, end);
|
|
||||||
result.push(ArrayEntry::read_options(reader, endian, (value_type,)).unwrap());
|
result.push(ArrayEntry::read_options(reader, endian, (value_type,)).unwrap());
|
||||||
current = reader.stream_position().unwrap();
|
current = reader.stream_position().unwrap();
|
||||||
}
|
}
|
||||||
|
@ -22,7 +21,7 @@ fn custom_parser(size_in_bytes: u32, value_type: &str) -> BinResult<Vec<ArrayEnt
|
||||||
#[br(import(value_type: &str))]
|
#[br(import(value_type: &str))]
|
||||||
pub struct ArrayEntry {
|
pub struct ArrayEntry {
|
||||||
#[br(args { magic: &value_type })]
|
#[br(args { magic: &value_type })]
|
||||||
#[br(dbg)]
|
|
||||||
pub key: MabSubProperty,
|
pub key: MabSubProperty,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ pub struct ArrayEntry {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ArrayProperty {
|
pub struct ArrayProperty {
|
||||||
// Plus this int
|
// Plus this int
|
||||||
#[br(dbg)]
|
|
||||||
pub size_in_bytes: u32,
|
pub size_in_bytes: u32,
|
||||||
|
|
||||||
#[br(temp)]
|
#[br(temp)]
|
||||||
|
@ -40,7 +39,7 @@ pub struct ArrayProperty {
|
||||||
#[br(count = key_name_length)]
|
#[br(count = key_name_length)]
|
||||||
#[bw(map = |x : &String | x.as_bytes())]
|
#[bw(map = |x : &String | x.as_bytes())]
|
||||||
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
||||||
#[br(dbg)]
|
|
||||||
pub key_name: String,
|
pub key_name: String,
|
||||||
|
|
||||||
#[br(pad_before = 1)]
|
#[br(pad_before = 1)]
|
||||||
|
|
|
@ -77,7 +77,7 @@ pub enum StringBasedProperty {
|
||||||
pub struct Entry {
|
pub struct Entry {
|
||||||
#[br(temp)]
|
#[br(temp)]
|
||||||
#[bw(ignore)]
|
#[bw(ignore)]
|
||||||
#[br(dbg)]
|
|
||||||
pub name_length: u32,
|
pub name_length: u32,
|
||||||
#[br(count = name_length)]
|
#[br(count = name_length)]
|
||||||
#[bw(map = |x : &String | x.as_bytes())]
|
#[bw(map = |x : &String | x.as_bytes())]
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub struct StructMaybeKey {
|
||||||
#[br(pad_after = 8)] // nothingness and then length for the struct
|
#[br(pad_after = 8)] // nothingness and then length for the struct
|
||||||
pub unk_type: String,
|
pub unk_type: String,
|
||||||
|
|
||||||
#[br(dbg)]
|
|
||||||
#[br(pad_before = 4)] // type length
|
#[br(pad_before = 4)] // type length
|
||||||
pub r#struct: Struct,
|
pub r#struct: Struct,
|
||||||
}
|
}
|
||||||
|
@ -180,11 +180,11 @@ pub enum MapKeyProperty {
|
||||||
#[br(import(key_type: &KeyType, value_type: &str))]
|
#[br(import(key_type: &KeyType, value_type: &str))]
|
||||||
pub struct MapEntry {
|
pub struct MapEntry {
|
||||||
#[br(args { magic: key_type})]
|
#[br(args { magic: key_type})]
|
||||||
#[br(dbg)]
|
|
||||||
pub key: MapKeyProperty,
|
pub key: MapKeyProperty,
|
||||||
|
|
||||||
#[br(args { magic: value_type })]
|
#[br(args { magic: value_type })]
|
||||||
#[br(dbg)]
|
|
||||||
pub value: MabSubProperty,
|
pub value: MabSubProperty,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ fn custom_parser(size_in_bytes: u32, key_type: &KeyType, value_type: &str) -> Bi
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MapProperty {
|
pub struct MapProperty {
|
||||||
// Plus this int
|
// Plus this int
|
||||||
#[br(dbg)]
|
|
||||||
pub size_in_bytes: u32,
|
pub size_in_bytes: u32,
|
||||||
|
|
||||||
#[br(temp)]
|
#[br(temp)]
|
||||||
|
@ -241,7 +241,7 @@ pub struct MapProperty {
|
||||||
pub value_name: String,
|
pub value_name: String,
|
||||||
|
|
||||||
#[br(pad_before = 5)]
|
#[br(pad_before = 5)]
|
||||||
#[br(dbg)]
|
|
||||||
pub key_type: KeyType,
|
pub key_type: KeyType,
|
||||||
|
|
||||||
#[br(parse_with = custom_parser, args(size_in_bytes, &key_type, &value_name))]
|
#[br(parse_with = custom_parser, args(size_in_bytes, &key_type, &value_name))]
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub struct SetEntry {
|
||||||
pub unk_type: String,
|
pub unk_type: String,
|
||||||
|
|
||||||
#[br(args { magic: &unk_type })]
|
#[br(args { magic: &unk_type })]
|
||||||
#[br(dbg)]
|
|
||||||
pub key: StringBasedProperty,
|
pub key: StringBasedProperty,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,11 @@ pub enum Struct {
|
||||||
#[br(magic = b"PrimaryAssetType\0")]
|
#[br(magic = b"PrimaryAssetType\0")]
|
||||||
PrimaryAssetType {
|
PrimaryAssetType {
|
||||||
#[br(pad_before = 17)]
|
#[br(pad_before = 17)]
|
||||||
#[br(dbg)]
|
|
||||||
name: PrimaryAssetNameProperty,
|
name: PrimaryAssetNameProperty,
|
||||||
#[br(pad_before = 9)] // "None" and it's length in bytes plus the null terminator
|
#[br(pad_before = 9)] // "None" and it's length in bytes plus the null terminator
|
||||||
#[br(pad_after = 9)] // ditto
|
#[br(pad_after = 9)] // ditto
|
||||||
#[br(dbg)]
|
|
||||||
primary_asset_name: PrimaryAssetNameProperty,
|
primary_asset_name: PrimaryAssetNameProperty,
|
||||||
},
|
},
|
||||||
#[br(magic = b"PrimaryAssetId\0")]
|
#[br(magic = b"PrimaryAssetId\0")]
|
||||||
|
@ -42,16 +42,16 @@ pub enum Struct {
|
||||||
LinearColor(LinearColorStruct),
|
LinearColor(LinearColorStruct),
|
||||||
#[br(magic = b"CarryCount\0")]
|
#[br(magic = b"CarryCount\0")]
|
||||||
CarryCount {
|
CarryCount {
|
||||||
#[br(dbg)]
|
|
||||||
carry_count: CarryCountProperty,
|
carry_count: CarryCountProperty,
|
||||||
#[br(dbg)]
|
|
||||||
#[br(pad_before = 15)] // "StoreCount" + 4 bytes for length + 1 byte for endofstring
|
#[br(pad_before = 15)] // "StoreCount" + 4 bytes for length + 1 byte for endofstring
|
||||||
#[br(pad_after = 9)] // "None" + 1 byte for endofstring + 4 bytes for length
|
#[br(pad_after = 9)] // "None" + 1 byte for endofstring + 4 bytes for length
|
||||||
store_count: CarryCountProperty,
|
store_count: CarryCountProperty,
|
||||||
},
|
},
|
||||||
#[br(magic = b"Map\0")]
|
#[br(magic = b"Map\0")]
|
||||||
Map {
|
Map {
|
||||||
#[br(dbg)]
|
|
||||||
#[br(pad_after = 9)] // "None" + 1 byte for endofstring + 4 bytes for length
|
#[br(pad_after = 9)] // "None" + 1 byte for endofstring + 4 bytes for length
|
||||||
map: CarryCountProperty,
|
map: CarryCountProperty,
|
||||||
},
|
},
|
||||||
|
@ -59,20 +59,20 @@ pub enum Struct {
|
||||||
#[br(magic = b"ID\0")]
|
#[br(magic = b"ID\0")]
|
||||||
ID {
|
ID {
|
||||||
unk: [u8; 149], // not sure how to parse this yet
|
unk: [u8; 149], // not sure how to parse this yet
|
||||||
#[br(dbg)]
|
|
||||||
#[br(pad_after = 9)] // "None" and it's length in bytes plus the null terminator
|
#[br(pad_after = 9)] // "None" and it's length in bytes plus the null terminator
|
||||||
name: PrimaryAssetNameProperty,
|
name: PrimaryAssetNameProperty,
|
||||||
|
|
||||||
#[br(dbg)]
|
|
||||||
#[br(pad_after = 9)] // "None" and it's length in bytes plus the null terminator
|
#[br(pad_after = 9)] // "None" and it's length in bytes plus the null terminator
|
||||||
primary_asset_name: PrimaryAssetNameProperty,
|
primary_asset_name: PrimaryAssetNameProperty,
|
||||||
|
|
||||||
#[br(dbg)]
|
|
||||||
data: [u8; 137],
|
data: [u8; 137],
|
||||||
},
|
},
|
||||||
#[br(magic = b"Set\0")]
|
#[br(magic = b"Set\0")]
|
||||||
Set {
|
Set {
|
||||||
#[br(dbg)]
|
|
||||||
#[br(pad_after = 9)] // "None" + 1 byte for endofstring + 4 bytes for length
|
#[br(pad_after = 9)] // "None" + 1 byte for endofstring + 4 bytes for length
|
||||||
set: CarryCountProperty,
|
set: CarryCountProperty,
|
||||||
},
|
},
|
||||||
|
|
|
@ -38,29 +38,29 @@ pub struct ParamsStruct {
|
||||||
pub struct PrimaryAssetNameProperty {
|
pub struct PrimaryAssetNameProperty {
|
||||||
#[br(temp)]
|
#[br(temp)]
|
||||||
#[bw(ignore)]
|
#[bw(ignore)]
|
||||||
#[br(dbg)]
|
|
||||||
pub property_name_length: u32,
|
pub property_name_length: u32,
|
||||||
#[br(count = property_name_length)]
|
#[br(count = property_name_length)]
|
||||||
#[bw(map = |x : &String | x.as_bytes())]
|
#[bw(map = |x : &String | x.as_bytes())]
|
||||||
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
||||||
#[br(dbg)]
|
|
||||||
pub property_name: String,
|
pub property_name: String,
|
||||||
|
|
||||||
#[br(temp)]
|
#[br(temp)]
|
||||||
#[bw(ignore)]
|
#[bw(ignore)]
|
||||||
#[br(if(property_name != "None"))]
|
#[br(if(property_name != "None"))]
|
||||||
#[br(dbg)]
|
|
||||||
pub type_length: u32,
|
pub type_length: u32,
|
||||||
#[br(count = type_length)]
|
#[br(count = type_length)]
|
||||||
#[bw(map = |x : &String | x.as_bytes())]
|
#[bw(map = |x : &String | x.as_bytes())]
|
||||||
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
||||||
#[br(if(property_name != "None"))]
|
#[br(if(property_name != "None"))]
|
||||||
#[br(dbg)]
|
|
||||||
pub type_name: String,
|
pub type_name: String,
|
||||||
|
|
||||||
#[br(if(property_name != "None"))]
|
#[br(if(property_name != "None"))]
|
||||||
#[br(args { magic: &type_name})]
|
#[br(args { magic: &type_name})]
|
||||||
//#[br(dbg)]
|
//
|
||||||
pub key: Option<Box<StringBasedProperty>>,
|
pub key: Option<Box<StringBasedProperty>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,16 +70,16 @@ pub struct PrimaryAssetNameProperty {
|
||||||
pub struct CarryCountProperty {
|
pub struct CarryCountProperty {
|
||||||
#[br(temp)]
|
#[br(temp)]
|
||||||
#[bw(ignore)]
|
#[bw(ignore)]
|
||||||
#[br(dbg)]
|
|
||||||
pub property_name_length: u32,
|
pub property_name_length: u32,
|
||||||
#[br(count = property_name_length)]
|
#[br(count = property_name_length)]
|
||||||
#[bw(map = |x : &String | x.as_bytes())]
|
#[bw(map = |x : &String | x.as_bytes())]
|
||||||
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
|
||||||
#[br(dbg)]
|
|
||||||
pub property_name: String,
|
pub property_name: String,
|
||||||
|
|
||||||
#[br(args { magic: &property_name})]
|
#[br(args { magic: &property_name})]
|
||||||
//#[br(dbg)]
|
//
|
||||||
pub key: Option<Box<StringBasedProperty>>,
|
pub key: Option<Box<StringBasedProperty>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue