GP-6041 bsim h2 database script improvements

This commit is contained in:
James
2026-03-18 13:51:03 -04:00
parent 210be332cd
commit 09a58af68d
4 changed files with 30 additions and 12 deletions

View File

@@ -57,7 +57,7 @@ public class AddProgramToH2BSimDatabaseScript extends GhidraScript {
if (currentProgram.isChanged()) {
popup(currentProgram.getName() + " has unsaved changes. Please save the program" +
" before adding it to a BSim database.");
" before adding it to a BSim database.");
return;
}
@@ -90,6 +90,16 @@ public class AddProgramToH2BSimDatabaseScript extends GhidraScript {
h2Database.initialize();
DatabaseInformation dbInfo = h2Database.getInfo();
// check whether the executable is already in the database
// before generating signatures
QueryExeInfo exeInfo = new QueryExeInfo();
exeInfo.filterMd5 = currentProgram.getExecutableMD5();
ResponseExe response = exeInfo.execute(h2Database);
if (response.recordCount > 0) {
popup(currentProgram.getName() + " is already in the database.");
return;
}
LSHVectorFactory vectorFactory = h2Database.getLSHVectorFactory();
GenSignatures gensig = null;
try {