From f2feda074fcfe7f0078c9a8c05b4434a46e1c091 Mon Sep 17 00:00:00 2001 From: KiraCoding <38864051+KiraCoding@users.noreply.github.com> Date: Wed, 4 Sep 2024 19:59:59 +0200 Subject: [PATCH] wip --- src/lib.rs | 2 +- src/program.rs | 2 +- src/section.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) 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.