pub struct Image { /* private fields */ }
Implementations§
Source§impl Image
impl Image
Sourcepub fn load(boot_services: &BootServices, file_data: &[u8]) -> Result<Image>
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.
Sourcepub unsafe fn start(
self,
handle: Handle,
system_table: &SystemTable<Boot>,
load_options: &CStr16,
) -> Status
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more