GP-3697 Added delayed ProjectFileManager disposal in support of URL use

and opening linked project files and renamed ProjectFileData to
DefaultProjectData.
This commit is contained in:
ghidra1
2023-08-11 12:49:19 -04:00
parent 5ef4b269a1
commit 3eb642885c
51 changed files with 1636 additions and 813 deletions
@@ -75,7 +75,16 @@ public class AskScript extends GhidraScript {
}
Program prog = askProgram("Please choose a program to open.");
println("Program picked: " + prog.getName());
if (prog != null) {
// NOTE: if prog is not null script must release it when done using.
// This may also be accomplished via an overridden cleanup(boolean) method.
try {
println("Program picked: " + prog.getName());
}
finally {
prog.release(this); // will remain open in tool if applicable
}
}
DomainFile domFile = askDomainFile("Which domain file would you like?");
println("Domain file: " + domFile.getName());
@@ -38,19 +38,24 @@ public class CompareAnalysisScript extends GhidraScript {
if (otherProgram == null) {
return;
}
println("\n\n****** COMPARING FUNCTIONS:\n");
compareFunctions(otherProgram);
println("\n\n****** COMPARING STRINGS:\n");
compareStrings(otherProgram);
println("\n\n****** PERCENT ANALYZED COMPARE SUMMARY:\n");
reportPercentDisassembled(currentProgram);
reportPercentDisassembled(otherProgram);
println("\n\n****** COMPARING SWITCH TABLES:\n");
compareSwitchTables(otherProgram);
println("\n\n****** COMPARING NON-RETURNING FUNCTIONS:\n");
compareNoReturns(otherProgram);
println("\n\n****** COMPARING ERRORS:\n");
compareErrors(otherProgram);
try {
println("\n\n****** COMPARING FUNCTIONS:\n");
compareFunctions(otherProgram);
println("\n\n****** COMPARING STRINGS:\n");
compareStrings(otherProgram);
println("\n\n****** PERCENT ANALYZED COMPARE SUMMARY:\n");
reportPercentDisassembled(currentProgram);
reportPercentDisassembled(otherProgram);
println("\n\n****** COMPARING SWITCH TABLES:\n");
compareSwitchTables(otherProgram);
println("\n\n****** COMPARING NON-RETURNING FUNCTIONS:\n");
compareNoReturns(otherProgram);
println("\n\n****** COMPARING ERRORS:\n");
compareErrors(otherProgram);
}
finally {
otherProgram.release(this);
}
}
void compareFunctions(Program otherProgram) {