diff options
| author | Mason Reed <mason@vector35.com> | 2025-04-16 16:34:01 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-04-28 20:43:54 -0400 |
| commit | e3bbd4fb8d3eaff44a16f19e1840e2ecd20387de (patch) | |
| tree | 2be5e2df34dc20b01646b8e13c2a3f56404ceb86 | |
| parent | 8267ab475cb2ac82fd3724c009f21e8e30143f6b (diff) | |
[SharedCache] Support loading iOS shared caches older than 11
Still need to fix branch island images not being picked up
| -rw-r--r-- | docs/guide/sharedcache.md | 14 | ||||
| -rw-r--r-- | view/sharedcache/core/SharedCacheView.cpp | 38 |
2 files changed, 30 insertions, 22 deletions
diff --git a/docs/guide/sharedcache.md b/docs/guide/sharedcache.md index 979af70d..2f3a6eb1 100644 --- a/docs/guide/sharedcache.md +++ b/docs/guide/sharedcache.md @@ -9,11 +9,15 @@ Our support for `dyld_shared_cache` is largely open source. The supporting code List of supported features for the given shared cache targets: -| Platform | Arch | Versions | Features | -|----------|--------|----------|-----------------------------| -| macOS | x86_64 | 11 - 15 | Core, Objective-C, Workflow | -| macOS | arm64 | 11 - 15 | Core, Objective-C, Workflow | -| iOS | arm64 | 11 - 18 | Core, Objective-C, Workflow | +| Platform | Arch | Versions | Features | Notes | +|----------|--------|----------|-----------------------------------|--------------------------------| +| macOS | x86_64 | 11 - 15 | Core, Objective-C, Workflow | | +| macOS | arm64 | 11 - 15 | Core, Objective-C, Workflow | | +| iOS | arm64 | 11 - 18 | Core, Objective-C, Workflow | | +| iOS | arm64 | 10 | Core, _~Objective-C_, Workflow | Some objective-c parsing fails | +| iOS | arm64 | 7 - 9 | _~Core_, _~Objective-C_, Workflow | Missing slide info adjustments | + +> Features marked with **~** are partially supported and non-critical issues can occur. - **Core**: Core functionality, such as loading, navigating, and analyzing `dyld_shared_cache` files. - **Objective-C**: Support for analyzing Objective-C information and symbols within the shared cache. diff --git a/view/sharedcache/core/SharedCacheView.cpp b/view/sharedcache/core/SharedCacheView.cpp index 0cd4d82e..77f6e633 100644 --- a/view/sharedcache/core/SharedCacheView.cpp +++ b/view/sharedcache/core/SharedCacheView.cpp @@ -176,11 +176,27 @@ bool SharedCacheView::Init() m_logger = new Logger("SharedCache.View", GetFile()->GetSessionId()); uint32_t platform; + // NOTE: This entry only exists on ios 11 and later, older versions will just assume iOS. GetParentView()->Read(&platform, 0xd8, 4); char magic[17]; GetParentView()->Read(&magic, 0, 16); magic[16] = 0; + if (std::string(magic) == "dyld_v1 arm64" || std::string(magic) == "dyld_v1 arm64e" + || std::string(magic) == "dyld_v1arm64_32") + { + arch = "aarch64"; + } + else if (std::string(magic) == "dyld_v1 x86_64" || std::string(magic) == "dyld_v1 x86_64h") + { + arch = "x86_64"; + } + else + { + m_logger->LogError("Unknown magic: %s", magic); + return false; + } + // TODO: Do we want to add any warnings about platform support here? // TODO: Do we still consider macos experimental? switch (platform) @@ -200,24 +216,12 @@ bool SharedCacheView::Init() case DSCPlatformWatchOS: case DSCPlatformWatchOSSimulator: case DSCPlatformBridgeOS: - default: - m_logger->LogError("Unknown platform: %d", platform); - return false; - } - - if (std::string(magic) == "dyld_v1 arm64" || std::string(magic) == "dyld_v1 arm64e" - || std::string(magic) == "dyld_v1arm64_32") - { - arch = "aarch64"; - } - else if (std::string(magic) == "dyld_v1 x86_64" || std::string(magic) == "dyld_v1 x86_64h") - { - arch = "x86_64"; - } - else - { - m_logger->LogError("Unknown magic: %s", magic); + m_logger->LogError("Unsupported platform: %d", platform); return false; + default: + m_logger->LogWarn("Unknown platform: %d selecting iOS...", platform); + os = "ios"; + break; } SetDefaultPlatform(Platform::GetByName(os + "-" + arch)); |
