Skip to main content

BinaryViewBase

Trait BinaryViewBase 

Source
pub trait BinaryViewBase {
Show 19 methods // Required methods fn default_endianness(&self) -> Endianness; fn address_size(&self) -> usize; // Provided methods fn read(&self, _buf: &mut [u8], _offset: u64) -> usize { ... } fn write(&self, _offset: u64, _data: &[u8]) -> usize { ... } fn insert(&self, _offset: u64, _data: &[u8]) -> usize { ... } fn remove(&self, _offset: u64, _len: usize) -> usize { ... } fn offset_valid(&self, offset: u64) -> bool { ... } fn offset_readable(&self, offset: u64) -> bool { ... } fn offset_writable(&self, offset: u64) -> bool { ... } fn offset_executable(&self, offset: u64) -> bool { ... } fn offset_backed_by_file(&self, offset: u64) -> bool { ... } fn next_valid_offset_after(&self, offset: u64) -> u64 { ... } fn modification_status(&self, _offset: u64) -> ModificationStatus { ... } fn start(&self) -> u64 { ... } fn len(&self) -> u64 { ... } fn executable(&self) -> bool { ... } fn relocatable(&self) -> bool { ... } fn entry_point(&self) -> u64 { ... } fn save( &self, view: &BinaryView, file: &mut BorrowedFileAccessor<'_>, ) -> bool { ... }
}

Required Methods§

Provided Methods§

Source

fn read(&self, _buf: &mut [u8], _offset: u64) -> usize

Source

fn write(&self, _offset: u64, _data: &[u8]) -> usize

Source

fn insert(&self, _offset: u64, _data: &[u8]) -> usize

Source

fn remove(&self, _offset: u64, _len: usize) -> usize

Source

fn offset_valid(&self, offset: u64) -> bool

Check if the offset is valid for the current view.

Source

fn offset_readable(&self, offset: u64) -> bool

Check if the offset is readable for the current view.

Source

fn offset_writable(&self, offset: u64) -> bool

Check if the offset is writable for the current view.

Source

fn offset_executable(&self, offset: u64) -> bool

Check if the offset is executable for the current view.

Source

fn offset_backed_by_file(&self, offset: u64) -> bool

Check if the offset is backed by the original file and not added after the fact.

Source

fn next_valid_offset_after(&self, offset: u64) -> u64

Get the next valid offset after the provided offset, useful if you need to iterate over all readable offsets in the view.

Source

fn modification_status(&self, _offset: u64) -> ModificationStatus

Whether the data at the given offset been modified (patched).

Source

fn start(&self) -> u64

The lowest address in the view.

Source

fn len(&self) -> u64

The length of the view.

Source

fn executable(&self) -> bool

Source

fn relocatable(&self) -> bool

Source

fn entry_point(&self) -> u64

Source

fn save(&self, view: &BinaryView, file: &mut BorrowedFileAccessor<'_>) -> bool

Save the view to file.

The default implementation saves the parent view, which typically surfaces as saving the raw contents of the file (via the “Raw” root view).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§