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

macOS: Import File fails to locate and load linked system libraries from dyld cache #4162

Closed
Kentzo opened this issue Apr 19, 2022 · 47 comments
Assignees
Labels
Feature: Filesystem Feature: Loader/Mach-O Status: Internal This is being tracked internally by the Ghidra team
Milestone

Comments

@Kentzo
Copy link

Kentzo commented Apr 19, 2022

Describe the bug
When importing a file Ghidra fails to locate and load libraries from the dyld cache.

To Reproduce
Steps to reproduce the behavior:

  1. Import /usr/bin/tmutil
  2. Check option to load external libraries

Expected behavior
Ghidra locates and loads external libraries that are part of the dyld cache.

Environment (please complete the following information):

  • OS: macOS 11.6.5
  • Ghidra Version: 10.1.2
  • Ghidra Origin: Homebrew cask

Additional context

----- Loading tmutil_x86_64 -----
Skipping segment: __PAGEZERO (tmutil_x86_64)
Searching for referenced library: /usr/lib/swift/libswiftXPC.dylib ...
Unable to find external library: /usr/lib/swift/libswiftXPC.dylib
Searching for referenced library: /usr/lib/swift/libswiftObjectiveC.dylib ...
Unable to find external library: /usr/lib/swift/libswiftObjectiveC.dylib
Searching for referenced library: /usr/lib/swift/libswiftAppKit.dylib ...
Unable to find external library: /usr/lib/swift/libswiftAppKit.dylib
Searching for referenced library: /usr/lib/swift/libswiftCloudKit.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCloudKit.dylib
Searching for referenced library: /usr/lib/swift/libswiftCoreFoundation.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCoreFoundation.dylib
Searching for referenced library: /usr/lib/swift/libswiftMetal.dylib ...
Unable to find external library: /usr/lib/swift/libswiftMetal.dylib
Searching for referenced library: /usr/lib/swift/libswiftCoreGraphics.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCoreGraphics.dylib
Searching for referenced library: /usr/lib/swift/libswiftQuartzCore.dylib ...
Unable to find external library: /usr/lib/swift/libswiftQuartzCore.dylib
Searching for referenced library: /usr/lib/libSystem.B.dylib ...
Unable to find external library: /usr/lib/libSystem.B.dylib
Searching for referenced library: /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration ...
Unable to find external library: /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
Searching for referenced library: /usr/lib/swift/libswiftCore.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCore.dylib
Searching for referenced library: /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv ...
Unable to find external library: /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
Searching for referenced library: /usr/lib/swift/libswiftCoreData.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCoreData.dylib
Searching for referenced library: /usr/lib/libobjc.A.dylib ...
Unable to find external library: /usr/lib/libobjc.A.dylib
Searching for referenced library: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices ...
Unable to find external library: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
Searching for referenced library: /usr/lib/swift/libswiftIOKit.dylib ...
Unable to find external library: /usr/lib/swift/libswiftIOKit.dylib
Searching for referenced library: /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth ...
Unable to find external library: /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
Searching for referenced library: /usr/lib/swift/libswiftFoundation.dylib ...
Unable to find external library: /usr/lib/swift/libswiftFoundation.dylib
Searching for referenced library: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation ...
Unable to find external library: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Searching for referenced library: /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine ...
Unable to find external library: /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine
Searching for referenced library: /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation ...
Unable to find external library: /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
Searching for referenced library: /System/Library/Frameworks/Security.framework/Versions/A/Security ...
Unable to find external library: /System/Library/Frameworks/Security.framework/Versions/A/Security
Searching for referenced library: /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages ...
Unable to find external library: /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages
Searching for referenced library: /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement ...
Unable to find external library: /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
Searching for referenced library: /usr/lib/swift/libswiftos.dylib ...
Unable to find external library: /usr/lib/swift/libswiftos.dylib
Searching for referenced library: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation ...
Unable to find external library: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
Searching for referenced library: /usr/lib/swift/libswiftDarwin.dylib ...
Unable to find external library: /usr/lib/swift/libswiftDarwin.dylib
Searching for referenced library: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit ...
Unable to find external library: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
Searching for referenced library: /usr/lib/swift/libswiftDispatch.dylib ...
Unable to find external library: /usr/lib/swift/libswiftDispatch.dylib
Searching for referenced library: /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration ...
Unable to find external library: /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration
Searching for referenced library: /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration ...
Unable to find external library: /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
Searching for referenced library: /usr/lib/swift/libswiftCoreLocation.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCoreLocation.dylib
Searching for referenced library: /usr/lib/swift/libswiftCoreImage.dylib ...
Unable to find external library: /usr/lib/swift/libswiftCoreImage.dylib
Finished importing referenced libraries for: tmutil_x86_64
  [/System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine] -> not found
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> not found
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> not found
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> not found
  [/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages] -> not found
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> not found
  [/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv] -> not found
  [/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement] -> not found
  [/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation] -> not found
  [/System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration] -> not found
  [/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth] -> not found
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> not found
  [/usr/lib/libobjc.A.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> not found
  [/usr/lib/swift/libswiftAppKit.dylib] -> not found
  [/usr/lib/swift/libswiftCloudKit.dylib] -> not found
  [/usr/lib/swift/libswiftCore.dylib] -> not found
  [/usr/lib/swift/libswiftCoreData.dylib] -> not found
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> not found
  [/usr/lib/swift/libswiftCoreGraphics.dylib] -> not found
  [/usr/lib/swift/libswiftCoreImage.dylib] -> not found
  [/usr/lib/swift/libswiftCoreLocation.dylib] -> not found
  [/usr/lib/swift/libswiftDarwin.dylib] -> not found
  [/usr/lib/swift/libswiftDispatch.dylib] -> not found
  [/usr/lib/swift/libswiftFoundation.dylib] -> not found
  [/usr/lib/swift/libswiftIOKit.dylib] -> not found
  [/usr/lib/swift/libswiftMetal.dylib] -> not found
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> not found
  [/usr/lib/swift/libswiftQuartzCore.dylib] -> not found
  [/usr/lib/swift/libswiftXPC.dylib] -> not found
  [/usr/lib/swift/libswiftos.dylib] -> not found

#3345

@ryanmkurtz
Copy link
Collaborator

Thanks I'll take a look.

@ryanmkurtz
Copy link
Collaborator

Do you actually have those dylibs on your system at those paths? I do not.

@Kentzo
Copy link
Author

Kentzo commented Apr 20, 2022

Indeed, they are now part of the dyld cache: /System/Library/dyld. #3345 says that it should be supported, so I expect Ghidra to resolve these references.

@ryanmkurtz
Copy link
Collaborator

I see. This will be a pretty big change to add support for this.

@ryanmkurtz ryanmkurtz changed the title macOS: Import File fails to locate and load linked system libraries macOS: Import File fails to locate and load linked system libraries from dyld cache Apr 20, 2022
@Kentzo
Copy link
Author

Kentzo commented Apr 20, 2022

@ryanmkurtz In that case could you elaborate what #3345 have fixed then?

@ryanmkurtz
Copy link
Collaborator

Sure. That ticket was mostly about dealing with the "split" dyld cache files..allowing you to load the entire cache (which is now split into .1, .2, etc) into Ghidra, or open the entire cache as a filesystem.

@ryanmkurtz
Copy link
Collaborator

Regarding this ticket, here is a discussion of the changes to macOS that caused the problem: https://developer.apple.com/forums/thread/655588

@Kentzo
Copy link
Author

Kentzo commented Apr 21, 2022

In other words it is possible to load linked libraries and then reference them via External Programs, but at this time I have to do it manually.

@ryanmkurtz
Copy link
Collaborator

Yes that is correct.

@Kentzo
Copy link
Author

Kentzo commented Apr 21, 2022

When I export any of the revealed binaries from the File System dialog, the resulting binary always has size of ~529,4MB. That does not seem right and differs from https://github.com/keith/dyld-shared-cache-extractor

@ryanmkurtz
Copy link
Collaborator

I am not seeing that behavior. What file are you opening in the file system browser, and what are some example dylibs you are exporting that end up with that size?

@ryanmkurtz ryanmkurtz added the Status: Prioritize This is currently being prioritized label Jun 13, 2022
@ryanmkurtz ryanmkurtz added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Prioritize This is currently being prioritized labels Jul 5, 2022
@steven-michaud
Copy link

In other words it is possible to load linked libraries and then reference them via External Programs, but at this time I have to do it manually.

I do this and then re-analyze the module I've loaded. But this has no effect -- links to the external programs are still rendered as <EXTERNAL>::thunk_EXT_FUN_.... Is there a way to make the "External Programs" references actually make a difference?

Thanks in advance, @Kentzo!

I find this bug intensely annoying, and I'm sure I'm not alone. It really should have higher priority.

@Kentzo
Copy link
Author

Kentzo commented Jul 5, 2023

I did not try this in a while. Have you seen the linked issue?

@steven-michaud
Copy link

By the "linked issue" do you mean #4175? I just tried it, and didn't see the problem. Your STR no longer work, so mine were a bit different. And once I'd loaded the TimeMachine framework, I measured the entire size of the TimeMachine.rep project. It was nowhere near as large as you reported. So that issue may have been fixed.

By the way, I've kept playing with possible workarounds for this bug. I extracted the entire dyld shared cache to a single directory, then made that directory part of Ghidra's search path for "system libraries", also increasing the search depth. That worked for simple dylibs (like those in /usr/lib), but didn't work for frameworks. I suspect Ghidra relies on there being a top-level link to the actual module in Versions/A, which doesn't exist for extracted frameworks.

If possible, I'd still like an answer to my original question :-)

@ryanmkurtz
Copy link
Collaborator

I do this and then re-analyze the module I've loaded. But this has no effect -- links to the external programs are still rendered as ::thunk_EXT_FUN_.... Is there a way to make the "External Programs" references actually make a difference?

@steven-michaud Ghidra's external references only really support navigation convenience to the other imported programs.

@steven-michaud
Copy link

Is there a build with this fix that I can download? Or do I need to build Ghidra from source, or wait for the 10.4 release?

@ryanmkurtz
Copy link
Collaborator

You'll need to build the master branch, or wait for the 10.4 release.

@ryanmkurtz
Copy link
Collaborator

I'm really trying to improve this area of Ghidra though, so it would be great if you could provide feedback.

@steven-michaud
Copy link

Over the next few days I'll learn how to build Ghidra from source, and test out the master branch. I'll let you know my results.

@ryanmkurtz
Copy link
Collaborator

Thanks, it's fairly simple. Here are the instructions.

@steven-michaud
Copy link

steven-michaud commented Jul 26, 2023

You're right, the build instructions are quite simple. And they worked! I built the master branch on an Apple Silicon machine (an M1 2020 Mac Mini) running macOS 12.6.7. I used gradle from Homebrew.

I tested the build on /usr/libexec/syspolicyd (its arm64e architecture). Your patch seems to have worked -- all the external references I looked at were resolved. Oddly, though, the "Import Results Summary" still reported a bunch of missing files. But that's a minor issue.

Thanks! This makes Ghidra much more usable on macOS 11 and up.

@ryanmkurtz
Copy link
Collaborator

Glad to hear it's working well for you! Feel free to make new GitHub issues for any bugs/annoyances you might find.

@Kentzo
Copy link
Author

Kentzo commented Sep 22, 2023

Tried that again with Ghidra 10.3.3 on M1 Pro running macOS 13.5.2 and still confused how to get Ghidra to load external libraries.

  1. In the Project window I select File -> Import File...
  2. Then locate /usr/bin/tmutil
  3. In the dialog I pick File System
  4. In the Filesystem Viewer I rich click on x86-64-cpu0x3 and select Import
  5. In the Options... I make sure to check both "Load Local Libraries From Disk" and "Load System Libraries From Disk", then via Edit Paths I add path to the root directory that contains everything I extracted with "dyld-shared-cache-extractor"; note that layout of this directory are such that it acts as root for paths shown by otool -L
  6. I press OK, then OK again
  7. In the Import Results Summary I see that none of the external libraries were loaded due to being "not found"

Please let me know the proper flow of importing macOS binaries alongside external libraries.

@ryanmkurtz
Copy link
Collaborator

@Kentzo In Ghidra 10.3.3, libraries are looked up by just their name and not full path. You can confirm this by selecting the usr/lib directory within your extracted directory structure, rather than the root. You should see some libraries come in.

In the master branch and the upcoming 10.4 release, this has been fixed. You'll be able to specify the root of your extracted directory, or the original dyld_shared_cache file with no need to extract. A lot of improvements have been made to our own extractor. I am also working on a feature that lets you add missing components from the dyld_shared_cache into your current program on demand. The idea there is you import your program and start REing it. Eventually you will come across a red missing reference to something in the cache. You right click on that reference, and perform a new Add To Program action. It will find the library/component being referenced in the cache and insert it into your program. This feature will not be ready for 10.4, but if you are interested I can let you know where to test it.

@Kentzo
Copy link
Author

Kentzo commented Sep 23, 2023

Disregarding the dyld issue, why is Ghidra failing to apply library’s path to roots specified via Edit Paths? Is it going to ve fixed in 10.4?

@ryanmkurtz
Copy link
Collaborator

ryanmkurtz commented Sep 26, 2023

I attempted to explain this with:

In Ghidra 10.3.3, libraries are looked up by just their name and not full path. You can confirm this by selecting the usr/lib directory within your extracted directory structure, rather than the root. You should see some libraries come in.

In the master branch and the upcoming 10.4 release, this has been fixed. You'll be able to specify the root of your extracted directory

Maybe I am not understanding your question correctly. In 10.3.3 if you add all the subdirectories with libraries in them to Edit Paths (not just the root directory), it should find them. This is undesirable behavior which should be fixed in master/upcoming 10.4. release.

@Kentzo
Copy link
Author

Kentzo commented Sep 26, 2023

Thank you for the explanation.

@Kentzo
Copy link
Author

Kentzo commented Sep 29, 2023

@ryanmkurtz Could you explain whether there is a way in 10.4 to resolve "missing" external libraries in existing projects with already imported binaries?

@ryanmkurtz
Copy link
Collaborator

Unfortunately we do not have an automated way to do this. You would have to import the libraries into your project yourself, and then in your already-imported/analyzed programs, go into their External Programs window and specify the linkage. Then, you can rerun the External Symbol Resolver analyzer, and assuming your program has Required Library entries in Help -> About <program>, it should fixup the external references.

I recommend you make a new feature request ticket asking for the ability to load libraries after a program has already been imported. I can then present it to the team for prioritization.

@Kentzo
Copy link
Author

Kentzo commented Oct 3, 2023

I recommend you make a new feature request ticket asking for the ability to load libraries after a program has already been imported. I can then present it to the team for prioritization.

Sure, just wanted to make sure I wasn't missing somethinig


I just tried to import (File->Import File) /usr/bin/tmutil (x86_64) on macOS 13.5.2 (M1) with Ghidra 10.4 with both "Load Local Libraries From Disk" and "Load System Libraries From Disk" (without specifying additional Paths) and it failed to load system libraries:

----- Loading /x86-64-cpu0x3 -----
Fixed 1812 PTR_64_OFFSET chained pointers.
Fixed 3764 PTR_64_OFFSET chained pointers.
Fixed up 5576 chained pointers.
Library /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation: Not found
Library /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation: Not found
Library /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices: Not found
Library /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices: Not found
Library /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration: Not found
Library /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration: Not found
Library /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation: Not found
Library /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation: Not found
Library /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit: Not found
Library /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit: Not found
Library /System/Library/Frameworks/Security.framework/Versions/A/Security: Not found
Library /System/Library/Frameworks/Security.framework/Versions/A/Security: Not found
Library /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation: Not found
Library /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation: Not found
Library /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement: Not found
Library /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement: Not found
Library /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration: Not found
Library /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration: Not found
Library /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv: Not found
Library /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv: Not found
Library /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages: Not found
Library /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages: Not found
Library /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth: Not found
Library /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth: Not found
Library /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration: Not found
Library /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration: Not found
Library /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine: Not found
Library /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine: Not found
Library /usr/lib/libSystem.B.dylib: Not found
Library /usr/lib/libSystem.B.dylib: Not found
Library /usr/lib/libobjc.A.dylib: Not found
Library /usr/lib/libobjc.A.dylib: Not found
Library /usr/lib/swift/libswiftAppKit.dylib: Not found
Library /usr/lib/swift/libswiftAppKit.dylib: Not found
Library /usr/lib/swift/libswiftCore.dylib: Not found
Library /usr/lib/swift/libswiftCore.dylib: Not found
Library /usr/lib/swift/libswiftCoreFoundation.dylib: Not found
Library /usr/lib/swift/libswiftCoreFoundation.dylib: Not found
Library /usr/lib/swift/libswiftCoreImage.dylib: Not found
Library /usr/lib/swift/libswiftCoreImage.dylib: Not found
Library /usr/lib/swift/libswiftDarwin.dylib: Not found
Library /usr/lib/swift/libswiftDarwin.dylib: Not found
Library /usr/lib/swift/libswiftDispatch.dylib: Not found
Library /usr/lib/swift/libswiftDispatch.dylib: Not found
Library /usr/lib/swift/libswiftFileProvider.dylib: Not found
Library /usr/lib/swift/libswiftFileProvider.dylib: Not found
Library /usr/lib/swift/libswiftIOKit.dylib: Not found
Library /usr/lib/swift/libswiftIOKit.dylib: Not found
Library /usr/lib/swift/libswiftMetal.dylib: Not found
Library /usr/lib/swift/libswiftMetal.dylib: Not found
Library /usr/lib/swift/libswiftNetwork.dylib: Not found
Library /usr/lib/swift/libswiftNetwork.dylib: Not found
Library /usr/lib/swift/libswiftObjectiveC.dylib: Not found
Library /usr/lib/swift/libswiftObjectiveC.dylib: Not found
Library /usr/lib/swift/libswiftQuartzCore.dylib: Not found
Library /usr/lib/swift/libswiftQuartzCore.dylib: Not found
Library /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib: Not found
Library /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib: Not found
Library /usr/lib/swift/libswiftXPC.dylib: Not found
Library /usr/lib/swift/libswiftXPC.dylib: Not found
Library /usr/lib/swift/libswift_Concurrency.dylib: Not found
Library /usr/lib/swift/libswift_Concurrency.dylib: Not found
Library /usr/lib/swift/libswiftos.dylib: Not found
Library /usr/lib/swift/libswiftos.dylib: Not found
Linking external programs to x86-64-cpu0x3...
  [/System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine] -> not found
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> not found
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> not found
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> not found
  [/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages] -> not found
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> not found
  [/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv] -> not found
  [/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement] -> not found
  [/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation] -> not found
  [/System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration] -> not found
  [/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth] -> not found
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> not found
  [/usr/lib/libobjc.A.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> not found
  [/usr/lib/swift/libswiftAppKit.dylib] -> not found
  [/usr/lib/swift/libswiftCore.dylib] -> not found
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> not found
  [/usr/lib/swift/libswiftCoreImage.dylib] -> not found
  [/usr/lib/swift/libswiftDarwin.dylib] -> not found
  [/usr/lib/swift/libswiftDispatch.dylib] -> not found
  [/usr/lib/swift/libswiftFileProvider.dylib] -> not found
  [/usr/lib/swift/libswiftIOKit.dylib] -> not found
  [/usr/lib/swift/libswiftMetal.dylib] -> not found
  [/usr/lib/swift/libswiftNetwork.dylib] -> not found
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> not found
  [/usr/lib/swift/libswiftQuartzCore.dylib] -> not found
  [/usr/lib/swift/libswiftUniformTypeIdentifiers.dylib] -> not found
  [/usr/lib/swift/libswiftXPC.dylib] -> not found
  [/usr/lib/swift/libswift_Concurrency.dylib] -> not found
  [/usr/lib/swift/libswiftos.dylib] -> not found

All of these libraries are system and are part of the dyld cache.

What extra do I need to do to let Ghidra automatically load these libraries. Do I need to edit Paths by adding folder that contains the compressed dyld cache, dyld cache itself or a folder with the extracted dyld cache?

@steven-michaud
Copy link

@Kentzo, note what I said above. I saw those same error messages when I tested with what was then the master branch (version number 10.4). But all the external links I looked at were resolved correctly. The error messages may just be spurious.

@ryanmkurtz
Copy link
Collaborator

@Kentzo, If you enabled the System libraries checkbox, you'll probably see these 2 entries in the Edit Paths window:

/System/Library/dyld/dyld_shared_cache_arm64e
/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_arm64e

These are the 2 default dyld_shared_cache files I added. Do you have at least 1 on your system? Maybe i need to add more defaults. You should be able to add your dyld_shared_cache root file in Edit Paths though for it to use it (assuming you are using Ghidra 10.4).

@ryanmkurtz
Copy link
Collaborator

@Kentzo Oh, the issue is likely that your binary is x86 and the dyld_shared_cache files it is looking for are aarch64.

@Kentzo
Copy link
Author

Kentzo commented Oct 3, 2023

@steven-michaud How did you determine that they were actually loaded? I don't see them in the window project, the imported signatures (e.g. from libswift* and libobjc) remain undefined. All imported libraries do appear in Symbol Tree -> Imports, but they don't seem to point to any external programs.

@ryanmkurtz No, nothing was "automatically" added to Edit Paths after I checked "Load System Libraries From Disk".

Screenshot 2023-10-03 at 10 03 05 AM

@Kentzo
Copy link
Author

Kentzo commented Oct 3, 2023

@Kentzo Oh, the issue is likely that your binary is x86 and the dyld_shared_cache files it is looking for are aarch64.

Both x86_64 and aarch64 dydl caches are present on macOS 13.5.2 on M1 (remember, it can run x86_64 binaries through Rosetta):

$ ls -alh /System/Cryptexes/OS/System/Library/dyld/ 
total 8072280
-rwxr-xr-x  1 root  admin   805M Sep  2 00:35 aot_shared_cache.0
-rwxr-xr-x  1 root  admin   893M Sep  2 00:35 aot_shared_cache.1
-rwxr-xr-x  1 root  admin   866M Sep  2 00:35 aot_shared_cache.2
-rwxr-xr-x  1 root  admin   852M Sep  2 00:35 aot_shared_cache.3
-rwxr-xr-x  1 root  admin   271M Sep  2 00:35 aot_shared_cache.4
-rwxr-xr-x  1 root  admin   1.5G Sep  2 00:35 dyld_shared_cache_arm64e
-rwxr-xr-x  1 root  admin   1.7G Sep  2 00:35 dyld_shared_cache_arm64e.01
-rwxr-xr-x  1 root  admin   854K Sep  2 00:35 dyld_shared_cache_arm64e.map
-rwxr-xr-x  1 root  admin   807M Sep  2 00:35 dyld_shared_cache_x86_64
-rwxr-xr-x  1 root  admin   750M Sep  2 00:35 dyld_shared_cache_x86_64.01
-rwxr-xr-x  1 root  admin   713M Sep  2 00:35 dyld_shared_cache_x86_64.02
-rwxr-xr-x  1 root  admin   736M Sep  2 00:35 dyld_shared_cache_x86_64.03
-rwxr-xr-x  1 root  admin   369M Sep  2 00:35 dyld_shared_cache_x86_64.04
-rwxr-xr-x  1 root  admin   696K Sep  2 00:35 dyld_shared_cache_x86_64.map

@ryanmkurtz
Copy link
Collaborator

And you are using 10.4? Can you give me the full path of the x86 one so i can add it?

@steven-michaud
Copy link

How did you determine that they were actually loaded?

I didn't, or at least not directly. I looked through the assembly code for external references. Every one I found was resolved correctly.

@ryanmkurtz
Copy link
Collaborator

@Kentzo thanks, i'll get the x86 one added. You should be able to add /System/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64 manually to Edit Paths to get it working.

@Kentzo
Copy link
Author

Kentzo commented Oct 3, 2023

That's the import output after adding the path you specified:

There were too many messages to display.
67 messages have been truncated.

----- Loading /x86-64-cpu0x3 -----
Fixed 1812 PTR_64_OFFSET chained pointers.
Fixed 3764 PTR_64_OFFSET chained pointers.
Fixed up 5576 chained pointers.
Library /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation: Not found
----- Loading /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -----
Unable to determine entry point.
Library /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Library /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices: Not found
----- Loading /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -----
Unable to determine entry point.
Library /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
Library /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration: Not found
----- Loading /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -----
Unable to determine entry point.
Library /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
Library /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation: Not found
----- Loading /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -----
Unable to determine entry point.
Library /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
Library /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit: Not found
----- Loading /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -----
Unable to determine entry point.
Library /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
Library /System/Library/Frameworks/Security.framework/Versions/A/Security: Not found
----- Loading /System/Library/Frameworks/Security.framework/Versions/A/Security -----
Unable to determine entry point.
Library /System/Library/Frameworks/Security.framework/Versions/A/Security: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/Security.framework/Versions/A/Security
Library /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation: Not found
----- Loading /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -----
Unable to determine entry point.
Library /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
Library /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement: Not found
----- Loading /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement -----
Unable to determine entry point.
Library /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
Library /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration: Not found
----- Loading /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -----
Unable to determine entry point.
Library /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
Library /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv: Not found
----- Loading /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv -----
Unable to determine entry point.
Library /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
Library /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages: Not found
----- Loading /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages -----
Unable to determine entry point.
Library /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages
Library /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth: Not found
----- Loading /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth -----
Unable to determine entry point.
Library /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
Library /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration: Not found
----- Loading /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration -----
Unable to determine entry point.
Library /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration
Library /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine: Not found
----- Loading /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine -----
Unable to determine entry point.
Library /System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine
Library /usr/lib/libSystem.B.dylib: Not found
----- Loading /usr/lib/libSystem.B.dylib -----
Unable to determine entry point.
Library /usr/lib/libSystem.B.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/libSystem.B.dylib
Library /usr/lib/libobjc.A.dylib: Not found
----- Loading /usr/lib/libobjc.A.dylib -----
Unable to determine entry point.
Library /usr/lib/libobjc.A.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/libobjc.A.dylib
Library /usr/lib/swift/libswiftAppKit.dylib: Not found
----- Loading /usr/lib/swift/libswiftAppKit.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftAppKit.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftAppKit.dylib
Library /usr/lib/swift/libswiftCore.dylib: Not found
----- Loading /usr/lib/swift/libswiftCore.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftCore.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftCore.dylib
Library /usr/lib/swift/libswiftCoreFoundation.dylib: Not found
----- Loading /usr/lib/swift/libswiftCoreFoundation.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftCoreFoundation.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftCoreFoundation.dylib
Library /usr/lib/swift/libswiftCoreImage.dylib: Not found
----- Loading /usr/lib/swift/libswiftCoreImage.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftCoreImage.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftCoreImage.dylib
Library /usr/lib/swift/libswiftDarwin.dylib: Not found
----- Loading /usr/lib/swift/libswiftDarwin.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftDarwin.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftDarwin.dylib
Library /usr/lib/swift/libswiftDispatch.dylib: Not found
----- Loading /usr/lib/swift/libswiftDispatch.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftDispatch.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftDispatch.dylib
Library /usr/lib/swift/libswiftFileProvider.dylib: Not found
----- Loading /usr/lib/swift/libswiftFileProvider.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftFileProvider.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftFileProvider.dylib
Library /usr/lib/swift/libswiftIOKit.dylib: Not found
----- Loading /usr/lib/swift/libswiftIOKit.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftIOKit.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftIOKit.dylib
Library /usr/lib/swift/libswiftMetal.dylib: Not found
----- Loading /usr/lib/swift/libswiftMetal.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftMetal.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftMetal.dylib
Library /usr/lib/swift/libswiftNetwork.dylib: Not found
----- Loading /usr/lib/swift/libswiftNetwork.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftNetwork.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftNetwork.dylib
Library /usr/lib/swift/libswiftObjectiveC.dylib: Not found
----- Loading /usr/lib/swift/libswiftObjectiveC.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftObjectiveC.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftObjectiveC.dylib
Library /usr/lib/swift/libswiftQuartzCore.dylib: Not found
----- Loading /usr/lib/swift/libswiftQuartzCore.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftQuartzCore.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftQuartzCore.dylib
Library /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib: Not found
----- Loading /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftUniformTypeIdentifiers.dylib
Library /usr/lib/swift/libswiftXPC.dylib: Not found
----- Loading /usr/lib/swift/libswiftXPC.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftXPC.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftXPC.dylib
Library /usr/lib/swift/libswift_Concurrency.dylib: Not found
----- Loading /usr/lib/swift/libswift_Concurrency.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswift_Concurrency.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswift_Concurrency.dylib
Library /usr/lib/swift/libswiftos.dylib: Not found
----- Loading /usr/lib/swift/libswiftos.dylib -----
Unable to determine entry point.
Library /usr/lib/swift/libswiftos.dylib: Examining file:///System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_x86_64?MD5=6817e8c5982a1c0359b52da6b377cc68|dyldcachev1:///usr/lib/swift/libswiftos.dylib
Linking external programs to libobjc.A.dylib...
  [/usr/lib/libc++abi.dylib] -> not found
  [/usr/lib/liboah.dylib] -> not found
  [/usr/local/lib/libobjc-env.dylib] -> not found
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
Linking external programs to DesktopServicesPriv...
  [/usr/lib/libfakelink.dylib] -> not found
  [/System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS] -> not found
  [/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices] -> not found
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> [/tmutil/SystemConfiguration]
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> [/tmutil/CoreServices]
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> [/tmutil/DiskArbitration]
  [/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers] -> not found
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/libbsm.0.dylib] -> not found
  [/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth] -> [/tmutil/NetAuth]
  [/System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing] -> not found
  [/System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices] -> not found
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText] -> not found
Linking external programs to NetAuth...
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
Linking external programs to libswiftMetal.dylib...
  [/System/Library/Frameworks/Metal.framework/Versions/A/Metal] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftIOKit.dylib] -> [/tmutil/libswiftIOKit.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
Linking external programs to libswiftIOKit.dylib...
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
Linking external programs to Security...
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/usr/lib/libCoreEntitlements.dylib] -> not found
  [/System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity] -> not found
  [/System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer] -> not found
  [/usr/lib/libMobileGestalt.dylib] -> not found
  [/System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression] -> not found
  [/usr/lib/libDiagnosticMessagesClient.dylib] -> not found
  [/usr/lib/libbsm.0.dylib] -> not found
  [/usr/lib/libcoretls.dylib] -> not found
  [/usr/lib/libcoretls_cfhelpers.dylib] -> not found
  [/usr/lib/libpam.2.dylib] -> not found
  [/usr/lib/libsqlite3.dylib] -> not found
  [/usr/lib/libxar.1.dylib] -> not found
  [/usr/lib/libz.1.dylib] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
Linking external programs to SystemConfiguration...
  [/System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/usr/lib/libbsm.0.dylib] -> not found
  [/usr/lib/libnetwork.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/Network.framework/Versions/A/Network] -> not found
Linking external programs to libswiftos.dylib...
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
Linking external programs to libswiftNetwork.dylib...
  [/System/Library/Frameworks/Network.framework/Versions/A/Network] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftIOKit.dylib] -> [/tmutil/libswiftIOKit.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
  [/usr/lib/swift/libswift_Concurrency.dylib] -> [/tmutil/libswift_Concurrency.dylib]
  [/usr/lib/swift/libswiftos.dylib] -> [/tmutil/libswiftos.dylib]
Linking external programs to SystemAdministration...
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/PrivateFrameworks/login.framework/Versions/A/login] -> not found
  [/System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> [/tmutil/CoreServices]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService] -> not found
  [/System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS] -> not found
  [/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices] -> not found
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages] -> [/tmutil/DiskImages]
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> [/tmutil/DiskArbitration]
  [/usr/lib/libcups.2.dylib] -> not found
  [/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement] -> [/tmutil/ServiceManagement]
  [/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation] -> [/tmutil/SecurityFoundation]
  [/System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/LoginUICore] -> not found
  [/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory] -> not found
  [/usr/lib/libCoreStorage.dylib] -> not found
  [/usr/lib/libcsfde.dylib] -> not found
  [/usr/lib/libodfde.dylib] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics] -> not found
  [/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] -> not found
Linking external programs to libswiftFileProvider.dylib...
  [/System/Library/Frameworks/FileProvider.framework/Versions/A/FileProvider] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftIOKit.dylib] -> [/tmutil/libswiftIOKit.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
  [/usr/lib/swift/libswift_Concurrency.dylib] -> [/tmutil/libswift_Concurrency.dylib]
Linking external programs to CoreServices...
  [/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
Linking external programs to SecurityFoundation...
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> [/tmutil/SystemConfiguration]
  [/usr/lib/libz.1.dylib] -> not found
  [/usr/lib/libicucore.A.dylib] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/libc++.1.dylib] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
Linking external programs to TimeMachine...
  [/usr/lib/libDiskUnlock.dylib] -> not found
  [/usr/lib/libfakelink.dylib] -> not found
  [/System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS] -> not found
  [/System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement] -> not found
  [/usr/lib/libCoreStorage.dylib] -> not found
  [/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement] -> [/tmutil/ServiceManagement]
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> [/tmutil/DiskArbitration]
  [/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork] -> not found
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> [/tmutil/SystemConfiguration]
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> [/tmutil/CoreServices]
  [/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv] -> [/tmutil/DesktopServicesPriv]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages] -> [/tmutil/DiskImages]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/PrivateFrameworks/DiskImages2.framework/Versions/A/DiskImages2] -> not found
  [/System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking] -> not found
Linking external programs to libswiftCore.dylib...
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
Linking external programs to libswiftXPC.dylib...
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
Linking external programs to DiskArbitration...
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
Linking external programs to Foundation...
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout] -> not found
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> [/tmutil/SystemConfiguration]
  [/usr/lib/libz.1.dylib] -> not found
  [/usr/lib/libfakelink.dylib] -> not found
  [/usr/lib/libcompression.dylib] -> not found
  [/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork] -> not found
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> [/tmutil/DiskArbitration]
  [/usr/lib/libarchive.2.dylib] -> not found
  [/usr/lib/libDiagnosticMessagesClient.dylib] -> not found
  [/usr/lib/libicucore.A.dylib] -> not found
  [/usr/lib/libxml2.2.dylib] -> not found
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> [/tmutil/CoreServices]
  [/usr/lib/liblangid.dylib] -> not found
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/Combine.framework/Versions/A/Combine] -> not found
  [/System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking] -> not found
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftIOKit.dylib] -> [/tmutil/libswiftIOKit.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
  [/usr/lib/swift/libswift_Concurrency.dylib] -> [/tmutil/libswift_Concurrency.dylib]
  [/usr/lib/swift/libswift_StringProcessing.dylib] -> not found
  [/usr/lib/swift/libswiftos.dylib] -> [/tmutil/libswiftos.dylib]
Linking external programs to libswiftDarwin.dylib...
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
Linking external programs to DiskImages...
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> [/tmutil/DiskArbitration]
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> [/tmutil/CoreServices]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/System/Library/Frameworks/DiscRecording.framework/Versions/A/DiscRecording] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/libcurl.4.dylib] -> not found
  [/usr/lib/libbz2.1.0.dylib] -> not found
  [/usr/lib/libcompression.dylib] -> not found
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/PrivateFrameworks/MediaKit.framework/Versions/A/MediaKit] -> not found
  [/usr/lib/libz.1.dylib] -> not found
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
Linking external programs to libSystem.B.dylib...
  [/usr/lib/system/libcache.dylib] -> not found
  [/usr/lib/system/libcommonCrypto.dylib] -> not found
  [/usr/lib/system/libcompiler_rt.dylib] -> not found
  [/usr/lib/system/libcopyfile.dylib] -> not found
  [/usr/lib/system/libcorecrypto.dylib] -> not found
  [/usr/lib/system/libdispatch.dylib] -> not found
  [/usr/lib/system/libdyld.dylib] -> not found
  [/usr/lib/system/libkeymgr.dylib] -> not found
  [/usr/lib/system/libmacho.dylib] -> not found
  [/usr/lib/system/libquarantine.dylib] -> not found
  [/usr/lib/system/libremovefile.dylib] -> not found
  [/usr/lib/system/libsystem_asl.dylib] -> not found
  [/usr/lib/system/libsystem_blocks.dylib] -> not found
  [/usr/lib/system/libsystem_c.dylib] -> not found
  [/usr/lib/system/libsystem_collections.dylib] -> not found
  [/usr/lib/system/libsystem_configuration.dylib] -> not found
  [/usr/lib/system/libsystem_containermanager.dylib] -> not found
  [/usr/lib/system/libsystem_coreservices.dylib] -> not found
  [/usr/lib/system/libsystem_darwin.dylib] -> not found
  [/usr/lib/system/libsystem_dnssd.dylib] -> not found
  [/usr/lib/system/libsystem_featureflags.dylib] -> not found
  [/usr/lib/system/libsystem_info.dylib] -> not found
  [/usr/lib/system/libsystem_m.dylib] -> not found
  [/usr/lib/system/libsystem_malloc.dylib] -> not found
  [/usr/lib/system/libsystem_networkextension.dylib] -> not found
  [/usr/lib/system/libsystem_notify.dylib] -> not found
  [/usr/lib/system/libsystem_sandbox.dylib] -> not found
  [/usr/lib/system/libsystem_secinit.dylib] -> not found
  [/usr/lib/system/libsystem_kernel.dylib] -> not found
  [/usr/lib/system/libsystem_platform.dylib] -> not found
  [/usr/lib/system/libsystem_pthread.dylib] -> not found
  [/usr/lib/system/libsystem_symptoms.dylib] -> not found
  [/usr/lib/system/libsystem_trace.dylib] -> not found
  [/usr/lib/system/libunwind.dylib] -> not found
  [/usr/lib/system/libxpc.dylib] -> not found
Linking external programs to CoreFoundation...
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal] -> not found
  [/usr/lib/liboah.dylib] -> not found
  [/usr/lib/libfakelink.dylib] -> not found
  [/usr/lib/libicucore.A.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking] -> not found
Linking external programs to libswiftQuartzCore.dylib...
  [/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftIOKit.dylib] -> [/tmutil/libswiftIOKit.dylib]
  [/usr/lib/swift/libswiftMetal.dylib] -> [/tmutil/libswiftMetal.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
Linking external programs to libswift_Concurrency.dylib...
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/libc++.1.dylib] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
Linking external programs to libswiftObjectiveC.dylib...
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
Linking external programs to libswiftDispatch.dylib...
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/libc++.1.dylib] -> not found
  [/System/Library/Frameworks/Combine.framework/Versions/A/Combine] -> not found
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
Linking external programs to libswiftCoreFoundation.dylib...
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
Linking external programs to libswiftUniformTypeIdentifiers.dylib...
  [/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers] -> not found
  [/usr/lib/libSystem.B.dylib] -> [/tmutil/libSystem.B.dylib]
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/usr/lib/libobjc.A.dylib] -> [/tmutil/libobjc.A.dylib]
  [/usr/lib/swift/libswiftCore.dylib] -> [/tmutil/libswiftCore.dylib]
  [/usr/lib/swift/libswiftCoreFoundation.dylib] -> [/tmutil/libswiftCoreFoundation.dylib]
  [/usr/lib/swift/libswiftDarwin.dylib] -> [/tmutil/libswiftDarwin.dylib]
  [/usr/lib/swift/libswiftDispatch.dylib] -> [/tmutil/libswiftDispatch.dylib]
  [/usr/lib/swift/libswiftIOKit.dylib] -> [/tmutil/libswiftIOKit.dylib]
  [/usr/lib/swift/libswiftNetwork.dylib] -> [/tmutil/libswiftNetwork.dylib]
  [/usr/lib/swift/libswiftObjectiveC.dylib] -> [/tmutil/libswiftObjectiveC.dylib]
  [/usr/lib/swift/libswiftXPC.dylib] -> [/tmutil/libswiftXPC.dylib]
  [/usr/lib/swift/libswiftos.dylib] -> [/tmutil/libswiftos.dylib]
Linking external programs to x86-64-cpu0x3...
  [/System/Library/PrivateFrameworks/TimeMachine.framework/Versions/A/TimeMachine] -> [/tmutil/TimeMachine]
  [/System/Library/Frameworks/Security.framework/Versions/A/Security] -> [/tmutil/Security]
  [/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -> [/tmutil/Foundation]
  [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] -> [/tmutil/CoreFoundation]
  [/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit] -> [/tmutil/IOKit]
  [/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages] -> [/tmutil/DiskImages]
  [/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration] -> [/tmutil/SystemConfiguration]
  [/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices] -> [/tmutil/CoreServices]
  [/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv] -> [/tmutil/DesktopServicesPriv]
  [/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement] -> [/tmutil/ServiceManagement]
  [/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation] -> [/tmutil/SecurityFoundation]
  [/System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration] -> [/tmutil/SystemAdministration]
  [/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth] -> [/tmutil/NetAuth]
  [/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration] -> [/tmutil/DiskArbitration]

It seems like some libs are still not found, e.g. [/usr/lib/libc++.1.dylib] -> not found. However I do see this library if open the dyld cache with File -> Open File System.

@ryanmkurtz
Copy link
Collaborator

I'll investigate that tomorrow.

@ryanmkurtz
Copy link
Collaborator

@Kentzo I believe things like /usr/lib/libc++.1.dylib were not found in your case because you had the "Recursive Library Load Depth" loader option set to 1. If you increase it to 2 you should see that library get loaded.

@Kentzo
Copy link
Author

Kentzo commented Oct 4, 2023

I see. Is it feasible to put some note in the log explaining why a particular library was not found?

@ryanmkurtz
Copy link
Collaborator

Yea, the log is kind of a confusing mess. I'll try to make it more clear what's happening.

ryanmkurtz added a commit that referenced this issue Oct 4, 2023
dyld_shared_cache will be searched for in more default locations (#4162)
@steven-michaud
Copy link

@ryanmkurtz, you should probably also add the following paths for macOS 11 and 12:

paths.add("/System/Library/dyld/dyld_shared_cache_x86_64");
paths.add("/System/Library/dyld/dyld_shared_cache_x86_64h");

@ryanmkurtz
Copy link
Collaborator

@steven-michaud, thanks, i'll get those in tomorrow. Please let me know if you know of any more.

@steven-michaud
Copy link

steven-michaud commented Oct 4, 2023

I found one clear-cut case of a spurious error message about a file not being loaded. I tested with Ghidra 10.4 on macOS 14, on an Apple Silicon Mac.

I ran nm -pam /usr/libexec/syspolicyd. The output includes the following line, which shows that syspolicyd imports the __cxa_begin_catch symbol from /usr/lib/libc++.1.dylib:

(undefined) external ___cxa_begin_catch (from libc++)

I opened Ghidra's CodeBrowser, imported /usr/libexec/syspolicyd and OKed all the prompts -- including one to make Ghidra "analyze" this executable. In the "Import Results Summary" (under "Additional Information") I found the following line (among others):

[/usr/lib/libc++.1.dylib] -> not found

I opened the "Functions" window and pasted in __cxa_begin_catch to the "Filter". I found two matches, each of which was a "Thunk Function" and had one or more cross-references. These external references would have been left unidentified in Ghidra 10.3.X and earlier versions. So pretty clearly Ghidra 10.4 did find libc++.1.dylib (in the dyld shared cache).

Because libc++.1.dylib is in the dyld shared cache, no file exists at its "standard" location in /usr/lib. Could that be why Ghidra thinks /usr/lib/libc++.1.dylib wasn't found? Ghidra needs to be able to suppress this kind of error message when libc++.1.dylib exists in the dyld shared cache.

Edit: I did this for both "architectures" of /usr/libexec/syspolicyd -- arm64e and x86_64. I had exactly the same results for both.

ryanmkurtz added a commit that referenced this issue Oct 5, 2023
dyld_shared_cache will be searched for in even more default locations
(#4162)
@ryanmkurtz
Copy link
Collaborator

The master branch now contains improved library logging if you'd like to take it for a spin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Filesystem Feature: Loader/Mach-O Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

No branches or pull requests

3 participants