NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
52.2k stars 5.91k forks source link

macOS: Importing iOS 16 Beta 1 dyld_shared_cache fails #4406

Closed darbysauter closed 2 years ago

darbysauter commented 2 years ago

Describe the bug When importing the file dyld_shared_cache_arm64 it asks to select an import mode, I selected single file. Using default options.

It will fail to import

To Reproduce Steps to reproduce the behavior:

  1. Import iOS 16 Beta 1 "dyld_shared_cache_arm64" as single file
  2. Use default options and begin import
  3. See error

Expected behavior Successful import

Screenshots

image image

Environment (please complete the following information):

Additional context

Invalid index: 174474192
java.io.IOException: Invalid index: 174474192
    at ghidra.app.util.opinion.DyldCacheLoader.load(DyldCacheLoader.java:108)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:347)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83)
    at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112)
    at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:404)
    at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:350)
    at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
    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:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Invalid index: 174474192
    at ghidra.app.util.bin.FileByteProvider.ensureBounds(FileByteProvider.java:264)
    at ghidra.app.util.bin.FileByteProvider.readBytes(FileByteProvider.java:121)
    at ghidra.app.util.bin.BinaryReader.readInt(BinaryReader.java:678)
    at ghidra.app.util.bin.BinaryReader.readNextInt(BinaryReader.java:315)
    at ghidra.app.util.bin.format.macho.commands.NList.initNList(NList.java:59)
    at ghidra.app.util.bin.format.macho.commands.NList.createNList(NList.java:45)
    at ghidra.app.util.bin.format.macho.commands.SymbolTableCommand.initSymbolTableCommand(SymbolTableCommand.java:84)
    at ghidra.app.util.bin.format.macho.commands.SymbolTableCommand.createSymbolTableCommand(SymbolTableCommand.java:55)
    at ghidra.app.util.bin.format.macho.commands.LoadCommandTypes.getLoadCommand(LoadCommandTypes.java:41)
    at ghidra.app.util.bin.format.macho.MachHeader.parse(MachHeader.java:155)
    at ghidra.app.util.opinion.DyldCacheProgramBuilder$DyldCacheMachoInfo.<init>(DyldCacheProgramBuilder.java:364)
    at ghidra.app.util.opinion.DyldCacheProgramBuilder.processDylibs(DyldCacheProgramBuilder.java:295)
    at ghidra.app.util.opinion.DyldCacheProgramBuilder.build(DyldCacheProgramBuilder.java:132)
    at ghidra.app.util.opinion.DyldCacheProgramBuilder.buildProgram(DyldCacheProgramBuilder.java:103)
    at ghidra.app.util.opinion.DyldCacheLoader.load(DyldCacheLoader.java:98)
    ... 11 more

---------------------------------------------------
Build Date: 2022-May-19 0956 EDT
Ghidra Version: 10.1.4
Java Home: /Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home
JVM Version: Oracle Corporation 11.0.9
OS: Mac OS X 10.16 x86_64

3345

ryanmkurtz commented 2 years ago

What ipsw were you using?

ryanmkurtz commented 2 years ago

What ipsw were you using?

Nevermind, this error should be fixed in the master branch now.