Package cppclassanalyzer.decompiler
Class DecompilerAPI
java.lang.Object
cppclassanalyzer.decompiler.DecompilerAPI
- All Implemented Interfaces:
Disposable
,AutoCloseable
public final class DecompilerAPI extends Object implements Disposable, AutoCloseable
A Decompiler API with more to offer than the
FlatDecompilerAPI
-
Constructor Summary
Constructors Constructor Description DecompilerAPI(PluginTool tool)
Constructs a new DecompilerAPIDecompilerAPI(Program program)
Constructs a new DecompilerAPIDecompilerAPI(Program program, TaskMonitor monitor, int timeout)
Constructs a new DecompilerAPI -
Method Summary
Modifier and Type Method Description void
clearCache()
Flushes the decompiler cachevoid
close()
DecompileResults
decompileFunction(Function function)
Decompiles the provided functionvoid
dispose()
Map<Function,DecompileResults>
getCache()
Gets a thread safe and unmodifiable view of the decompiler cachecom.google.common.cache.CacheStats
getCacheStats()
Gets the decompiler cache statsList<ClangStatement>
getClangStatements(Function function)
Gets all theClangStatement
s in the decompiled functionDecompInterface
getDecompiler()
Gets the decompilerFunction
getFunction(ClangFuncNameToken token)
A convience method to get the corresponding Function for a function nameList<HighFunctionCall>
getFunctionCalls(Function function)
Gets a list of all the functions the decompiled function callsHighFunction
getHighFunction(Function function)
Gets the HighFunction for the decompiled functionProgram
getProgram()
Get the current program opened in the decompilerint
getTimeout()
Gets the decompiler timeoutPluginTool
getTool()
Gets the toolvoid
setMonitor(TaskMonitor monitor)
Sets the task monitor to usevoid
setProgram(Program program)
Sets the program for the decompiler to usevoid
setTimeout(int timeout)
Sets the decompiler timeout
-
Constructor Details
-
DecompilerAPI
Constructs a new DecompilerAPI- Parameters:
tool
- the current tool
-
DecompilerAPI
Constructs a new DecompilerAPI- Parameters:
program
- the current program
-
DecompilerAPI
Constructs a new DecompilerAPI- Parameters:
program
- the current programmonitor
- the monitor to use for the decompilertimeout
- the timeout to use for the decompiler or < 0 to use the default timeout provided by user settings.
-
-
Method Details
-
dispose
public void dispose()- Specified by:
dispose
in interfaceDisposable
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getProgram
Get the current program opened in the decompiler- Returns:
- the decompiler's opened program
-
setProgram
Sets the program for the decompiler to use- Parameters:
program
- to program to open in the decompiler
-
getTool
Gets the tool- Returns:
- the tool
-
getDecompiler
Gets the decompiler- Returns:
- the decompiler
-
getTimeout
public int getTimeout()Gets the decompiler timeout- Returns:
- the decompiler timeout
-
setTimeout
public void setTimeout(int timeout)Sets the decompiler timeout- Parameters:
timeout
- the timeout
-
setMonitor
Sets the task monitor to use- Parameters:
monitor
- the task monitor
-
getCache
Gets a thread safe and unmodifiable view of the decompiler cache- Returns:
- a map of the decompiler cache
-
clearCache
public void clearCache()Flushes the decompiler cache -
decompileFunction
Decompiles the provided function- Parameters:
function
- the function to decompile- Returns:
- the decompiled function
- Throws:
CancelledException
- if the decompilation is cancelled
-
getClangStatements
Gets all theClangStatement
s in the decompiled function- Parameters:
function
- the function to decompile- Returns:
- a list of all the functions statements
- Throws:
CancelledException
- if the decompilation is cancelled
-
getHighFunction
Gets the HighFunction for the decompiled function- Parameters:
function
- the function to decompile- Returns:
- the functions HighFunction
- Throws:
CancelledException
- if the decompilation is cancelled
-
getFunctionCalls
Gets a list of all the functions the decompiled function calls- Parameters:
function
- the function to decompile- Returns:
- a list of function calls
- Throws:
CancelledException
- if the decompilation is cancelled
-
getFunction
A convience method to get the corresponding Function for a function name- Parameters:
token
- the function name- Returns:
- the function
-
getCacheStats
public com.google.common.cache.CacheStats getCacheStats()Gets the decompiler cache stats- Returns:
- the decompiler cache stats
-