mono-rt 0.2.0

Dynamic bindings to the Mono runtime for process injection into Unity games and Mono-hosted applications on Windows
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{MonoImage, mono_handle};
use crate::{Result, api};

mono_handle!(MonoAssembly);

impl MonoAssembly {
    /// Returns the metadata image for this assembly.
    ///
    /// # Errors
    ///
    /// Returns [`crate::MonoError::Uninitialized`] if the Mono API has not been initialized.
    pub fn image(self) -> Result<Option<MonoImage>> {
        let ptr = api()?.assembly_get_image(self.as_ptr());
        Ok(MonoImage::from_ptr(ptr))
    }
}