Merge remote-tracking branch 'origin/GP-3868_ghidra007_RTTIscript_FixExtFuncAddressLabelError' into Ghidra_10.4

This commit is contained in:
Ryan Kurtz 2023-09-22 14:04:58 -04:00
commit 6cd4fd80f7

View File

@ -3466,6 +3466,11 @@ public class RecoveredClassHelper {
monitor.checkCancelled();
Function constructorFunction = constructorsIterator.next();
// cannot edit external functions
if (constructorFunction.isExternal()) {
continue;
}
if (nameVfunctions) {
createNewSymbolAtFunction(constructorFunction, className, classNamespace, true,
true);
@ -3552,6 +3557,11 @@ public class RecoveredClassHelper {
while (destructorIterator.hasNext()) {
monitor.checkCancelled();
Function destructorFunction = destructorIterator.next();
// cannot edit external functions
if (destructorFunction.isExternal()) {
continue;
}
String destructorName = "~" + className;
if (nameVfunctions) {
@ -3579,6 +3589,11 @@ public class RecoveredClassHelper {
while (destructorIterator.hasNext()) {
monitor.checkCancelled();
Function destructorFunction = destructorIterator.next();
// cannot edit external functions
if (destructorFunction.isExternal()) {
continue;
}
String destructorName = "~" + className;
createNewSymbolAtFunction(destructorFunction, destructorName, classNamespace, false,
@ -3598,7 +3613,9 @@ public class RecoveredClassHelper {
Namespace classNamespace = recoveredClass.getClassNamespace();
Function vbaseDestructorFunction = recoveredClass.getVBaseDestructor();
if (vbaseDestructorFunction != null) {
// only edit non-external functions
if (vbaseDestructorFunction != null && !vbaseDestructorFunction.isExternal()) {
String destructorName = VBASE_DESTRUCTOR_LABEL;
if (nameVfunctions) {
@ -3730,6 +3747,10 @@ public class RecoveredClassHelper {
boolean setPrimary, boolean removeBadFID) throws DuplicateNameException,
InvalidInputException, CircularDependencyException, CancelledException {
// skip if external function
if (function.isExternal()) {
return;
}
// check for bad FID or FID that needs fix up and remove those bad symbols
if (removeBadFID) {
removeBadFIDSymbols(namespace, name, function);
@ -5196,6 +5217,11 @@ public class RecoveredClassHelper {
monitor.checkCancelled();
Function indeterminateFunction = unknownsIterator.next();
// cannot edit external functions
if (indeterminateFunction.isExternal()) {
continue;
}
if (nameVfunctions) {
createNewSymbolAtFunction(indeterminateFunction,
className + "_Constructor_or_Destructor", classNamespace, false, false);