Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: add get_main_module() #758

Merged
merged 6 commits into from
Nov 28, 2023
Merged

process: add get_main_module() #758

merged 6 commits into from
Nov 28, 2023

Conversation

mrmacete
Copy link
Contributor

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.

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]).
@mrmacete mrmacete requested a review from oleavr November 23, 2023 16:41
Copy link
Member

@oleavr oleavr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, this is awesome! 🤘

gum/gumprocess.h Outdated Show resolved Hide resolved
bindings/gumjs/gumquickprocess.c Outdated Show resolved Hide resolved
@oleavr oleavr merged commit 2429561 into main Nov 28, 2023
4 of 18 checks passed
@oleavr oleavr deleted the feature/add-process-mainmodule branch November 28, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants