TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CryZe/asr-assemblyscript/llms.txt
Use this file to discover all available pages before exploring further.
process module is the foundation of any auto splitter that needs to inspect game memory. It provides everything required to locate a running game process by name, verify that it is still alive, resolve the base address of any loaded module, and read arbitrary memory regions into an ArrayBuffer for further decoding. All host communication is handled transparently — the exported functions you call are thin wrappers around the raw WebAssembly imports that manage UTF-8 string encoding for you.
Type Aliases
ProcessId— An opaque 64-bit handle returned byattach()that identifies a specific process. Pass it to all subsequent process calls. A value of0means “no process”.Address— A 64-bit memory address, typically a relative offset from a module’s base address. Combine it with the result ofgetModuleAddress()to form an absolute address.
attach
name. The name is compared against the process list on the host. If no matching process is found, 0 is returned.
The process name to search for, e.g.
"Celeste.exe" or "celeste.x86_64". The name is encoded as UTF-8 before being passed to the host.ProcessId — a non-zero handle if the process was found, or 0 if it was not.
detach
isOpen() returns false, or when your auto splitter is done with the process, to clean up host-side resources.
The handle returned by a previous
attach() call.isOpen
process is still running. You should call this every tick and detach (then re-attach) when it returns false.
The handle to check. Passing
0 will always return false.bool — true if the process is still open; false if it has exited or the handle is invalid.
read
address and writes it into buf. Exactly buf.byteLength bytes are read. Returns false if the read fails (e.g. the address is unmapped or the process has exited).
The handle of the process to read from.
The absolute memory address to read from. Typically computed as
moduleBase + offset.The destination buffer. The host will write exactly
buf.byteLength bytes into it.bool — true if the read succeeded; false if it failed.
read() always reads exactly buf.byteLength bytes. Size your buffer to match the type you intend to decode: 1 byte for i8/u8/bool, 2 bytes for i16/u16, 4 bytes for i32/u32/f32, 8 bytes for i64/u64/f64. Watcher classes (see Watcher) handle this sizing automatically.getModuleAddress
The handle of the process whose module list to query.
The module file name, e.g.
"Celeste.exe" or "UnityPlayer.dll". Encoded as UTF-8 before being passed to the host.Address — the base address of the module, or 0 if the module is not loaded.
getModuleSize
The handle of the process to query.
The module file name to look up.
u64 — the size of the module in bytes, or 0 if the module was not found.