use memflow::prelude::v1::*; use crate::error::{Error, Result}; #[repr(C)] pub struct UtlVector { pub size: i32, // 0x0000 pub mem: Pointer64<[T]>, // 0x0008 } impl UtlVector { /// Returns the number of elements in the vector. #[inline] pub fn count(&self) -> i32 { self.size } /// Returns the element at the specified index. pub fn element(&self, process: &mut IntoProcessInstanceArcBox<'_>, idx: usize) -> Result { if idx >= self.count() as usize { return Err(Error::Other("index out of bounds")); } self.mem.at(idx as _).read(process).map_err(Into::into) } } unsafe impl Pod for UtlVector {}