Module frida_gum::stalker

source ·
Expand description

Code tracing engine.

More details about the Frida Stalker can be found on the Stalker page of the Frida documentation.

The Rust interface to the Stalker provides a best-effort “safe” interface, but naturally runtime code modification takes great caution and these bindings cannot prevent all types of misbehaviour resulting in misuse of the Stalker interface.

Examples

To trace the current thread with the Stalker, create a new Stalker and Transformer and call Stalker::follow_me():

#[cfg(feature = "event-sink")]
use frida_gum::stalker::NoneEventSink;
let gum = unsafe { Gum::obtain() };
let mut stalker = Stalker::new(&gum);

let transformer = Transformer::from_callback(&gum, |basic_block, _output| {
    for instr in basic_block {
        instr.keep();
    }
});

#[cfg(feature = "event-sink")]
stalker.follow_me::<NoneEventSink>(&transformer, None);

#[cfg(not(feature = "event-sink"))]
stalker.follow_me(&transformer);

stalker.unfollow_me();

Structs

Enums

Traits