From 41d9b7431e598ff8acd5f7ed26df175bf0889974 Mon Sep 17 00:00:00 2001 From: ghidragon <106987263+ghidragon@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:10:16 -0400 Subject: [PATCH 1/5] GP-6006 Creating a new source type called 'Speculative' which marks symbol names that are less trustworthy than analysis --- .../Browser_Field_Formatter.htm | 2 +- .../DecompilePlugin/DecompilerAnnotations.html | 2 ++ .../program/model/symbol/SourceType.java | 18 +++++++++++------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm b/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm index 1dc739a1da..da45495a28 100644 --- a/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm +++ b/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm @@ -448,7 +448,7 @@ Function Indicates the source-type associated with the - function signature (i.e., DEFAULT, ANALYSIS, IMPORTED, USER_DEFINED). + function signature (i.e., DEFAULT, ANALYSIS, IMPORTED, USER_DEFINED, SPECULATIVE). diff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html index c9475a6a53..3ec9f0f284 100644 --- a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html +++ b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html @@ -1286,6 +1286,8 @@
  • DEFAULT - for basic or no information
  • +SPECULATIVE - for information that is less trustworthy
  • +
  • ANALYSIS - for information derived by an Analyzer
  • IMPORTED - for information imported from an external source
  • diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.java index a6f1cce566..9b92ec5b02 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.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. @@ -20,23 +20,27 @@ public enum SourceType { // database by their ordinal. /** The object's source indicator for an auto analysis. */ - ANALYSIS("Analysis", 2), + ANALYSIS("Analysis", 3), /** The object's source indicator for a user defined. */ - USER_DEFINED("User Defined", 4), + USER_DEFINED("User Defined", 5), /** The object's source indicator for a default. */ DEFAULT("Default", 1), /** The object's source indicator for an imported. */ - IMPORTED("Imported", 3); + IMPORTED("Imported", 4), + /** The object's source indicator for something that is somewhat of an educated guess. */ + SPECULATIVE("Speculative", 2); private final String displayString; - private final int priority; // bigger numbers are higher priorty + private final int priority; // bigger numbers are higher priority private SourceType(String displayString, int priority) { this.displayString = displayString; this.priority = priority; } - /** Returns a user-friendly string */ + /** + * {@return a user-friendly string} + */ public String getDisplayString() { return displayString; } From edea7dfd65cbebc0d6086e805e40da494a7b240c Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Fri, 19 Sep 2025 11:02:20 -0400 Subject: [PATCH 2/5] Revert "GP-6006 Creating a new source type called 'Speculative' which marks symbol names that are less trustworthy than analysis" This reverts commit 41d9b7431e598ff8acd5f7ed26df175bf0889974. --- .../Browser_Field_Formatter.htm | 2 +- .../DecompilePlugin/DecompilerAnnotations.html | 2 -- .../program/model/symbol/SourceType.java | 18 +++++++----------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm b/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm index da45495a28..1dc739a1da 100644 --- a/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm +++ b/Ghidra/Features/Base/src/main/help/help/topics/CodeBrowserPlugin/Browser_Field_Formatter.htm @@ -448,7 +448,7 @@ Function Indicates the source-type associated with the - function signature (i.e., DEFAULT, ANALYSIS, IMPORTED, USER_DEFINED, SPECULATIVE). + function signature (i.e., DEFAULT, ANALYSIS, IMPORTED, USER_DEFINED). diff --git a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html index 3ec9f0f284..c9475a6a53 100644 --- a/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html +++ b/Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerAnnotations.html @@ -1286,8 +1286,6 @@
  • DEFAULT - for basic or no information
  • -SPECULATIVE - for information that is less trustworthy
  • -
  • ANALYSIS - for information derived by an Analyzer
  • IMPORTED - for information imported from an external source
  • diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.java index 9b92ec5b02..a6f1cce566 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SourceType.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. @@ -20,27 +20,23 @@ public enum SourceType { // database by their ordinal. /** The object's source indicator for an auto analysis. */ - ANALYSIS("Analysis", 3), + ANALYSIS("Analysis", 2), /** The object's source indicator for a user defined. */ - USER_DEFINED("User Defined", 5), + USER_DEFINED("User Defined", 4), /** The object's source indicator for a default. */ DEFAULT("Default", 1), /** The object's source indicator for an imported. */ - IMPORTED("Imported", 4), - /** The object's source indicator for something that is somewhat of an educated guess. */ - SPECULATIVE("Speculative", 2); + IMPORTED("Imported", 3); private final String displayString; - private final int priority; // bigger numbers are higher priority + private final int priority; // bigger numbers are higher priorty private SourceType(String displayString, int priority) { this.displayString = displayString; this.priority = priority; } - /** - * {@return a user-friendly string} - */ + /** Returns a user-friendly string */ public String getDisplayString() { return displayString; } From 799226dd3a9b7420d0e003ef84b35393c0d3f927 Mon Sep 17 00:00:00 2001 From: ghizard <50744617+ghizard@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:42:10 -0400 Subject: [PATCH 3/5] GP-6010 - PDB - Fixed issue where function args list was NOTYPE --- .../util/pdb/pdbapplicator/AbstractFunctionTypeApplier.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/AbstractFunctionTypeApplier.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/AbstractFunctionTypeApplier.java index 7ec1ca357d..bc5d7336a7 100644 --- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/AbstractFunctionTypeApplier.java +++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/AbstractFunctionTypeApplier.java @@ -287,6 +287,9 @@ public abstract class AbstractFunctionTypeApplier extends MsDataTypeApplier { RecordNumber argsRecord = getArgListRecordNumber(type); AbstractMsType aType = applicator.getTypeRecord(argsRecord); if (!(aType instanceof AbstractArgumentsListMsType argsList)) { + if (aType instanceof PrimitiveMsType pt && pt.isNoType()) { + return new ArrayList<>(); + } throw new PdbException( "Expecting arguments list but got: " + aType.getClass().getSimpleName()); } From 29ba2ca46db4f150747b6429551186b5d3c18a5f Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Mon, 22 Sep 2025 05:49:16 -0400 Subject: [PATCH 4/5] GP-0: Upping Gradle Wrapper to 9.1.0 --- .../Common/support/gradle/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/RuntimeScripts/Common/support/gradle/gradle-wrapper.properties b/Ghidra/RuntimeScripts/Common/support/gradle/gradle-wrapper.properties index 2a84e188b8..2e1113280e 100644 --- a/Ghidra/RuntimeScripts/Common/support/gradle/gradle-wrapper.properties +++ b/Ghidra/RuntimeScripts/Common/support/gradle/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 1f0bd4a9e22f4b5bbbce62577edebb0ba3644259 Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Mon, 22 Sep 2025 09:21:15 -0400 Subject: [PATCH 5/5] GP-0: Fixing Mach-O stub processing on blank symbols (Closes #8513) --- .../java/ghidra/app/util/opinion/MachoProgramBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java index d0fcd49cf7..02cfe326b7 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java @@ -685,11 +685,11 @@ public class MachoProgramBuilder { int symbolIndex = indirectSymbols.get(i); NList symbol = symbolTableCommand.getSymbolAt(symbolIndex); String name = null; - if (symbol != null) { + if (symbol != null && !symbol.getString().isBlank()) { name = SymbolUtilities.replaceInvalidChars(symbol.getString(), true); } Function stubFunc = createOneByteFunction(program, name, startAddr); - if (stubFunc != null && symbol != null) { + if (stubFunc != null && name != null) { ExternalLocation loc = program.getExternalManager() .addExtLocation(Library.UNKNOWN, name, null, SourceType.IMPORTED); stubFunc.setThunkedFunction(loc.createFunction());