Struct Image

Source
pub struct Image { /* private fields */ }

Implementations§

Source§

impl Image

Source

pub fn load(boot_services: &BootServices, file_data: &[u8]) -> Result<Image>

Loads and relocates a PE file.

The image must be handed to [start] later. If this does not happen, the memory allocated for the unpacked PE binary will leak.

Source

pub unsafe fn start( self, handle: Handle, system_table: &SystemTable<Boot>, load_options: &CStr16, ) -> Status

Starts a trusted loaded PE file. The caller is responsible for verifying that it trusts the PE file to uphold the invariants detailed below. If the entry point returns, the image memory is subsequently deallocated.

§Safety

The image is assumed to be trusted. This means:

  • The PE file it was loaded from must have been a completely valid EFI application of the correct architecture.
  • If the entry point returns, it must leave the system in a state that allows our stub to continue. In particular:
    • Only memory it either has allocated, or that belongs to the image, should have been altered.
    • Memory it has not allocated should not have been freed.
    • Boot services must not have been exited.

Auto Trait Implementations§

§

impl Freeze for Image

§

impl RefUnwindSafe for Image

§

impl Send for Image

§

impl Sync for Image

§

impl Unpin for Image

§

impl !UnwindSafe for Image

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.