NationalSecurityAgency / ghidra

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

Import fails on 10.3.1 whereas 10.0.4 imports it. #5519

Closed anzosasuke closed 1 year ago

anzosasuke commented 1 year ago

Trying to import clang compiled C program object file. Getting the error which I don't get in 10.0.4. Using ubuntu 22.04.

Cannot invoke "java.util.Map.put(Object, Object)" because "this.gotMap" is null
java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because "this.gotMap" is null
    at ghidra.app.util.bin.format.elf.relocation.X86_64_ElfRelocationContext.getGotEntryAddress(X86_64_ElfRelocationContext.java:216)
    at ghidra.app.util.bin.format.elf.relocation.X86_64_ElfRelocationHandler.relocate(X86_64_ElfRelocationHandler.java:263)
    at ghidra.app.util.bin.format.elf.relocation.ElfRelocationContext.processRelocation(ElfRelocationContext.java:112)
    at ghidra.app.util.opinion.ElfProgramBuilder.processRelocationTableEntries(ElfProgramBuilder.java:1048)
    at ghidra.app.util.opinion.ElfProgramBuilder.processRelocationTable(ElfProgramBuilder.java:950)
    at ghidra.app.util.opinion.ElfProgramBuilder.processRelocations(ElfProgramBuilder.java:885)
    at ghidra.app.util.opinion.ElfProgramBuilder.load(ElfProgramBuilder.java:171)
    at ghidra.app.util.opinion.ElfProgramBuilder.loadElf(ElfProgramBuilder.java:108)
    at ghidra.app.util.opinion.ElfLoader.load(ElfLoader.java:147)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:811)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:100)
    at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:131)
    at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:388)
    at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:347)
    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:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

---------------------------------------------------
Build Date: 2023-Jun-14 1629 EDT
Ghidra Version: 10.3.1
Java Home: /usr/lib/jvm/java-17-openjdk-amd64
JVM Version: Private Build 17.0.7
OS: Linux 5.19.0-35-generic amd64

current workaround is to first use the 10.0.4 and then upgrade it in 10.3.1. attaching the object file for just in case. Need help. Thanks in advance. alias.zip

ghidra1 commented 1 year ago

X86-64 GOT section generation for object modules fixed for 10.3.2