mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-10 06:02:09 +00:00
Merge remote-tracking branch 'origin/Ghidra_11.2'
This commit is contained in:
commit
2d8c0fbdd8
@ -810,12 +810,14 @@ public class TraceRmiTarget extends AbstractTarget {
|
||||
|
||||
public MatchedMethod getBest(String name, ActionName action,
|
||||
Supplier<List<? extends MethodMatcher>> preferredSupplier) {
|
||||
return map.computeIfAbsent(name, n -> chooseBest(action, preferredSupplier.get()));
|
||||
return getBest(name, action, preferredSupplier.get());
|
||||
}
|
||||
|
||||
public MatchedMethod getBest(String name, ActionName action,
|
||||
List<? extends MethodMatcher> preferred) {
|
||||
return map.computeIfAbsent(name, n -> chooseBest(action, preferred));
|
||||
synchronized (map) {
|
||||
return map.computeIfAbsent(name, n -> chooseBest(action, preferred));
|
||||
}
|
||||
}
|
||||
|
||||
private MatchedMethod chooseBest(ActionName name, List<? extends MethodMatcher> preferred) {
|
||||
|
@ -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