ProcessImage

Struct ProcessImage 

Source
pub struct ProcessImage { /* private fields */ }
Expand description

The ProcessImage contains all necessary ELF files for emulation

It

  • parses its binaries into a tree structure instead of a linear memory image
  • symbolizes all pointers in the ELF files
  • lifts all RISC-V instructions into an IR

Implementations§

Source§

impl ProcessImage

Accessor methods that handle the children of this process image element

Source

pub fn cursor(&self) -> usize

Get the cursor of this process image element

Source

pub fn set_cursor(&mut self, cursor: usize)

Set the cursor of this process image element

Source

pub fn move_cursor_beyond_end(&mut self)

Move the cursor of this process image element to the end of its children list. This enables appending children.

Source

pub fn move_cursor_forward(&mut self) -> bool

Increment the cursor of this process image element or return false if the cursor is already at the last child

Source

pub fn move_cursor_backwards(&mut self) -> bool

Decrement the cursor of this process image element or return false if it’s already at the first child

Source

pub fn elf(&self, id: Id) -> Option<&Elf>

Retrieve the child with the given ID of this process image element

Source

pub fn num_elfs(&self) -> usize

Get the number of children for this process image element

Source

pub fn cursor_elf(&self) -> Option<&Elf>

Get the child at the current cursor position for this process image element

Source

pub fn cursor_elf_mut(&mut self) -> Option<&mut Elf>

Get the child at the current cursor position for this process image element

Source

pub fn insert_elf(&mut self, child: Elf) -> Id

Insert the given child into the list of children at the current cursor position for this process image element

Source

pub fn delete_elf(&mut self) -> Elf

Delete the child at the current cursor position of this process image element and return it

Source

pub fn iter_elfs(&self) -> Iter<'_, Elf>

Iterate over all children of this process image element independent of the current cursor position

Source

pub fn iter_elfs_mut(&mut self) -> IterMut<'_, Elf>

Iterate over all children of this process image element independent of the current cursor position

Source

pub fn elf_mut(&mut self, id: Id) -> Option<&mut Elf>

Retrieve the child with the given ID of this process image element

Source§

impl ProcessImage

Source

pub fn entrypoint(&self) -> &FunctionPointer

The entrypoint of the ProcessImage determines where to start execution

Source

pub fn set_entrypoint(&mut self, entrypoint: FunctionPointer)

Change the entrypoint of this ProcessImage

Source

pub fn constructors(&self) -> &[FunctionPointer]

The constructors that are to be run before the entrypoint in the order given by this slice

Source

pub fn constructors_mut(&mut self) -> &mut Vec<FunctionPointer>

Change the constructors of this ProcessImage

Source

pub fn elf_by_filename<S: AsRef<str>>(&self, filename: S) -> Option<&Elf>

Get an ELF file by its filename

Source

pub fn elf_by_filename_mut<S: AsRef<str>>( &mut self, filename: S, ) -> Option<&mut Elf>

Get an ELF file by its filename

Trait Implementations§

Source§

impl Debug for ProcessImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ProcessImage

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations§

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, 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.