mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-24 21:21:56 +00:00
Merge remote-tracking branch
'origin/GP-4865_ghidra007_PR-6833_epinter_nsa-fixrttiloop' into Ghidra_11.2 (Closes #6832, Closes #6833)
This commit is contained in:
commit
b4d7747853
@ -404,12 +404,15 @@ public class RecoveredClassHelper {
|
||||
* @param function the given function
|
||||
* @param getThunkedFunction if true, use the thunked function in the map, if false use the
|
||||
* directly called function from the calling function even if it is a thunk
|
||||
* @param visited the set of function entry point addresses already processed
|
||||
* @return a map of the given functions calling addresses to the called functions
|
||||
* @throws CancelledException if cancelled
|
||||
*/
|
||||
public Map<Address, Function> getFunctionCallMap(Function function, boolean getThunkedFunction)
|
||||
public Map<Address, Function> getFunctionCallMap(Function function, boolean getThunkedFunction,
|
||||
Set<Address> visited)
|
||||
throws CancelledException {
|
||||
|
||||
visited.add(function.getEntryPoint());
|
||||
Map<Address, Function> functionCallMap = new HashMap<Address, Function>();
|
||||
|
||||
InstructionIterator instructions =
|
||||
@ -435,9 +438,10 @@ public class RecoveredClassHelper {
|
||||
Address functionAddress = reference.getFromAddress();
|
||||
Function secondHalfOfFunction =
|
||||
extendedFlatAPI.getReferencedFunction(functionAddress);
|
||||
if (secondHalfOfFunction != null) {
|
||||
if (secondHalfOfFunction != null &&
|
||||
!visited.contains(secondHalfOfFunction.getEntryPoint())) {
|
||||
Map<Address, Function> functionCallMap2 =
|
||||
getFunctionCallMap(secondHalfOfFunction, false);
|
||||
getFunctionCallMap(secondHalfOfFunction, false, visited);
|
||||
for (Address addr : functionCallMap2.keySet()) {
|
||||
monitor.checkCancelled();
|
||||
functionCallMap.put(addr, functionCallMap2.get(addr));
|
||||
@ -449,6 +453,11 @@ public class RecoveredClassHelper {
|
||||
return functionCallMap;
|
||||
}
|
||||
|
||||
public Map<Address, Function> getFunctionCallMap(Function function, boolean getThunkedFunction)
|
||||
throws CancelledException {
|
||||
return getFunctionCallMap(function, getThunkedFunction, new HashSet<>());
|
||||
}
|
||||
|
||||
public void updateNamespaceToClassMap(Namespace namespace, RecoveredClass recoveredClass) {
|
||||
namespaceToClassMap.put(namespace, recoveredClass);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user