From 3c00ea029551c7e4495cc4de6099f06c4dc97f6a Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Wed, 22 May 2024 13:00:28 -0400 Subject: [PATCH] GP-4432: Fixing MzLoader Program Tree --- .../Base/src/main/java/ghidra/app/util/opinion/MzLoader.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MzLoader.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MzLoader.java index cec62e8add0..02f72176f45 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MzLoader.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MzLoader.java @@ -26,6 +26,7 @@ import ghidra.app.util.bin.format.mz.*; import ghidra.app.util.importer.MessageLog; import ghidra.program.database.mem.FileBytes; +import ghidra.program.database.module.TreeManager; import ghidra.program.model.address.*; import ghidra.program.model.data.DataType; import ghidra.program.model.data.DataUtilities; @@ -314,6 +315,10 @@ private void adjustSegmentStarts(Program program, TaskMonitor monitor) throws Ex } } } + + // Recreate the Program Tree since it may now be out of sync + program.getListing().removeTree(TreeManager.DEFAULT_TREE_NAME); + program.getListing().createRootModule(TreeManager.DEFAULT_TREE_NAME); } private void processRelocations(Program program, SegmentedAddressSpace space, MzExecutable mz,