Frida Gum Documentation

repository·main·Indexed 21 days ago

https://github.com/frida/frida-gum

A low-level, cross-platform instrumentation and introspection library written in C. Gum provides the engine for Frida's capabilities, including inline hooking via Interceptor, code tracing via Stalker, memory monitoring, and architecture-specific code generation for X86, Arm, Thumb, Arm64, and Mips.

Tokens
493
Snippets
2
Records
4
Agent score
27%

What's inside frida-gum

  1. Overview of Gum capabilities

    main

    Gum is a cross-platform instrumentation and introspection library written in C. It is primarily consumed by frida-core via GumJS bindings.

    Key functional areas include:

    Instrumentation Core

    • Inline hooking: via Interceptor
    • Stealthy code tracing: via Stalker
    • Memory monitoring: via MemoryAccessMonitor

    Cross-platform Introspection

    • Process state (running threads, etc.)
    • Loaded modules (imports, exports, symbols)
    • Memory scanning and DebugSymbol lookups
    • Backtracer implementations
    • Kernel state (currently iOS only)

    Code Generation and Relocation

    Gum provides architecture-specific writers and relocators for:

    • X86
    • Arm
    • Thumb
    • Arm64
    • Mips

    Specialized Developer Helpers

    • Heap allocation tracking and leak checking.
    • Profiling with a worst-case inspector callback.
  2. Run Gum tests

    main

    Tests are built using make test and executed via the ./build/tests/gum-tests binary.

    You can run a specific test or a group of tests using the -p flag. Test paths follow the pattern /<Area>/<Module>/<test_name>, where the path is derived from TESTENTRY macros in the fixture files (e.g., TESTENTRY_WITH_FIXTURE("Core/Interceptor", ...)).

    To run all tests:

    ./build/tests/gum-tests

    To run a specific test path:

    ./build/tests/gum-tests -p /Core/Interceptor/attach_one
    ./build/tests/gum-tests
    ./build/tests/gum-tests -p /Core/Interceptor/attach_one
  3. Build Gum from source

    main

    You can configure the build using the configure script. Windows users should use configure.bat.

    To build with C++ support, JavaScript bindings, and tests enabled, use the following commands:

    ./configure --enable-gumpp --enable-gumjs --enable-tests
    make

    Run ./configure --help to view all available configuration options.