43 releases

0.15.1 Oct 30, 2024
0.14.2 Oct 13, 2024
0.13.7 Jul 22, 2024
0.13.4 Dec 27, 2023
0.3.2 Mar 21, 2021

#96 in Debugging

Download history 581/week @ 2024-08-02 727/week @ 2024-08-09 693/week @ 2024-08-16 491/week @ 2024-08-23 408/week @ 2024-08-30 618/week @ 2024-09-06 778/week @ 2024-09-13 1320/week @ 2024-09-20 1180/week @ 2024-09-27 1607/week @ 2024-10-04 2161/week @ 2024-10-11 1481/week @ 2024-10-18 1783/week @ 2024-10-25 1146/week @ 2024-11-01 1874/week @ 2024-11-08 1347/week @ 2024-11-15

6,421 downloads per month
Used in libafl_frida

wxWindows

655KB
4K SLoC

frida-gum docs.rs

Rust bindings for Frida Gum.

Before Installing

  • Build Frida or download the latest supported package
  • Move frida-gum.h and libfrida-gum.a into /usr/local/include and /usr/local/lib (or a more appropriate folder that Rust can detect)

Or: use the auto-download feature to install Frida.

See the documentation for usage instructions.


lib.rs:

Gum bindings for Rust

Gum provides a number of utilities for instrumenting binary applications, and traditionally is consumed via the JavaScript API known as GumJS. This crate aims to provide a complete interface to the instrumentation API provided by Gum, rather than GumJS (s.t. these bindings exclude the Java and ObjC modules).

Quick Start

First, ensure that your platform is supported by Gum. You can find a listing of development kits on the Frida releases page. To get started using Gum, you need to obtain a global [Gum] object; this is required to safely ensure that Gum has been properly initialized as required. Next, you are free to use any available APIs, such as the stalker::Stalker:

use frida_gum::{Gum, stalker::{Stalker, Transformer}};
#[cfg(feature = "event-sink")]
use frida_gum::stalker::NoneEventSink;
use lazy_static::lazy_static;

lazy_static! {
    static ref GUM: Gum = unsafe { Gum::obtain() };
}

fn main() {
    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();
}

Dependencies

~1–4.5MB
~82K SLoC