mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
Merge remote-tracking branch
'origin/GP-5562_James_bsim_h2_script_improvements' (Closes #7897)
This commit is contained in:
commit
1ef5566219
1 changed files with 11 additions and 1 deletions
|
@ -25,7 +25,6 @@ import generic.lsh.vector.LSHVectorFactory;
|
|||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.features.base.values.GhidraValuesMap;
|
||||
import ghidra.features.bsim.query.*;
|
||||
import ghidra.features.bsim.query.BSimServerInfo.DBType;
|
||||
import ghidra.features.bsim.query.FunctionDatabase.BSimError;
|
||||
import ghidra.features.bsim.query.FunctionDatabase.ErrorCategory;
|
||||
import ghidra.features.bsim.query.description.DatabaseInformation;
|
||||
|
@ -56,6 +55,12 @@ public class AddProgramToH2BSimDatabaseScript extends GhidraScript {
|
|||
return;
|
||||
}
|
||||
|
||||
if (currentProgram.isChanged()) {
|
||||
popup(currentProgram.getName() + " has unsaved changes. Please save the program" +
|
||||
" before adding it to a BSim database.");
|
||||
return;
|
||||
}
|
||||
|
||||
GhidraValuesMap values = new GhidraValuesMap();
|
||||
values.defineFile(DATABASE, null, new File(System.getProperty("user.home")));
|
||||
values.setValidator((valueMap, status) -> {
|
||||
|
@ -118,6 +123,11 @@ public class AddProgramToH2BSimDatabaseScript extends GhidraScript {
|
|||
final Iterator<Function> iter = fman.getFunctions(true);
|
||||
gensig.scanFunctions(iter, fman.getFunctionCount(), monitor);
|
||||
final DescriptionManager manager = gensig.getDescriptionManager();
|
||||
if (manager.numFunctions() == 0) {
|
||||
Msg.showWarn(this, null, "Skipping Insert",
|
||||
currentProgram.getName() + " contains no functions with bodies");
|
||||
return;
|
||||
}
|
||||
|
||||
//need to call sortCallGraph on each FunctionDescription
|
||||
//this de-dupes the list of callees for each function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue