Reader

Struct Reader 

Source
pub struct Reader<'parser> { /* private fields */ }
Expand description

A reader lets you translate & read virtual memory from a dump file.

Implementations§

Source§

impl<'parser> Reader<'parser>

Source

pub fn new(parser: &'parser KernelDumpParser) -> Self

Source

pub fn with_dtb(parser: &'parser KernelDumpParser, dtb: Gpa) -> Self

Source

pub fn translate(&self, gva: Gva) -> Result<Translation>

Translate a Gva into a Gpa.

Source

pub fn read_exact(&self, gva: Gva, buf: &mut [u8]) -> Result<()>

Read the exact amount of bytes asked by the user & return a Error::PartialRead error if it couldn’t read as much as wanted.

Source

pub fn read(&self, gva: Gva, buf: &mut [u8]) -> Result<usize>

Read the virtual memory starting at gva into buf. If it cannot read as much as asked by the user because the dump file is missing a physical memory page or because one of the PXE is non present, the function doesn’t error out and return the amount of bytes that was successfully read.

Source

pub fn read_struct<T: Pod>(&self, gva: Gva) -> Result<T>

Read a T from virtual memory.

Source

pub fn try_translate(&self, gva: Gva) -> Result<Option<Translation>>

Try to translate gva into Gpa.

Source

pub fn try_read_exact(&self, gva: Gva, buf: &mut [u8]) -> Result<Option<()>>

Try to read the exact amount of bytes asked by the user.

Source

pub fn try_read_struct<T: Pod>(&self, gva: Gva) -> Result<Option<T>>

Try to read a T from virtual memory.

Auto Trait Implementations§

§

impl<'parser> Freeze for Reader<'parser>

§

impl<'parser> !RefUnwindSafe for Reader<'parser>

§

impl<'parser> !Send for Reader<'parser>

§

impl<'parser> !Sync for Reader<'parser>

§

impl<'parser> Unpin for Reader<'parser>

§

impl<'parser> !UnwindSafe for Reader<'parser>

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.