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

[SharedCache] Apply objc_msgSend call type overrides in more places #6436

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bdash
Copy link
Contributor

@bdash bdash commented Feb 20, 2025

fixObjCCallTypes is updated to handle tail calls as well as regular calls.

Additionally, if the selector address is not valid it now looks for the sel_ symbols that DSCObjCProcessor::ReadMethodList adds for selectors whose names reside in regions that are not yet mapped. This allows call type overrides to be applied even when a selector's name is defined in a different image. This is the common case in recent macOS shared caches at least.

`fixObjCCallTypes` is updated to handle tail calls as well as regular
calls.

Additionally, if the selector address is not valid it now looks for the
`sel_` symbols that `DSCObjCProcessor::ReadMethodList` adds for
selectors whose names reside in regions that are not yet mapped. This
allows call type overrides to be applied even when a selector's name is
defined in a different image.
@bdash
Copy link
Contributor Author

bdash commented Feb 20, 2025

This works, but Binary Ninja seems to get confused about the state of some functions.

In some cases the override doesn’t appear to take. When I scroll the function containing the override to the right place in the view I see a little progress spinner appear at the top of the view, where the “Reanalyze function” arrow would usually be. It just spins and spins. If I right-click on one of the objc_msgSend calls that has had its type overridden and select “Override Call Type…” it shows the expected overridden type. If I hit Accept the call (and others in the same function) all update to reflect the overrides.

Is this an error in fixObjCCallTypes, or a bug elsewhere?

@bdash bdash marked this pull request as draft February 20, 2025 00:09
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.

1 participant