From faa9907deb254e2ea34e8ac1de70d3b373201f3c Mon Sep 17 00:00:00 2001 From: xndcn Date: Wed, 11 Jun 2025 20:32:17 +0800 Subject: [PATCH 1/2] Decompiler: Add .xml entension when user did not specify for DebugDecompilerAction --- .../plugin/core/decompile/actions/DebugDecompilerAction.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java index 70c1aaeb8e..8d70adfaf5 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java @@ -29,6 +29,7 @@ import ghidra.app.plugin.core.decompile.DecompilePlugin; import ghidra.app.util.HelpTopics; import ghidra.util.HelpLocation; import ghidra.util.filechooser.ExtensionFileFilter; +import org.apache.commons.io.FilenameUtils; public class DebugDecompilerAction extends DockingAction { @@ -57,6 +58,10 @@ public class DebugDecompilerAction extends DockingAction { if (file == null) { return; } + // If user did not specify an extension, add .xml + if (FilenameUtils.getExtension(file.getPath()).isEmpty()) { + file = new File(file.getAbsolutePath() + ".xml"); + } if (file.exists()) { if (OptionDialog.showYesNoDialog(parentComponent, "Overwrite Existing File?", "Do you want to overwrite the existing file?") == OptionDialog.OPTION_TWO) { From 2be860e3b051bfa60ee95c348dd2de0eb9192e6a Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Mon, 16 Jun 2025 07:48:57 -0400 Subject: [PATCH 2/2] GP-0: Certify --- .../plugin/core/decompile/actions/DebugDecompilerAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java index 8d70adfaf5..9e14431923 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/DebugDecompilerAction.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.