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.

Ghidra breaks when importing x86-16 target

See original GitHub issue

Describe the bug The provided target (shareware version of an old game) breaks Ghidra when importing with the following errors:

After just selecting the file to import: (NTHeader$$EnhancerByCGLIB$$5309bf04) Invalid NtHeader c50004

After selecting the language and format (using the defaults that Ghidra has detected):

java.lang.IllegalArgumentException: Block must contain split address
	at ghidra.program.database.mem.MemoryMapDB.split(MemoryMapDB.java:785)
	at ghidra.app.util.opinion.MzLoader.adjustSegmentStarts(MzLoader.java:220)
	at ghidra.app.util.opinion.MzLoader.load(MzLoader.java:118)
	at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:346)
	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:401)
	at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:351)
	at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:90)
	at ghidra.util.task.Task.monitoredRun(Task.java:126)
	at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94)
	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)

Attachments target.zip

Environment (please complete the following information):

  • OS: macOS 10.14
  • Java Version: 11.0
  • Ghidra Version: 9.1-DEV (b5498c96)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ryanmkurtzcommented, Sep 12, 2019

We still have to debug the exception, but the message about the invalid NtHeader is simply the PeLoader figuring out that it doesn’t support loading this binary. This binary gets loaded by the MzLoader.

0reactions
ryanmkurtzcommented, Oct 23, 2019

Not sure when exactly this got fixed but it’s working now for 9.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ghidra stickied thread : r/ReverseEngineering - Reddit
If I have to maintain a copy of the structure in a text file outside of my Ghidra instance, or export it to...
Read more >
How to import x86asm into Ghidra?
I originally started with a .COM file, but I couldn't successfully import into Ghidra. My end goal is to compile it up to...
Read more >
Ghidra Change History
Fixed importing of non-Microsoft COFF files when any section crosses address ... Fixed the target of JUMP and JSR for the 6809 to...
Read more >
GhidraTips - Ctrl_Alt_Del-generator
Right click, then select "Set External Name Association " and link it to the >library (which you must have previously imported into Ghidra)....
Read more >
Ghidra Software Reverse Engineering for Beginners
playing Capture the Flag, and making and breaking things. I would like to thank my dad, ... Figure 1.10 – Ghidra project file...
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