mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-02 05:57:56 +08:00
GP-5329 fixed bug in LocalBsimQueryScript
This commit is contained in:
@@ -57,6 +57,10 @@ public class LocalBSimQueryScript extends GhidraScript {
|
|||||||
popup("This script cannot be run headlessly.");
|
popup("This script cannot be run headlessly.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (currentProgram == null) {
|
||||||
|
popup("This script requires a program to be open in the tool");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Set<Function> sourceFuncs = new HashSet<>();
|
Set<Function> sourceFuncs = new HashSet<>();
|
||||||
if (currentSelection == null) {
|
if (currentSelection == null) {
|
||||||
@@ -341,7 +345,6 @@ public class LocalBSimQueryScript extends GhidraScript {
|
|||||||
class CompareMatchesExecutor implements TableChooserExecutor {
|
class CompareMatchesExecutor implements TableChooserExecutor {
|
||||||
|
|
||||||
private FunctionComparisonService compareService;
|
private FunctionComparisonService compareService;
|
||||||
private MatchedFunctionComparisonModel model;
|
|
||||||
|
|
||||||
public CompareMatchesExecutor() {
|
public CompareMatchesExecutor() {
|
||||||
compareService = state.getTool().getService(FunctionComparisonService.class);
|
compareService = state.getTool().getService(FunctionComparisonService.class);
|
||||||
@@ -355,11 +358,7 @@ public class LocalBSimQueryScript extends GhidraScript {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(AddressableRowObject rowObject) {
|
public boolean execute(AddressableRowObject rowObject) {
|
||||||
LocalBSimMatch match = (LocalBSimMatch) rowObject;
|
LocalBSimMatch match = (LocalBSimMatch) rowObject;
|
||||||
if (model == null) {
|
compareService.createComparison(match.getSourceFunc(), match.getTargetFunc());
|
||||||
model = new MatchedFunctionComparisonModel();
|
|
||||||
compareService.createCustomComparison(model, null);
|
|
||||||
}
|
|
||||||
model.addMatch(match.getSourceFunc(), match.getTargetFunc());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user