mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-5 Fixed WindowsResource Analyzer wasting time decompiling functions
that have previously failed to decompile due to timeout
This commit is contained in:
parent
f82dc0c466
commit
b02101298f
1 changed files with 12 additions and 3 deletions
|
@ -36,8 +36,7 @@ import ghidra.app.script.GhidraScript;
|
|||
import ghidra.framework.options.ToolOptions;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.OptionsService;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressSetView;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.pcode.*;
|
||||
import ghidra.program.model.symbol.*;
|
||||
|
@ -57,6 +56,9 @@ public class WindowsResourceReference extends GhidraScript {
|
|||
|
||||
protected AddressSetPropertyMap alreadyDoneAddressSetPropertyMap;
|
||||
|
||||
// set of functions that decompilation failed on
|
||||
protected AddressSet badDecompFunctions = new AddressSet();
|
||||
|
||||
public AddressSetPropertyMap getOrCreatePropertyMap(Program program, String mapName) {
|
||||
if (alreadyDoneAddressSetPropertyMap != null) {
|
||||
return alreadyDoneAddressSetPropertyMap;
|
||||
|
@ -368,6 +370,11 @@ public class WindowsResourceReference extends GhidraScript {
|
|||
return;
|
||||
}
|
||||
|
||||
// check if decompilation of this function failed previously
|
||||
if (badDecompFunctions.contains(f.getEntryPoint())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Instruction instr = prog.getListing().getInstructionAt(refAddr);
|
||||
if (instr == null) {
|
||||
return;
|
||||
|
@ -376,7 +383,9 @@ public class WindowsResourceReference extends GhidraScript {
|
|||
decompileFunction(f, decompiler);
|
||||
|
||||
if (hfunction == null) {
|
||||
return; // failed to decompile
|
||||
// failed to decompile, add to bad list
|
||||
badDecompFunctions.add(f.getEntryPoint());
|
||||
return;
|
||||
}
|
||||
|
||||
Iterator<PcodeOpAST> ops = hfunction.getPcodeOps(refAddr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue