memory

The memory global library provides low-level functions for directly interacting with the game's process memory. This allows for reading and writing values at specific memory addresses.

Supported Data Types

The type parameter in memory.Read and memory.Write accepts the following case-insensitive strings:

Type String

C++ Type

Lua Type

Notes

"float"

float

number

"double"

double

number

"int"

int32_t

number

32-bit signed integer

"uint"

uint32_t

number

32-bit unsigned integer

"bool"

bool

boolean

"byte"

uint8_t

number

8-bit unsigned integer

"short"

int16_t

number

16-bit signed integer

"ushort"

uint16_t

number

16-bit unsigned integer

"int64"

int64_t

number

64-bit signed integer

"uint64"

uint64_t

number

64-bit unsigned integer

"pointer" / "ptr"

uintptr_t

number

A memory address

"string"

char[]

string

Reads/writes a standard C-style string

"vector2"

vector2

Vector2

"vector3"

vector

Vector3

"color3"

vector

Color3

Stored as a Vector3 in memory

"cframe"

CFrame

table

Read-only


memory.Read

Reads a value of a specified data type from a given memory address.

memory.Read(type, address)

Parameters:

  • type (string): The data type to read. See the supported data types table above.

  • address (number): The raw memory address to read from.

Returns:

  • (any): The value read from memory, converted to the appropriate Lua type, or nil on failure.

local local_player = game.LocalPlayer
local character = local_player and local_player.Character
local humanoid = character and character:FindFirstChild("Humanoid")

if humanoid then
    local humanoid_addr = humanoid.Address

    -- Offset for WalkSpeed
    local walkspeed_addr = humanoid_addr + 0x1d4
    local current_speed = memory.Read("float", walkspeed_addr)

    print("Current WalkSpeed from memory:", current_speed)
end

memory.Write

Writes a new value to a specified memory address.

memory.Write(type, address, value)

Parameters:

  • type (string): The data type to write.

  • address (number): The raw memory address to write to.

  • value (any): The new value to write. The type of this value must match the type parameter.

Returns:

  • (nil)

local humanoid = game.LocalPlayer.Character and game.LocalPlayer.Character.Humanoid

if humanoid then
    local humanoid_addr = humanoid.Address

    -- Offset for HipHeight
    local hipheight_addr = humanoid_addr + 0x1a0

    -- Write a new float value to the address
    memory.Write("float", hipheight_addr, 5.0)
end

memory.GetBase

Retrieves the base address of the main game module.

memory.GetBase()

Returns:

  • (number): The base address of the RobloxPlayerBeta.exe module.


memory.Rebase

A utility function to calculate an address by adding an offset to the game's base address. This is useful for static addresses.

memory.Rebase(offset)

Parameters:

  • offset (number): The offset to add to the base address.

Returns:

  • (number): The resulting rebased address.

Last updated