question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DyldCacheFileSystem exception: "hash has changed"

See original GitHub issue

I’m trying to load a dyld_shared_cache from an arm64e macOS Monterey machine. Ghidra properly detects the file as a filesystem, and can browse through all the files. After trying to import the /System/Library/PrivateFrameworks/ScreenSharing.framework/ScreenSharing, Ghidra displays this error:

Failed to find provider for segment: __LINKEDIT
java.io.IOException: Failed to find provider for segment: __LINKEDIT
	at ghidra.file.formats.ios.dyldcache.DyldCacheDylibExtractor$PackedDylib.getSegmentProvider(DyldCacheDylibExtractor.java:313)
	at ghidra.file.formats.ios.dyldcache.DyldCacheDylibExtractor$PackedDylib.<init>(DyldCacheDylibExtractor.java:236)
	at ghidra.file.formats.ios.dyldcache.DyldCacheDylibExtractor.extractDylib(DyldCacheDylibExtractor.java:61)
	at ghidra.file.formats.ios.dyldcache.DyldCacheFileSystem.getByteProvider(DyldCacheFileSystem.java:64)
	at ghidra.formats.gfilesystem.FileSystemService.getByteProvider(FileSystemService.java:364)
	at ghidra.plugins.fsbrowser.FSBActionManager.ensureFileAccessable(FSBActionManager.java:941)
	at ghidra.plugins.fsbrowser.FSBActionManager.lambda$createImportAction$37(FSBActionManager.java:698)
	at docking.widgets.tree.GTree$1.run(GTree.java:1152)
	at ghidra.util.worker.AbstractWorker$JobCallback.process(AbstractWorker.java:133)
	at ghidra.util.worker.AbstractWorker$JobCallback.process(AbstractWorker.java:123)
	at generic.concurrent.ConcurrentQ$CallbackCallable.call(ConcurrentQ.java:658)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at generic.concurrent.FutureTaskMonitor.run(FutureTaskMonitor.java:76)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:831)

---------------------------------------------------
Build Date: 2022-Apr-21 1210 EDT
Ghidra Version: 10.1.3
Java Home: /fasthome/antek/.sdkman/candidates/java/16.0.1.hs-adpt
JVM Version: AdoptOpenJDK 16.0.1
OS: Linux 5.16.12-arch1-1 amd64
Workstation: succubus

To Reproduce Steps to reproduce the behavior:

  1. Open Ghidra
  2. Click “new project” (non-shared)
  3. Import the ARM64e dyld_shared_cache file from /System/Library/dyld/dyld_shared_cache_arm64e
  4. Click ‘Filesystem’ in the ‘Container file detected’ dialog box
  5. In the filesystem dialog, navigate to /System/Library/PrivateFrameworks/ScreenSharing.framework/ScreenSharing
  6. Click right mouse button on it, select ‘import’
  7. Error box appears

Expected behavior Ghidra should load the ScreenSharing file into the disassembler/decompiler.

Screenshots image

Attachments

Environment (please complete the following information):

  • OS: ArchLinux
  • Java Version: 16.0.1-hs AdoptOpenJdk
  • Ghidra Version: 10.1.3
  • Ghidra Origin: Github

Additional info

The problem is when importing any file from the dyld shared cache, not just ScreenSharing (tried to load a few of them, and all of them have failed with the same error).

Unpacking the dyld_shared_cache with thirdparty tools and loading the ScreenSharing binary into Ghidra works OK.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
ryanmkurtzcommented, Sep 1, 2022

The fix for this will be in the upcoming 10.2 release, and is currently available in the master branch if you are able to produce your own build.

1reaction
ryanmkurtzcommented, Apr 30, 2022

Yea, it’s not obvious that the .1 file and friends have to be in the same directory.

Ok, I will focus on that hash error for this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dyld2.cpp - Apple Open Source
The API's that dyld supports are implemented in dyldAPIs.cpp. ... don't allow file system relative paths in hardened programs if ( (exceptions !=...
Read more >
macOS 11: copies of dynamic libraries are no longer present ...
Note that the dyld shared cache itself has existed for a long time; the only change here is removing the original copy of...
Read more >
Last Week on My Mac: Users are losing out against Big Sur's ...
The dyld cache, nine files occupying about 4 GB when compressed in /System/Library/dyld, which contains a dynamic linker cache of all the ...
Read more >
Release Notes - Ghidra
MachO DYLD cache incorrect offset use has been fixed. ... Fixed a potential divide-by-zero exception in the EXT4 file system.
Read more >
Apparency | Frequently Asked Questions
This allows the work of building the shared cache to be moved from the installer to the building of macOS itself. That is,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found