This returns a copy of the details of the module which represents the main executable of the process.
It is exposed to JS via the Process.mainModule property (where it's cached because the main module is constant during the process' lifetime).
For darwin this is implemented by getting the first loaded module for which the Mach-O header's filetype is set to MH_EXECUTE. For all other archs it is currently just the first loaded module (equivalent to Process.enumerateModules()[0]).
This returns a copy of the details of the module which represents the main executable of the process.
It is exposed to JS via the
Process.mainModule
property (where it's cached because the main module is constant during the process' lifetime).For darwin this is implemented by getting the first loaded module for which the Mach-O header's
filetype
is set toMH_EXECUTE
. For all other archs it is currently just the first loaded module (equivalent toProcess.enumerateModules()[0]
).