Package ghidra.app.decompiler.flatapi
Class FlatDecompilerAPI
- java.lang.Object
-
- ghidra.app.decompiler.flatapi.FlatDecompilerAPI
-
- All Implemented Interfaces:
Disposable
public class FlatDecompilerAPI extends java.lang.Object implements Disposable
-
-
Field Summary
Fields Modifier and Type Field Description protected DecompInterfacedecompilerprotected FlatProgramAPIflatProgramAPI
-
Constructor Summary
Constructors Constructor Description FlatDecompilerAPI()Initializes without a provided FlatProgramAPI instance...this must be set before using the FlatDecompilerAPI!FlatDecompilerAPI(FlatProgramAPI flatProgramAPI)Initializes with a provided FlatProgramAPI instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringdecompile(Function function)Decompiles the specified function and returns a string containing the decompilation.java.lang.Stringdecompile(Function function, int timeoutSecs)Decompiles the specified function and returns a string containing the decompilation.voiddispose()Disposes of the decompiler resources by calling currentDecompiler.dispose().DecompInterfacegetDecompiler()Gets the actual decompiler (may be null if not initialized).voidinitialize()Initializes the decompiler instance.
-
-
-
Field Detail
-
flatProgramAPI
protected FlatProgramAPI flatProgramAPI
-
decompiler
protected DecompInterface decompiler
-
-
Constructor Detail
-
FlatDecompilerAPI
public FlatDecompilerAPI()
Initializes without a provided FlatProgramAPI instance...this must be set before using the FlatDecompilerAPI!
-
FlatDecompilerAPI
public FlatDecompilerAPI(FlatProgramAPI flatProgramAPI)
Initializes with a provided FlatProgramAPI instance.- Parameters:
flatProgramAPI- the FlatProgramAPI instance.
-
-
Method Detail
-
getDecompiler
public DecompInterface getDecompiler()
Gets the actual decompiler (may be null if not initialized).- Returns:
- the decompiler
-
decompile
public final java.lang.String decompile(Function function) throws java.lang.Exception
Decompiles the specified function and returns a string containing the decompilation. This call does not impose a timeout.- Parameters:
function- the function to decompile- Returns:
- a string containing the decompilation
- Throws:
java.lang.Exception
-
decompile
public final java.lang.String decompile(Function function, int timeoutSecs) throws java.lang.Exception
Decompiles the specified function and returns a string containing the decompilation.- Parameters:
function- the function to decompiletimeoutSecs- maximum time allowed for decompile to complete.- Returns:
- a string containing the decompilation
- Throws:
java.lang.Exception
-
initialize
public final void initialize() throws java.lang.ExceptionInitializes the decompiler instance.- Throws:
java.lang.Exception
-
dispose
public void dispose()
Disposes of the decompiler resources by calling currentDecompiler.dispose().- Specified by:
disposein interfaceDisposable
-
-