pub struct VtableIndex {
pub vtables: Vec<VtableEntry>,
/* private fields */
}Expand description
The VtableIndex type.
Fields§
§vtables: Vec<VtableEntry>The vtables field.
Implementations§
Source§impl VtableIndex
impl VtableIndex
Sourcepub fn build_from_source<S>(source: &S) -> Result<Self>
pub fn build_from_source<S>(source: &S) -> Result<Self>
Build from one borrowed thin Mach-O byte source.
The source is not copied and may be a byte slice, vector, or caller-owned read-only memory map. Universal binaries are rejected so callers select an architecture explicitly.
Sourcepub fn build_limited(macho: &MachoFile<'_>, max_vtables: usize) -> Result<Self>
pub fn build_limited(macho: &MachoFile<'_>, max_vtables: usize) -> Result<Self>
Builds at most max_vtables decoded vtables.
The search stops once the output limit is reached. Use
Self::was_truncated to distinguish a complete result from a bounded
one.
Sourcepub fn build_limited_from_source<S>(
source: &S,
max_vtables: usize,
) -> Result<Self>
pub fn build_limited_from_source<S>( source: &S, max_vtables: usize, ) -> Result<Self>
Build at most max_vtables entries from a borrowed thin Mach-O source.
This has the same zero-copy source and universal-binary behavior as
Self::build_from_source.
Sourcepub fn find_by_class(&self, class_name: &str) -> Option<&VtableEntry>
pub fn find_by_class(&self, class_name: &str) -> Option<&VtableEntry>
Performs find_by_class.
Sourcepub fn find_by_va(&self, va: Va) -> Option<&VtableEntry>
pub fn find_by_va(&self, va: Va) -> Option<&VtableEntry>
Performs find_by_va.
Sourcepub fn slot_at(&self, va: Va) -> Option<(&VtableEntry, &VtableSlot)>
pub fn slot_at(&self, va: Va) -> Option<(&VtableEntry, &VtableSlot)>
Performs slot_at.
Sourcepub fn slots_targeting_va(
&self,
target_va: Va,
) -> Vec<(&VtableEntry, &VtableSlot)>
pub fn slots_targeting_va( &self, target_va: Va, ) -> Vec<(&VtableEntry, &VtableSlot)>
Find all vtable slots whose target points to the given function VA.
Sourcepub fn vtables(&self) -> &[VtableEntry]
pub fn vtables(&self) -> &[VtableEntry]
Performs vtables.
Sourcepub fn was_truncated(&self) -> bool
pub fn was_truncated(&self) -> bool
Returns whether additional vtable candidates were skipped at the configured collection bound.
Sourcepub fn find_slot_by_method(
&self,
class_name: &str,
method_name: &str,
) -> Option<(&VtableEntry, &VtableSlot, usize)>
pub fn find_slot_by_method( &self, class_name: &str, method_name: &str, ) -> Option<(&VtableEntry, &VtableSlot, usize)>
Find a vtable function slot by class name and method name.
The method name is matched against the demangled target function name
of each slot. The match is substring-based: "check" matches a slot
targeting "Foo::check()".
Returns the vtable entry, the matching slot, and its function-slot index (0-based, excluding the header slots).