Struct frida_gum::stalker::Stalker

source ·
pub struct Stalker<'a> { /* private fields */ }
Expand description

Code tracing engine interface.

Implementations§

source§

impl<'a> Stalker<'a>

source

pub fn is_supported(_gum: &Gum) -> bool

Checks if the Stalker is supported on the current platform.

source

pub fn new<'b>(gum: &'b Gum) -> Stalker<'_>
where 'b: 'a,

Create a new Stalker.

This call has the overhead of checking if the Stalker is available on the current platform, as creating a Stalker on an unsupported platform results in unwanted behaviour.

source

pub fn new_with_params<'b>( gum: &'b Gum, ic_entries: u32, adjacent_blocks: u32 ) -> Stalker<'_>
where 'b: 'a,

Create a new Stalker with parameters

This call has the overhead of checking if the Stalker is available on the current platform, as creating a Stalker on an unsupported platform results in unwanted behaviour.

source

pub fn exclude(&mut self, range: &MemoryRange)

Exclude a range of address from the Stalker engine.

This exclusion will prevent the Stalker from tracing into the memory range, reducing instrumentation overhead as well as potential noise from the EventSink.

source

pub fn set_trust_threshold(&mut self, threshold: i32)

Set how many times a piece of code needs to be executed before it is assumed it can be trusted to not mutate.

Specify -1 for no trust (slow), 0 to trust code from the get-go, and N to trust code after it has been executed N times. Defaults to 1.

source

pub fn get_trust_threshold(&self) -> i32

Get the Stalker trust treshold, see Stalker::set_trust_threshold() for more details.

source

pub fn flush(&mut self)

Flush all buffered events.

source

pub fn stop(&mut self)

source

pub fn garbage_collect(&mut self) -> bool

Free accumulated memory at a safe point after Stalker::unfollow_me().

This is needed to avoid race-conditions where the thread just unfollowed is executing its last instructions.

source

pub fn follow<S: EventSink>( &mut self, thread_id: usize, transformer: &Transformer<'_>, event_sink: Option<&mut S> )

Available on crate feature event-sink only.

Begin the Stalker on the specific thread.

A Transformer must be specified, and will be updated with all events.

If reusing an existing Transformer, make sure to call Stalker::garbage_collect() periodically.

source

pub fn follow_me<S: EventSink>( &mut self, transformer: &Transformer<'_>, event_sink: Option<&mut S> )

Available on crate feature event-sink only.

Begin the Stalker on the current thread.

A Transformer must be specified, and will be updated with all events.

If reusing an existing Transformer, make sure to call Stalker::garbage_collect() periodically.

source

pub fn unfollow(&mut self, thread_id: usize)

Stop stalking the specific thread.

source

pub fn unfollow_me(&mut self)

Stop stalking the current thread.

source

pub fn is_following_me(&mut self) -> bool

Check if the Stalker is running on the current thread.

source

pub fn activate(&mut self, start: NativePointer)

Re-activate the Stalker at the specified start point.

source

pub fn deactivate(&mut self)

Pause the Stalker.

source

pub fn enable_unwind_hooking(&mut self)

Enable (experimental) unwind hooking

source

pub fn set_observer<O: StalkerObserver>(&mut self, observer: &mut O)

Available on crate feature stalker-observer only.

Trait Implementations§

source§

impl<'a> Drop for Stalker<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Stalker<'a>

§

impl<'a> RefUnwindSafe for Stalker<'a>

§

impl<'a> !Send for Stalker<'a>

§

impl<'a> !Sync for Stalker<'a>

§

impl<'a> Unpin for Stalker<'a>

§

impl<'a> UnwindSafe for Stalker<'a>

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>,

§

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>,

§

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.