diff --git a/src/lib.rs b/src/lib.rs index b890baa..a6ab644 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! Inka +//! # Inka mod base; mod program; diff --git a/src/program.rs b/src/program.rs index cc12db1..51f7fc0 100644 --- a/src/program.rs +++ b/src/program.rs @@ -17,7 +17,7 @@ pub fn program() -> &'static Program { &PROGRAM } -/// Represents the program's in-memory layout, providing access to its base address, size, +/// Represents the `Program`'s in-memory layout, providing access to its base address, size, /// and sections. #[derive(Debug)] pub struct Program { diff --git a/src/section.rs b/src/section.rs index e99c7b9..0a544a1 100644 --- a/src/section.rs +++ b/src/section.rs @@ -5,6 +5,7 @@ use core::ops::Index; use rayon::iter::IndexedParallelIterator; use rayon::slice::ParallelSlice; +/// Represents a `Section` of the program in memory, providing access to its name, base address, and length. #[derive(Debug)] pub struct Section { name: &'static str, @@ -18,9 +19,10 @@ impl Section { self.name } + /// Returns a base pointer of this section. #[inline] - pub fn as_ptr(&self) -> *const u8 { - self.base.as_ptr() + pub fn base(&self) -> Base { + self.base } /// Returns the length of this section.