Skip to content

[SharedCache] Add a section for sectionless segments #6513

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

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

Conversation

WeiN76LQh
Copy link

In Binary Ninja it can be quite confusing when a segment is added that doesn't have any sections. libobjc.A.dylib::__OBJC_RW is an example of this. When scrolling through that segment there is no bar at the top of the linear view indicating where the data came from. When looking at the list of segments there are no names and with the different segment and section lists it can be hard to eyeball where a segment lands within the list of sections.

There is an argument here that the better solution is to change the way Binary Ninja displays information. For instance when scrolling through the linear view through a segment with no section, the segment information should be displayed at the top. Additionally segment names could be displayed in the segment list.

In Binary Ninja it can be quite confusing when a segment is added that doesn't have any sections. `libobjc.A.dylib::__OBJC_RW` is an example of this. When scrolling through that segment there is no bar at the top of the linear view indicating where the data came from. When looking at the list of segments there are no names and with the different segment and section lists it can be hard to eyeball where a segment lands within the list of sections.

There is an argument here that the better solution is to change the way Binary Ninja displays information. For instance when scrolling through the linear view through a segment with no section, the segment information should be displayed at the top. Additionally segment names could be displayed in the segment list.
WeiN76LQh pushed a commit to WeiN76LQh/binaryninja-api that referenced this pull request Mar 23, 2025
Similar to what is discussed in PR Vector35#6513 its useful to be able to see where an image header is as sometimes you want to inspect the load commands. Without a section its not very obvious where the header is.

The naming scheme of `${imageName}::__header` was chosen based on the naming choice of the DSC header.
@fuzyll fuzyll added the File Format: SharedCache Issue with the dyld_shared_cache plugin label Apr 3, 2025
@0cyn
Copy link
Member

0cyn commented Apr 28, 2025

I am of the opinion that the solution here is to:

  • Add support for names on segments (MemoryRegions, which dsc uses instead of segments, already adds names)
  • Add an Address display mode that supports segments
  • Add display of segment names in the Memory Map
  • Add a proper display of the segment name in the LinearView sticky header.

I think the golden standard would be sections in the view accurately reflecting sections in memory. There could be analysis repercussions from this. I'll invite further discussion on the topic.

@WeiN76LQh
Copy link
Author

I agree with all of that, this was just a stop gap solution because I didn't see any movement in that space in the time being and this didn't feel too problematic to implement for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
File Format: SharedCache Issue with the dyld_shared_cache plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants