Appearance
sdk.mem
Low-level conversion, layout, session, queue, string, RTTI, and hex helpers. For SDK internals and typed-event fallbacks. Application scripts start at sdk.engine.
lua
local M = require("sdk.mem")u64
function · u64(x)
Normalize a pointer-like value to a number.
hex
function · hex(x)
Format a pointer as a hex string.
layout
function · layout(name)
Returns table|nil: offsets field -> byte offset
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | Engine/Layouts.inc type (TCreature, TGameserverGameSession, ...) |
Returns
| Type | Summary |
|---|---|
table|nil | offsets field -> byte offset |
string|nil | err layout miss |
off
function · off(lay, field)
Named field offset from a layout table, or nil.
look_direction
function · look_direction(ptr)
Facing stored on a TCreature pointer.
client
function · client()
Live TGameClient pointer.
session
function · session()
Live TGameserverGameSession pointer.
queue
function · queue()
Live TProtocolMessageQueue pointer.
dbg
function · dbg()
The native game.dbg table.
qstring
function · qstring(addr)
Read a Qt QString at addr.
arena_string
function · arena_string(addr)
Read an ArenaStringPtr at addr.
rtti_at
function · rtti_at(addr)
RTTI class name at addr.
hex_parts
function · hex_parts(hex)
Split a hex dump into tagged blobs.
hex_bytes
function · hex_bytes(hex)
Decode a hex string to a byte array.
hex_u8
function · hex_u8(hex, off)
Read u8 from a hex dump at a byte offset.
hex_u16
function · hex_u16(hex, off)
Read u16 from a hex dump at a byte offset.
hex_u32
function · hex_u32(hex, off)
Read u32 from a hex dump at a byte offset.
hex_u64
function · hex_u64(hex, off)
Read u64 from a hex dump at a byte offset.
hex_blob
function · hex_blob(hex, index)
Nth tagged blob from a hex dump.
hex_tag
function · hex_tag(hex, tag)
Blob with the given three-letter tag.