Skip to content

read/macho: dyld cache slide information improvements#775

Merged
philipc merged 12 commits intogimli-rs:masterfrom
philipc:dyld-cache
Jun 2, 2025
Merged

read/macho: dyld cache slide information improvements#775
philipc merged 12 commits intogimli-rs:masterfrom
philipc:dyld-cache

Conversation

@philipc
Copy link
Copy Markdown
Contributor

@philipc philipc commented Jun 1, 2025

See individual commits. Includes some fixes, API changes, and slide version 2 and 3 support.

philipc added 12 commits June 1, 2025 12:49
Note: I think this slide info is present since macOS 11.
I have tested on a dyld cache from macOS 11, but I don't have
an older dyld cache to test on.
The symbol table data is stored in the linkedit segment,
but that segment may be in a different subcache from the
one containing the image headers. This occurs for the
arm dyld cache in macOS 13.

MachOFile::parse_dyld_cache_image already handled this
correctly, but readobj doesn't use that.
This is leftover from before subcaches were supported.
Delete fields that are duplicates of information in DyldCache and
DyldFile. This makes the enum similar to DyldSubCacheSlice.
Also extract common fields of the mapping enum.
Print the cache header and mappings for every subcache, instead
of only the primary cache file.

Also print the mapping slide information headers.
I think the offset can be useful in itself, and the address
and file offset are easily derived from it.
Change the methods on DyldCacheSlidePointer5 to simply extract
the bitfields, and leave other interpretation to the parser.

Also move PtrauthKey to DyldRelocationAuth, since it is not
an externally defined format.
This will be useful when supporting more slide versions.
Also shorten its name.
This takes the place of wrapping it in Option.
Also shorten its name.
Having a separate versioned DyldCacheRelocationPageIterator
is a flexibility that is not required, and combining them
is simpler.
@philipc philipc merged commit 8130a96 into gimli-rs:master Jun 2, 2025
10 checks passed
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