mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-10-22 21:21:02 +00:00
GP-4592 Find references to structure fields in local variables and in
functions that call externals that might use the structure field
This commit is contained in:
parent
15b929fa73
commit
dea69c7027
|
@ -129,6 +129,20 @@ public class DecompilerDataTypeReferenceFinder implements DataTypeReferenceFinde
|
|||
callers.addAll(callingFunctions);
|
||||
}
|
||||
|
||||
results.addAll(callers);
|
||||
|
||||
// Add any callers to external function that use any form of the data type
|
||||
it = listing.getExternalFunctions();
|
||||
callers = new HashSet<>();
|
||||
for (Function f : it) {
|
||||
monitor.checkCancelled();
|
||||
|
||||
if (usesAnyType(f, types)) {
|
||||
Set<Function> callingFunctions = f.getCallingFunctions(monitor);
|
||||
callers.addAll(callingFunctions);
|
||||
}
|
||||
}
|
||||
|
||||
results.addAll(callers);
|
||||
|
||||
return results;
|
||||
|
|
|
@ -188,11 +188,11 @@ public class VariableAccessDR extends DecompilerReference {
|
|||
// the thing that contains it. So, if you have:
|
||||
// foo.bar
|
||||
// then the 'bar' field will have a data type of Foo. Unfortunately, this is not always
|
||||
// the case. For now, when the variable is global, we need to check the field. Sad face
|
||||
// the case. For now, if there is a high variable, we need to check the field. Sad face
|
||||
// emoji.
|
||||
//
|
||||
HighVariable highVariable = var.variable.getHighVariable();
|
||||
if (highVariable instanceof HighGlobal) {
|
||||
if (highVariable != null) {
|
||||
if (matchesParentType(potentialField, dt)) {
|
||||
DtrfDbg.println(this, indent + "MATCHED on parent type: " + dt);
|
||||
return potentialField;
|
||||
|
|
Loading…
Reference in New Issue
Block a user