Class FlatDecompilerAPI

java.lang.Object
ghidra.app.decompiler.flatapi.FlatDecompilerAPI
All Implemented Interfaces:
Disposable

public class FlatDecompilerAPI extends Object implements Disposable
  • Field Details

  • Constructor Details

    • 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 Details

    • getDecompiler

      public DecompInterface getDecompiler()
      Gets the actual decompiler (may be null if not initialized).
      Returns:
      the decompiler
    • decompile

      public final String decompile(Function function) throws 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:
      Exception
    • decompile

      public final String decompile(Function function, int timeoutSecs) throws Exception
      Decompiles the specified function and returns a string containing the decompilation.
      Parameters:
      function - the function to decompile
      timeoutSecs - maximum time allowed for decompile to complete.
      Returns:
      a string containing the decompilation
      Throws:
      Exception
    • initialize

      public final void initialize() throws Exception
      Initializes the decompiler instance.
      Throws:
      Exception
    • dispose

      public void dispose()
      Disposes of the decompiler resources by calling currentDecompiler.dispose().
      Specified by:
      dispose in interface Disposable