SplitScript reference / MemoryReader

MemoryReader

capability

capability MemoryReader

Reads typed values and bounded strings from an address space.

MemoryReader is the source-side counterpart to MemoryReadable. The reader chooses the address domain, byte order, address validation, and physical read implementation; the requested value chooses the decoded memory layout. Native Process values use address, while emulator providers use original guest addresses represented as u32.

Process-only facilities such as modules, mapped-range enumeration, and scanning are deliberately not part of this capability.

Examples

Read text through a generic memory provider

fn readName(reader, address) {
    return reader.readUtf8(address, 32)
}

Implemented by

MemberDescriptionAvailable through
GBAEmulatorRetains a discovered GBA emulator memory mapping.
GCNEmulatorRetains a discovered Nintendo GameCube MEM1 mapping.
GenesisEmulatorRetains a discovered Sega Genesis work-RAM mapping.
PS1EmulatorRetains a discovered PlayStation emulator memory mapping.
PS2EmulatorRetains a discovered PlayStation 2 emulator memory mapping.
ProcessAccesses the attached game process.
SMSEmulatorRetains a discovered Sega Master System or Game Gear memory mapping.
WiiEmulatorRetains discovered Nintendo Wii MEM1 and MEM2 mappings.

Methods

MemberDescriptionAvailable through
readReads one fixed-layout value from this address space.
readUtf16LeReads a bounded NUL-terminated little-endian UTF-16 string.
readUtf8Reads a bounded NUL-terminated UTF-8 string.