The XMB data from BinRead can be mapped into types compatible with C. This can also be easily converted to classes in C#.
#[repr(C)]
struct Entry {
name: CString,
parent_index: i32,
properties: FfiVec<Property>
}
#[repr(C)]
struct Property {
name: CString,
value: CString
}
#[repr(C)]
struct Xmb {
entries: FfiVec<Entry>
}
#[repr(C)]
pub struct FfiVec<T: Sized> {
ptr: *mut T,
size: usize,
}
The XMB data from BinRead can be mapped into types compatible with C. This can also be easily converted to classes in C#.