Frida Docs Unified
    Preparing search index...

    A Il2Cpp.Field bound to a Il2Cpp.Object or a Il2Cpp.ValueType (also known as instances).

    const object: Il2Cpp.Object = Il2Cpp.string("Hello, world!").object;
    const m_length: Il2Cpp.BoundField<number> = object.field<number>("m_length");
    const length = m_length.value; // 13

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

    Binding can be done manually with:

    const SystemString = Il2Cpp.corlib.class("System.String");
    const m_length: Il2Cpp.Field<number> = SystemString.field<number>("m_length");

    const object: Il2Cpp.Object = Il2Cpp.string("Hello, world!").object;
    // @ts-ignore
    const m_length_bound: Il2Cpp.BoundField<number> = m_length.bind(object);
    interface BoundField<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type> {
        asNullable(): BoundField<T>;
        get class(): Class;
        equals(other: NativeStruct): boolean;
        get flags(): number;
        handle: NativePointer;
        get isLiteral(): boolean;
        isNull(): boolean;
        get isStatic(): boolean;
        get isThreadStatic(): boolean;
        get modifier(): string;
        get name(): string;
        get offset(): number;
        toString(): string;
        get type(): Il2Cpp.Type;
        get value(): T;
        set value(value: T): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    Accessors

    • get class(): Class

      Gets the class in which this field is defined.

      Returns Class

    • get flags(): number

      Gets the flags of the current field.

      Returns number

    • get isLiteral(): boolean

      Determines whether this field value is known at compile time.

      Returns boolean

    • get isStatic(): boolean

      Determines whether this field is static.

      Returns boolean

    • get isThreadStatic(): boolean

      Determines whether this field is thread static.

      Returns boolean

    • get modifier(): string

      Gets the access modifier of this field.

      Returns string

    • get name(): string

      Gets the name of this field.

      Returns string

    • get offset(): number

      Gets the offset of this field, calculated as the difference with its owner virtual address.

      Returns number

    • get value(): T

      Gets the value of this field.

      Returns T

    • set value(value: T): void

      Sets the value of this field. Thread static or literal values cannot be altered yet.

      Parameters

      • value: T

      Returns void

    Methods

    • Returns boolean