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 #305

Closed
wants to merge 2 commits into from
Closed

Commits on May 18, 2021

  1. Add MachOFile::parse_at_offset.

    This allows parsing Mach-O images inside dyld shared cache files (gimli-rs#268):
    The dyld shared cache contains multiple images at different offsets; all these
    images share the same address space for absolute offsets such as symoff. Due to
    these absolute offsets, one cannot just parse the images by subsetting the input
    slice and parsing at header offset zero.
    
    This patch is a breaking change because it adds a header_offset argument to the
    MachHeader methods load_commands and uuid, and MachHeader is part of the public API.
    mstange committed May 18, 2021
    Configuration menu
    Copy the full SHA
    44b09db View commit details
    Browse the repository at this point in the history
  2. Add DyldCache.

    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.
    mstange committed May 18, 2021
    Configuration menu
    Copy the full SHA
    7e12d28 View commit details
    Browse the repository at this point in the history