diff --git a/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.md b/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.md index a0814cb4f76..8e83034bedd 100644 --- a/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.md +++ b/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.md @@ -1,3 +1,82 @@ +# Ghidra 12.1.3 Change History (August 2026) + +### Improvements +* _Basic Infrastructure_. Added stricter filtering to characters used for symbol names. (GP-6843, Issue #9165, #9172, #9206) +* _BSim_. Improved escaping in `BSimControlLaunchable`. (GP-6977) +* _BSim_. Upgraded the PostgreSQL JDBC Driver from 42.7.11 to 42.7.13. (GP-7105) +* _BSim_. Upgraded postgresql for BSim to 15.18. (GP-7107) +* _Demangler_. The Swift Demangler Analyzer no longer accepts a user-specified path to the Swift binary directory. Instead, the Demangler expects Swift to be on the `PATH`. (GP-7045) +* _Exporter_. Added packed Debugger Trace import/export using `*.gzt` files. (GP-6891) +* _GUI_. Updated the Headless Analyzer to not write to the user's preferences. (GP-7096, Issue #9414) +* _Importer:COFF_. Implemented the COFF `IMAGE_REL_ARM64_ADDR64` relocation. (GP-7088, Issue #9408) +* _Importer:Mach-O_. Provided safer parsing of `dyld_shared_cache` files. (GP-7046) +* _Logging_. Upgraded log4j to version 2.26.1. (GP-7134) +* _Multi-User_. Corrected potential network performance issue related to Ghidra Server use. Full benefit requires update of both Ghidra Server installation and Ghidra client software. (GP-7012, Issue #2752, #9316) +* _Processors_. Made SparcV9 register display formatting more consistent. (GP-941) +* _Scripting_. Updated the Structure Editor to perform a structure reload when the structure's description is changed outside of the editor. (GP-7118, Issue #9461) +* _Search_. Updated __Find Uses of__ for FunctionDefinitions to find references inside of functions and function parameters. (GP-7044, Issue #9342) + +### Bugs +* _Analysis_. Fixed failure to recover switch instructions if the switch is computed with an instruction with internal pcode branching such as the AARCH64 `csel` instruction. (GP-7023) +* _BSim_. Improved `GhidraURL.toURL` to handle Ghidra URLs previously stored by BSim where proper URL encoding was never performed. (GP-6970, Issue #9275) +* _Data Types_. Corrected BuiltIn GUID datatype alignment to be 4 bytes instead of 8 bytes. Packed structures containing this datatype will need to be re-packed to pick up on this change. (GP-6953, Issue #9200) +* _DB_. Corrected Ghidra database problem which could prevent analysis times from getting properly saved to a program. (GP-7070, Issue #9346) +* _DB_. Corrected internal method behavior for `ContentHandler.getChangeSet` which could return an empty change set if the version range does not include the latest version. (GP-7113, Issue #9415) +* _Debugger:Agents_. Now applying proper argument quoting and metacharacter escaping to prevent `ShellUtils` command injection. (GP-6934, Issue #9283) +* _Debugger:Time_. Fixed PC column in Time panel when emulating from a live target. (GP-6841) +* _Debugger:Trace_. Fixed a potential OOM exception in `ObjectStorageStreamAdapter` used by Trace database. (GP-6886) +* _Decompiler_. Added Decompiler support for memory accesses that wrap from high to low addresses. (GP-6936) +* _FileSystems_. Fixed a potential path-traversal vulnerability in `AndroidProjectCreator`. (GP-6885) +* _GUI_. Fixed bugs in the Column Filter Dialog that caused `NullPointerExceptions` on some Mac systems. (GP-7050) +* _GUI_. Fixed a deadlock seen when saving a program. (GP-7051, Issue #9358) +* _GUI_. Fixed incorrect tool tips in the File Chooser that are sometimes seen when filenames are clipped. (GP-7094) +* _Importer_. Fixed a potential path-traversal vulnerability when importing XML `*.bytes` files. (GP-7064) +* _Importer_. Fixed a potential infinite loop in the PEF loader and made improvements to OMF parsing. (GP-7071) +* _Importer_. Providing more efficient parsing of System Object Model (SOM) binaries. (GP-7123) +* _Importer_. Providing more efficient parsing of Motorola Hex files. (GP-7124) +* _Importer:ELF_. Corrected an issue found with ELF dynamic PLTGOT processing, in the absence of section headers, which could cause the last PLT to be skipped. (GP-7056) +* _Importer:ELF_. Corrected ELF Importer regression with Ghidra 12.1.2 which could fail when processing dynamic GNU Hashtable and symbol table. (GP-7061, Issue #9369) +* _Importer:Mach-O_. Fixed an `IndexOutOfBoundsException` in the Mach-O loader that could occur when importing a binary with a `LC_DYSYMTAB` load command but having a missing or empty `LC_SYMTAB` load command. (GP-7079, Issue #9399) +* _Importer:PE_. Fixed unsigned PE export ordinal-table indexes. (GP-7085, Issue #9396, #9397) +* _Importer:PE_. Improved the handling of JDOM attribute errors in the PE `LibraryLookupTable`. (GP-7087, Issue #6288) +* _Listing_. Fixed an `IllegalArgumentException` that occurred when trying to perform __Copy Special__ in the Listing with a program name that contains the exclamation mark (`!`) character. (GP-7055, Issue #9362) +* _PDB_. Fixed a memory-consumption issue that could occur with a malformed PDB directory stream. (GP-6971) +* _Processors_. Added support for RH850G3 instructions in the V850 language module. (GP-2907, Issue #4788) +* _Processors_. Fixed register operand for ARM M-profile `msr apsr` instruction operand encoding. (GP-5206, Issue #6597, #6598) +* _Processors_. Added several missing x86 instructions. (GP-5780) +* _Processors_. Added semantics for several x86 AVX instructions. (GP-6061, Issue #9184, #9197) +* _Processors_. Added CPU32 variant for the M68000 processor module. (GP-6186, Issue #1244, #2617, #8463, #9084) +* _Processors_. Corrected operand sizes for AARCH64 `stlrb` and `stlrh` instructions. (GP-6620, Issue #6468, #9043) +* _Processors_. Corrected disassembly of HCS12 `BRN` instruction. (GP-6642, Issue #9001) +* _Processors_. Fixed an issue with a missing return address for the SuperH4 `bsr` instruction. (GP-6699) +* _Processors_. Corrected x86 logic for setting the `OF` flag for `SHR`, `RCL`, and `RCR` instructions. (GP-6767, Issue #9330) +* _Processors_. Corrected Tricore `subc` carry flag usage. (GP-6769) +* _Processors_. Corrected carry flag calculation for the MCS-96 `CMPL` instruction. (GP-6770) +* _Processors_. Added missing x86 GFNI instructions. (GP-6818) +* _Processors_. Corrected handling of RISC-V 16-bit operands. (GP-6876) +* _Processors_. Fixed RISC-V emulation of `div` and `rem` instructions when divisor is 0. (GP-6909, Issue #6508, #9225, #9235) +* _Processors_. Added PowerPC v3.0B, v3.0C instructions. (GP-6914) +* _Processors_. Corrected interrupt mask size in ARM `mrs` for the `IPSR` system status register. (GP-6931, Issue #9251, #9252) +* _Processors_. Fixed an issue with x86 legacy instructions using a `REX` prefix to read AVX-512 registers. (GP-6937, Issue #9256) +* _Processors_. Added instruction index file for the SuperH processor. (GP-6964, Issue #9278) +* _Processors_. Fixed stack parameter offset for e500mc default calling convention. (GP-6968, Issue #9089) +* _Processors_. Fixed an issue with the M68000 `movem.w` instruction incrementing by 4 instead of 2. (GP-6983, Issue #8824) +* _Processors_. Corrected x86 `rex chg eax, eax` to correctly disassemble to `nop`. (GP-7015, Issue #9327) +* _Processors_. Corrected x86 `vpextrw` to correctly disassemble when `VEX.W=1`. (GP-7016, Issue #9323) +* _Processors_. Corrected x86 `PINSRW`, `VPEXTRB`, and `VPEXTRD` intructions to use the correct masking of immediate byte for masks. (GP-7017, Issue #9328) +* _Processors_. Corrected x86 `MOV` instruction to use 32-bit register operands when moving from segment registers. (GP-7018, Issue #9326) +* _Processors_. Corrected x86 `pslld` instruction to use correct shift count for upper word. (GP-7019, Issue #9329) +* _Processors_. Corrected AARCH64 NEON instructions which did not correctly zero-extend scalar results. (GP-7040, Issue #9277) +* _Processors_. Corrected encoding for ARM `sev.w` instruction. (GP-7065, Issue #9371) +* _Processors_. Corrected MIPS 16e language variants to use the correct `variant` tag in the ldefs file. (GP-7133, Issue #9432) +* _Testing_. Fixed pcodetest framework to correctly honor the `build_exe` config option. (GP-7067, Issue #9374) +* _Tests_. Patched the pcodetest builder to remove the use of `os.system()`. (GP-7007, Issue #9309) + +### Notable API Changes +* _Debugger:Agents_. (GP-6934) `ShellUtils.generateLine` now requires a `Shell` argument, identifying the applicable shell. `ShellUtils.generateArgument` has been replaced by `Shell.generateArgument`. +* _Decompiler_. (GP-6892) Added `Encoder.writeOpcode` method, specifically for opcode ordinals. +* _Importer:ELF_. (GP-7057) Revised `ElfSymbol.isExternal() ` to disregard symbol type, `st_value`, and `st_size`, which were previously being considered. + # Ghidra 12.1.2 Change History (June 2026) ### Improvements diff --git a/Ghidra/Debug/Debugger-isf/src/main/java/ghidra/dbg/isf/IsfServer.java b/Ghidra/Debug/Debugger-isf/src/main/java/ghidra/dbg/isf/IsfServer.java index f60cd30bced..ccf8613a3c9 100644 --- a/Ghidra/Debug/Debugger-isf/src/main/java/ghidra/dbg/isf/IsfServer.java +++ b/Ghidra/Debug/Debugger-isf/src/main/java/ghidra/dbg/isf/IsfServer.java @@ -37,7 +37,6 @@ import ghidra.program.model.data.FileDataTypeManager; import ghidra.program.model.listing.Program; import ghidra.util.Msg; -import ghidra.util.exception.VersionException; import ghidra.util.task.TaskMonitor; public class IsfServer extends Thread { @@ -102,13 +101,13 @@ public DataTypeManager getDataTypeManager(String ns) { try { DataTypeManager dtm; if (ns.endsWith(".gdt")) { - dtm = openAsArchive(ns); + dtm = openAsDataTypeArchive(ns); } else if (ns.endsWith(".gzf")) { - dtm = openAsDatabase(ns); + dtm = openAsProgramDatabase(ns); } else { - dtm = openAsDomainFile(ns); + dtm = openAsProgramFile(ns); } managers.put(ns, dtm); return dtm; @@ -120,43 +119,43 @@ else if (ns.endsWith(".gzf")) { } } - private DataTypeManager openAsDomainFile(String ns) throws Exception { + private DataTypeManager openAsProgramFile(String ns) throws Exception { ProjectData projectData = project.getProjectData(); DomainFile df = projectData.getFile(ns); + if (!Program.class.isAssignableFrom(df.getDomainObjectClass())) { + throw new IOException("File does not correspond to Program content: " + ns); + } + + // FIXME: Need to track and release Program instance after DTM use is complete (GP-6895) Program program = (Program) df.getDomainObject(this, false, false, TaskMonitor.DUMMY); return program.getDataTypeManager(); } - private DataTypeManager openAsArchive(String ns) throws Exception { + private DataTypeManager openAsDataTypeArchive(String ns) throws Exception { File gdt = new File(ns); return FileDataTypeManager.openFileArchive(gdt, false); } - private DataTypeManager openAsDatabase(String ns) throws Exception { + private DataTypeManager openAsProgramDatabase(String ns) throws Exception { File gzf = new File(ns); TaskMonitor dummy = TaskMonitor.DUMMY; PackedDatabase db = PackedDatabase.getPackedDatabase(gzf, dummy); + DBHandle dbh = db.openForUpdate(dummy); - ProgramDB p = null; + + Program p; + boolean success = false; try { - p = new ProgramDB(dbh, OpenMode.UPDATE, dummy, this); - } - catch (VersionException e) { - if (!e.isUpgradable()) { - throw new RuntimeException(p + " uses an older version and is not upgradable."); - } + p = new ProgramDB(dbh, OpenMode.UPGRADE, dummy, this); + success = true; } finally { - dbh.close(); - } - - dbh = db.openForUpdate(dummy); - p = new ProgramDB(dbh, OpenMode.UPGRADE, dummy, this); - - if (!p.isChanged()) { - throw new RuntimeException(p + " uses an older version and was not upgraded."); + if (!success) { + dbh.close(); + } } + // FIXME: Need to track and release Program instance after DTM use is complete (GP-6895) return p.getListing().getDataTypeManager(); } diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArguments.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArguments.java index 64eceb37ae2..964faf7ae78 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArguments.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArguments.java @@ -22,7 +22,7 @@ import com.sun.jdi.connect.Connector; import com.sun.jdi.connect.Connector.Argument; -import ghidra.pty.ShellUtils; +import ghidra.pty.ShellUtils.Shell; public class JdiArguments { enum Mode { @@ -101,7 +101,7 @@ public void putArguments(Map args) { } String cp = env.get("OPT_TARGET_CLASSPATH"); if (!cp.isBlank()) { - args.get("options").setValue("-cp " + ShellUtils.generateArgument(cp)); + args.get("options").setValue("-cp " + Shell.LOCAL.generateArgument(cp)); } } } diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java index d002477d462..4cb6b0da88b 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java +++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java @@ -50,6 +50,7 @@ import ghidra.program.model.listing.Program; import ghidra.program.util.ProgramLocation; import ghidra.pty.*; +import ghidra.pty.ShellUtils.Shell; import ghidra.trace.model.Trace; import ghidra.trace.model.TraceLocation; import ghidra.util.*; @@ -475,7 +476,7 @@ protected PtyTerminalSession runInTerminal(List commandLine, Map withoutPath = ShellUtils.removePath(commandLine); - terminal.setSubTitle(ShellUtils.generateLine(withoutPath)); + terminal.setSubTitle(ShellUtils.generateLine(withoutPath, Shell.DISPLAY)); TerminalListener resizeListener = new TerminalListener() { @Override public void resized(short cols, short rows) { @@ -490,8 +491,19 @@ public void resized(short cols, short rows) { terminal.addTerminalListener(resizeListener); env.put("TERM", "xterm-256color"); - PtySession session = - pty.getChild().session(commandLine.toArray(String[]::new), env, workingDirectory); + PtySession session; + try { + session = + pty.getChild().session(commandLine.toArray(String[]::new), env, workingDirectory); + } + catch (Throwable t) { + terminal.terminated(-1); + pty.close(); + for (TerminalSession ss : subordinates) { + ss.terminate(); + } + throw t; + } Thread waiter = new Thread(() -> { try { @@ -718,6 +730,7 @@ public LaunchResult launchProgram(TaskMonitor monitor, LaunchConfigurator config * terminates early */ monitor.setMessage("Waiting for connection"); + monitor.addCancelledListener(acceptor::cancel); connection = acceptOrSessionEnds(acceptor, backEnd); connection.registerTerminals(sessions.values()); monitor.increment(); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewAsciiExporter.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewAsciiExporter.java deleted file mode 100644 index f31c1ffe8a5..00000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewAsciiExporter.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.export; - -import ghidra.app.util.exporter.AsciiExporter; -import ghidra.framework.model.DomainObject; -import ghidra.trace.model.Trace; - -public class TraceViewAsciiExporter extends AsciiExporter { - @Override - public boolean canExportDomainObject(Class domainObjectClass) { - return Trace.class.isAssignableFrom(domainObjectClass); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewBinaryExporter.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewBinaryExporter.java deleted file mode 100644 index 2949322a91b..00000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewBinaryExporter.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.export; - -import ghidra.app.util.exporter.BinaryExporter; -import ghidra.framework.model.DomainObject; -import ghidra.trace.model.Trace; - -public class TraceViewBinaryExporter extends BinaryExporter { - @Override - public boolean canExportDomainObject(Class domainObjectClass) { - return Trace.class.isAssignableFrom(domainObjectClass); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewHtmlExporter.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewHtmlExporter.java deleted file mode 100644 index b9c581e2c98..00000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewHtmlExporter.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.export; - -import ghidra.app.util.exporter.HtmlExporter; -import ghidra.framework.model.DomainObject; -import ghidra.trace.model.Trace; - -public class TraceViewHtmlExporter extends HtmlExporter { - @Override - public boolean canExportDomainObject(Class domainObjectClass) { - return Trace.class.isAssignableFrom(domainObjectClass); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewIntelHexExporter.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewIntelHexExporter.java deleted file mode 100644 index 96c85d60fd5..00000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewIntelHexExporter.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.export; - -import ghidra.app.util.exporter.IntelHexExporter; -import ghidra.framework.model.DomainObject; -import ghidra.trace.model.Trace; - -public class TraceViewIntelHexExporter extends IntelHexExporter { - @Override - public boolean canExportDomainObject(Class domainObjectClass) { - return Trace.class.isAssignableFrom(domainObjectClass); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewXmlExporter.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewXmlExporter.java deleted file mode 100644 index 46ab514eb6d..00000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/export/TraceViewXmlExporter.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.export; - -import java.util.*; -import java.util.stream.Collectors; - -import ghidra.app.util.*; -import ghidra.app.util.exporter.XmlExporter; -import ghidra.framework.model.DomainObject; -import ghidra.trace.model.Trace; - -// TODO: perhaps getApplicableExporters should use domainObject's class, not file's object class. -// TODO: Where un-supported, be less abrasive, e.g., present empty managers. -public class TraceViewXmlExporter extends XmlExporter { - private final Map hideOpts = Map.of( - "Properties", false, - "Relocation Table", false, - "External Libraries", false); - - @Override - public boolean canExportDomainObject(Class domainObjectClass) { - return Trace.class.isAssignableFrom(domainObjectClass); - } - - @Override - public List