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

Ensure block structure is writable in implementation setter #58

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

mrmacete
Copy link
Contributor

@mrmacete mrmacete commented Jan 31, 2024

When the target block doesn't capture any local variables and it is not the result of a copy, its structure can still be residing in a read-only section. In that case setting the block implementation causes a SIGBUS.

This change makes the memory writable before setting the pointer, and puts it back to the original protection afterwards.

depends on frida/frida-gum#779

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.

Thanks!! 🤘

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@oleavr oleavr merged commit 26af7ed into main Feb 13, 2024
@oleavr oleavr deleted the fix/objc-block-ensure-writable branch February 13, 2024 10:24
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