Skip to main content

ObjCResolver

Struct ObjCResolver 

Source
pub struct ObjCResolver<'data> { /* private fields */ }
Expand description

Resolves pointers in ObjC metadata, handling chained fixups.

For arm64e binaries, raw pointer values in metadata sections are chained fixup entries, not actual addresses. This resolver maps file offsets to their resolved targets.

Implementations§

Source§

impl<'data> ObjCResolver<'data>

Source

pub fn new(macho: &'data MachoFile<'data>) -> Result<Self>

Performs new.

Source

pub fn read_pointer_at_offset(&self, file_offset: u64) -> Result<Option<Va>>

Read a pointer at a file offset, resolving chained fixups. Returns the resolved VA target, or None if it’s an external bind.

Source

pub fn read_pointer_at_va(&self, va: Va) -> Result<Option<Va>>

Read a pointer at a VA, resolving chained fixups.

Source

pub fn read_cstring(&self, va: Va) -> Result<&'data str>

Read a C string at a VA.

Source

pub fn va_to_offset(&self, va: Va) -> Result<ThinFileOffset>

Get the file offset for a VA.

Source

pub fn bind_name_at_offset(&self, file_offset: u64) -> Option<&str>

Get the import name if a fixup at this file offset is a bind.

Source

pub fn pointer_provenance_at_offset( &self, file_offset: u64, ) -> ObjCPointerProvenance

Reports how a pointer field is represented without resolving or discarding its fixup source.

Source

pub fn macho(&self) -> &MachoFile<'data>

Performs macho.

Source

pub fn image_base(&self) -> u64

Performs image_base.

Source

pub fn endian(&self) -> Endian

Performs endian.

Auto Trait Implementations§

§

impl<'data> Freeze for ObjCResolver<'data>

§

impl<'data> RefUnwindSafe for ObjCResolver<'data>

§

impl<'data> Send for ObjCResolver<'data>

§

impl<'data> Sync for ObjCResolver<'data>

§

impl<'data> Unpin for ObjCResolver<'data>

§

impl<'data> UnsafeUnpin for ObjCResolver<'data>

§

impl<'data> UnwindSafe for ObjCResolver<'data>

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.