mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-08-28 13:30:21 +00:00
GP-2648 Improve demangler analysis after LoadPdbTask.
This commit is contained in:
parent
f7bb9e9e43
commit
076bc74a35
|
@ -84,7 +84,7 @@ class LoadPdbTask extends Task {
|
||||||
else if (!parseWithNewParser(log, wrappedMonitor)) {
|
else if (!parseWithNewParser(log, wrappedMonitor)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
analyzeSymbols(currentMonitor, log);
|
scheduleAdditionalAnalysis();
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
log.appendMsg("PDB IO Error: " + e.getMessage());
|
log.appendMsg("PDB IO Error: " + e.getMessage());
|
||||||
|
@ -94,8 +94,8 @@ class LoadPdbTask extends Task {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
AutoAnalysisManager.getAnalysisManager(program).scheduleWorker(worker, null, true,
|
AutoAnalysisManager.getAnalysisManager(program)
|
||||||
wrappedMonitor);
|
.scheduleWorker(worker, null, true, wrappedMonitor);
|
||||||
}
|
}
|
||||||
catch (InterruptedException | CancelledException e) {
|
catch (InterruptedException | CancelledException e) {
|
||||||
// ignore
|
// ignore
|
||||||
|
@ -158,27 +158,30 @@ class LoadPdbTask extends Task {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void analyzeSymbols(TaskMonitor monitor, MessageLog log) {
|
private void scheduleAdditionalAnalysis() {
|
||||||
|
|
||||||
|
AddressSetView addrs = program.getMemory();
|
||||||
|
AutoAnalysisManager manager = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
|
Options analysisProperties = program.getOptions(Program.ANALYSIS_PROPERTIES);
|
||||||
|
|
||||||
|
//other planned analysis here.
|
||||||
|
|
||||||
|
scheduleDemangler(manager, analysisProperties, addrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DemanglerAnalyzer is a byte analyzer (like getting import symbols), so it won't get
|
||||||
|
// kicked off by our laying down symbols.
|
||||||
|
private void scheduleDemangler(AutoAnalysisManager manager, Options analysisProperties,
|
||||||
|
AddressSetView addrs) {
|
||||||
MicrosoftDemanglerAnalyzer demanglerAnalyzer = new MicrosoftDemanglerAnalyzer();
|
MicrosoftDemanglerAnalyzer demanglerAnalyzer = new MicrosoftDemanglerAnalyzer();
|
||||||
String analyzerName = demanglerAnalyzer.getName();
|
String analyzerName = demanglerAnalyzer.getName();
|
||||||
|
|
||||||
Options analysisProperties = program.getOptions(Program.ANALYSIS_PROPERTIES);
|
|
||||||
String defaultValueAsString = analysisProperties.getValueAsString(analyzerName);
|
String defaultValueAsString = analysisProperties.getValueAsString(analyzerName);
|
||||||
boolean doDemangle = true;
|
|
||||||
if (defaultValueAsString != null) {
|
|
||||||
doDemangle = Boolean.parseBoolean(defaultValueAsString);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doDemangle) {
|
// Do not demangle if the demangler analyzer is turned off
|
||||||
AddressSetView addrs = program.getMemory();
|
if (!Boolean.parseBoolean(defaultValueAsString)) {
|
||||||
monitor.initialize(addrs.getNumAddresses());
|
return;
|
||||||
try {
|
|
||||||
demanglerAnalyzer.added(program, addrs, monitor, log);
|
|
||||||
}
|
|
||||||
catch (CancelledException e) {
|
|
||||||
// ignore cancel
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
manager.scheduleOneTimeAnalysis(demanglerAnalyzer, addrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue