SplitScript reference / Process / mainModule

Process.mainModule

Method

Process.mainModule() -> async Module

Waits for the main executable module.

The module name comes from the exact process candidate that matched during attachment. This is useful for version probes based on the main module's address or mapped size without repeating executable names.

Effects: reads process memory, requires an attached process, suspends, cancels when the process closes

Runtime behavior: available only in onAttach; suspends; cancels when the process closes

Examples

Inspect the main module

let executable = await process.mainModule()