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 voidclearCache()Flushes the decompiler cachevoidclose()DecompileResultsdecompileFunction(Function function)Decompiles the provided functionvoiddispose()Map<Function,DecompileResults>getCache()Gets a thread safe and unmodifiable view of the decompiler cachecom.google.common.cache.CacheStatsgetCacheStats()Gets the decompiler cache statsList<ClangStatement>getClangStatements(Function function)Gets all theClangStatements in the decompiled functionDecompInterfacegetDecompiler()Gets the decompilerFunctiongetFunction(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 callsHighFunctiongetHighFunction(Function function)Gets the HighFunction for the decompiled functionProgramgetProgram()Get the current program opened in the decompilerintgetTimeout()Gets the decompiler timeoutPluginToolgetTool()Gets the toolvoidsetMonitor(TaskMonitor monitor)Sets the task monitor to usevoidsetProgram(Program program)Sets the program for the decompiler to usevoidsetTimeout(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:
disposein interfaceDisposable
-
close
public void close()- Specified by:
closein 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 theClangStatements 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
-