Frida Docs Unified
    Preparing search index...

    A Il2Cpp.Method bound to a Il2Cpp.Object or a Il2Cpp.ValueType (also known as instances).
    Invoking bound methods will pass the assigned instance as this.

    const object: Il2Cpp.Object = Il2Cpp.string("Hello, world!").object;
    const GetLength: Il2Cpp.BoundMethod<number> = object.method<number>("GetLength");
    // There is no need to pass the object when invoking GetLength!
    const length = GetLength.invoke(); // 13

    Of course, binding a static method does not make sense and may cause unwanted behaviors. \

    Binding can be done manually with:

    const SystemString = Il2Cpp.corlib.class("System.String");
    const GetLength: Il2Cpp.Method<number> = SystemString.method<number>("GetLength");

    const object: Il2Cpp.Object = Il2Cpp.string("Hello, world!").object;
    // @ts-ignore
    const GetLengthBound: Il2Cpp.BoundMethod<number> = GetLength.bind(object);
    interface BoundMethod<T extends ReturnType = ReturnType> {
        asNullable(): BoundMethod<T>;
        get class(): Class;
        equals(other: NativeStruct): boolean;
        get flags(): number;
        get fridaSignature(): NativeCallbackArgumentType[];
        get generics(): Class[];
        handle: NativePointer;
        set implementation(
            block: (
                this: Il2Cpp.Object | Class | ValueType,
                ...parameters: Il2Cpp.Parameter.Type[],
            ) => T,
        ): void;
        get implementationFlags(): number;
        inflate<R extends ReturnType = T>(...classes: Class[]): Il2Cpp.Method<R>;
        invoke(...parameters: Il2Cpp.Parameter.Type[]): T;
        get isExternal(): boolean;
        get isGeneric(): boolean;
        get isInflated(): boolean;
        isNull(): boolean;
        get isStatic(): boolean;
        get isSynchronized(): boolean;
        get modifier(): string;
        get name(): string;
        get object(): Il2Cpp.Object;
        overload(...typeNamesOrClasses: (string | Class)[]): Il2Cpp.Method<T>;
        parameter(name: string): Il2Cpp.Parameter;
        get parameterCount(): number;
        get parameters(): Il2Cpp.Parameter[];
        get relativeVirtualAddress(): NativePointer;
        get returnType(): Il2Cpp.Type;
        revert(): void;
        toString(): string;
        tryOverload<U extends ReturnType = T>(
            ...typeNamesOrClasses: (string | Class)[],
        ): Il2Cpp.Method<U>;
        tryParameter(name: string): Il2Cpp.Parameter;
        get virtualAddress(): NativePointer;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    Accessors

    • get class(): Class

      Gets the class in which this method is defined.

      Returns Class

    • get flags(): number

      Gets the flags of the current method.

      Returns number

    • get generics(): Class[]

      Gets the generic parameters of this generic method.

      Returns Class[]

    • get implementationFlags(): number

      Gets the implementation flags of the current method.

      Returns number

    • get isExternal(): boolean

      Determines whether this method is external.

      Returns boolean

    • get isGeneric(): boolean

      Determines whether this method is generic.

      Returns boolean

    • get isInflated(): boolean

      Determines whether this method is inflated (generic with a concrete type parameter).

      Returns boolean

    • get isStatic(): boolean

      Determines whether this method is static.

      Returns boolean

    • get isSynchronized(): boolean

      Determines whether this method is synchronized.

      Returns boolean

    • get modifier(): string

      Gets the access modifier of this method.

      Returns string

    • get name(): string

      Gets the name of this method.

      Returns string

    • get object(): Il2Cpp.Object

      Gets the encompassing object of the current method.

      Returns Il2Cpp.Object

    • get parameterCount(): number

      Gets the amount of parameters of this method.

      Returns number

    • get relativeVirtualAddress(): NativePointer

      Gets the relative virtual address (RVA) of this method.

      Returns NativePointer

    • get returnType(): Il2Cpp.Type

      Gets the return type of this method.

      Returns Il2Cpp.Type

    • get virtualAddress(): NativePointer

      Gets the virtual address (VA) of this method.

      Returns NativePointer

    Methods

    • Returns boolean

    • Restore the original method implementation.

      Returns void