SplitScript reference / Process / findMemoryRange
Process.findMemoryRange
Method
Process.findMemoryRange(size: u64, access: MemoryRangeAccess) -> async MemoryRange
Searches mapped memory ranges cooperatively.
A bounded batch of host memory-range metadata is inspected per update. This does not read the contents of those ranges. When one complete snapshot contains no match, the operation refreshes the mapped ranges and keeps waiting. It completes only after finding the requested size and permissions; closing the attached process cancels it.
Parameters
size: The exact mapped byte length.access: Permissions that the range must provide.
Effects: allocates, reads process memory, requires an attached process, suspends, cancels when the process closes
Runtime behavior: available in suspending attachment code; suspends; cancels when the process closes
Examples
Find a readable and writable emulator mapping
let mapping = await process.findMemoryRange(0x48000, MemoryRangeAccess.ReadWrite)