Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-0 fix for breaking RTTI test

ghidra0078fb1c8ce0528
diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java
index 31e5776379..ab818f4ac1 100644
--- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java
+++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java
@@ -236,9 +236,9 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer {
// }
//
// private void runRTTIAnalyzer() throws Exception {
-//// Analyzer analyzer = new RttiAnalyzer();
-//// analyzer.added(program, program.getAddressFactory().getAddressSet(), monitor,
-//// new MessageLog());
+ //// Analyzer analyzer = new RttiAnalyzer(); / analyzer.added(program,
+ /// program.getAddressFactory().getAddressSet(), monitor, /
+ /// new MessageLog());
// }
//
// /**
diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java
index 80f25922cc..aebe32d811 100644
--- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java
+++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java
@@ -5698,7 +5698,26 @@ public class RecoveredClassHelper {
if (!areVftablesInSameClass(vftableReferenceList)) {
recoveredClass.addIndeterminateInline(indeterminateFunction);
indeterminateIterator.remove();
+ continue;
+ }
+ }
+ // Next try identifying non-constructor/destructor but contains inline
+ // using decompiler return type
+ DataType decompilerReturnType =
+ decompilerUtils.getDecompilerReturnType(indeterminateFunction);
+
+ if (decompilerReturnType != null) {
+
+ String returnDataName = decompilerReturnType.getDisplayName();
+ if (returnDataName.contains("*") &&
+ !isFidFunction(indeterminateFunction)) {
+ continue;
}
+ if (returnDataName.equals("void")) {
+ continue;
+ }
+ recoveredClass.addIndeterminateInline(indeterminateFunction);
+ indeterminateIterator.remove();
}
}
}
@@ -6293,7 +6312,7 @@ public class RecoveredClassHelper {
// otherwise, use pcode info to figure out if inlined constructor or destructor
//If not already, make function a this call
- makeFunctionThiscall(inlineFunction);
+ // makeFunctionThiscall(inlineFunction);
List<OffsetPcodeOpPair> loads = getLoadPcodeOpPairs(inlineFunction);
List<OffsetPcodeOpPair> stores = getStorePcodeOpPairs(inlineFunction);