Frida Docs Unified
    Preparing search index...

    Compiles Rust source code to machine code, straight to memory.

    Useful for implementing hot callbacks, e.g. for Interceptor and Stalker, but also useful when needing to start new threads in order to call functions in a tight loop, e.g. for fuzzing purposes.

    Public functions are automatically exported as NativePointer properties. This means you can pass them to Interceptor and Stalker, or call them using NativeFunction. In such cases you typically want to ensure they are marked #[no_mangle] and extern "C".

    In addition to Rust libraries, the code being mapped in can also communicate with JavaScript through the symbols exposed to it. These can be plugged in at creation, e.g. to share memory allocated using Memory.alloc(), or NativeCallback values for receiving callbacks from the Rust module.

    Indexable

    • readonly [name: string]: any
    Index

    Constructors

    Methods

    Constructors

    • Creates a new Rust module from the provided code.

      Parameters

      • code: string

        Rust source code to compile.

      • Optionalsymbols: CSymbols

        Symbols to expose to the Rust module. Declare them as extern "C". This may for example be one or more memory blocks allocated using Memory.alloc(), and/or NativeCallback values for receiving callbacks from the Rust module.

      • Optionaloptions: RustModuleOptions

        Options for customizing the construction.

      Returns RustModule

    Methods

    • Eagerly unmaps the module from memory. Useful for short-lived modules when waiting for a future garbage collection isn't desirable.

      Returns void