Trait BytePointer
Source pub trait BytePointer {
// Required methods
fn addr(&self, offset: usize) -> *mut u8;
fn ptr(&self) -> *mut u8;
fn len(&self) -> usize;
// Provided method
fn dump(&self, file: &str) -> Result<()> { ... }
}
Expand description
Trait for accessing memory as a byte pointer.
Provides low-level access to memory regions with byte-level addressing.
Returns a mutable pointer to the byte at the given offset.
§Safety
The returned pointer is valid only while the memory region exists.
Dereferencing requires unsafe code and proper synchronization.
Returns a mutable pointer to the start of the memory region.
Returns the total length of the memory region in bytes.
Dumps memory contents to a file in hexadecimal format.
Writes each row (8KB) as a line of hexadecimal bytes.
§Errors
Returns an error if file creation or writing fails.