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

Add dyld shared cache parsing #308

Merged
merged 8 commits into from
May 27, 2021
Merged

Add dyld shared cache parsing #308

merged 8 commits into from
May 27, 2021

Conversation

philipc
Copy link
Contributor

@philipc philipc commented May 26, 2021

Closes #268
Closes #305

cc @mstange

mstange and others added 7 commits May 24, 2021 18:49
This implements just enough to get the path and header offset of each contained image.
It also adds a function to get an "any" File object for the image, so that the caller
doesn't need to write code twice for 32 and 64 bit images and can instead benefit from
the enum-based dynamic dispatch.
This commit also adds two "examples", for printing the list of images in the cache and
for dumping an object from inside the cache.
/// This can be used for parsing Mach-O images inside the dyld shared cache,
/// where multiple images, located at different offsets, share the same address
/// space.
pub fn parse_at(data: R, offset: u64) -> Result<Self> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent!

src/read/read_ref.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@mstange mstange left a comment

Choose a reason for hiding this comment

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

I read through all commits in detail and it all looks great. Much better than what was there before. Just need to address the delimiter / terminator comment.
Thanks a lot!

Use this for dyld cache image paths. The main benefit is avoiding
an artificial limit for mapped data.
@philipc philipc merged commit f8e6431 into gimli-rs:master May 27, 2021
@philipc philipc deleted the dyld branch May 27, 2021 05:58
mcbegamerxx954 pushed a commit to mcbegamerxx954/object that referenced this pull request Jun 15, 2024
Add dyld shared cache parsing
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.

Plans for macOS Big Sur system libraries in the dyld shared cache?
2 participants