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

Error loading libraries for: SafariCore java.io.IOException: Invalid index: 443820488 #7469

Open
ro-achterberg opened this issue Feb 10, 2025 · 7 comments
Assignees
Labels
Feature: Loader/Mach-O Status: Triage Information is being gathered

Comments

@ro-achterberg
Copy link

ro-achterberg commented Feb 10, 2025

Describe the bug
Attempting to load all relevant dylds from the library search path leads to Error loading libraries for: SafariCore java.io.IOException: Invalid index: 443820488.

To Reproduce
Steps to reproduce the behavior:

  1. Start new project for 24D60's SafariCore on x86_64.
  2. Choose "Load Libraries" from the menu and make sure to include the a library search path for the extracted dylds in the Library Search Paths. Hit OK.
  3. After a while you'll get the Invalid index error as mentioned.

Expected behavior
Parsing of all the libraries without error.

Screenshots
See attachments.

Attachments

2025-02-10 11:16:27 ERROR (LoadLibrariesOptionsDialog) Load Libraries: Error loading libraries for: SafariCore java.io.IOException: Invalid index: 443820488
    at ghidra.app.util.bin.FileByteProvider.ensureBounds(FileByteProvider.java:264)
    at ghidra.app.util.bin.FileByteProvider.readBytes(FileByteProvider.java:121)
    at ghidra.formats.gfilesystem.RefdByteProvider.readBytes(RefdByteProvider.java:95)
    at ghidra.app.util.bin.BinaryReader.readInt(BinaryReader.java:1067)
    at ghidra.app.util.bin.BinaryReader.readInt(BinaryReader.java:1056)
    at ghidra.app.util.bin.BinaryReader.peekNextInt(BinaryReader.java:376)
    at ghidra.app.util.bin.format.macho.MachHeader.parseSegments(MachHeader.java:206)
    at ghidra.app.util.opinion.MachoLoader.detectCompilerName(MachoLoader.java:82)
    at ghidra.app.util.opinion.MachoLoader.findSupportedLoadSpecs(MachoLoader.java:66)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.matchSupportedLoadSpec(AbstractLibrarySupportLoader.java:1159)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadLibrary(AbstractLibrarySupportLoader.java:816)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadLibraryFromSearchPaths(AbstractLibrarySupportLoader.java:628)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadLibraries(AbstractLibrarySupportLoader.java:533)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:128)
    at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:129)
    at ghidra.plugin.importer.LoadLibrariesOptionsDialog.lambda$okCallback$1(LoadLibrariesOptionsDialog.java:76)
    at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:87)
    at ghidra.util.task.Task.monitoredRun(Task.java:134)
    at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1570)

Environment (please complete the following information):

  • OS: macOS 15.3 (24D60)
  • Java Version:
    java 22.0.2 2024-07-16
    Java(TM) SE Runtime Environment (build 22.0.2+9-70)
    Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)
  • Ghidra Version: 11.3 PUBLIC
  • Ghidra Origin: official GitHub distro

Additional context
Will gladly provide any additional details upon request.

@ryanmkurtz ryanmkurtz self-assigned this Feb 10, 2025
@ryanmkurtz ryanmkurtz added Feature: Loader/Mach-O Status: Triage Information is being gathered labels Feb 10, 2025
@ryanmkurtz
Copy link
Collaborator

How did you import SafariCore? Was that extracted from the cache or does it reside on your system somewhere?

@ro-achterberg
Copy link
Author

ro-achterberg commented Feb 10, 2025 via email

@ryanmkurtz
Copy link
Collaborator

Ok. I'll say up front that Ghidra may not play nicely with dylb's extracted from other tools. Ghidra can also extract...did you try that?

@ro-achterberg
Copy link
Author

ro-achterberg commented Feb 10, 2025 via email

@ro-achterberg
Copy link
Author

ro-achterberg commented Feb 10, 2025 via email

@ryanmkurtz
Copy link
Collaborator

Well, it seems to be working as expected. If you bring in libobjc.dylib before starting any analysis, it won't complain about the missing string at 0x7ff81f6fd197.

@ryanmkurtz
Copy link
Collaborator

I am going to play with bringing in libobjc.dylib by default, along with some other pieces that seem essential for proper analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Loader/Mach-O Status: Triage Information is being gathered
Projects
None yet
Development

No branches or pull requests

2 participants