Skip to main content
An address in the game process. Immutable: arithmetic returns a new Pointer. Global class, no import.
Pointer is always game memory, read-only. Addresses in ffi are plain bigints.

Overview

Creating

new Pointer, Pointer.from, Pointer.null.

Address and arithmetic

address, isNull, add, sub, equals.

Reading

deref, resolve, read, the …Raw variants.

Scalar types

int32, float, ptr, vector…

Snapshot

read, bytes, as.

Creating

new Pointer


PointerLike is a Pointer, a bigint, a non-negative integer or a "0x…" string. Pointer.null is the null pointer.
Most pointers come from memory.module, memory.scan or entity.address.

Address and arithmetic


Reading

A read of unmapped memory, or of a null pointer, throws Error with code: "EREAD".

deref


The pointer stored at this address.

resolve


Follows a pointer chain: every offset but the last is added and dereferenced, the last is only added. No offsets returns a copy.

read


Reads by scalar type, by struct, or copies raw bytes into a Snapshot.
Struct types come from memory.struct. ptr fields read as Pointers. Writing a field changes only the local copy.

Cached and raw reads


read, deref and resolve can return a value up to one frame old. The …Raw variants take the same arguments and always read fresh.

Scalar types

The type names every memory read uses: Pointer.read, Snapshot.read, entity.read and struct fields.

Snapshot

What read(byteCount) returns: bytes copied out of the game once. Reading past its end throws RangeError.
One snapshot and many reads is cheaper than many small reads.

Example

Reads a list of player records behind a signature.