Class DecompileOptions

java.lang.Object
ghidra.app.decompiler.DecompileOptions

public class DecompileOptions extends Object
Configuration options for the decompiler This stores the options and can create an XML string to be sent to the decompiler process
  • Field Details

    • SUGGESTED_DECOMPILE_TIMEOUT_SECS

      public static final int SUGGESTED_DECOMPILE_TIMEOUT_SECS
      See Also:
    • SUGGESTED_MAX_PAYLOAD_BYTES

      public static final int SUGGESTED_MAX_PAYLOAD_BYTES
      See Also:
    • SUGGESTED_MAX_INSTRUCTIONS

      public static final int SUGGESTED_MAX_INSTRUCTIONS
      See Also:
  • Constructor Details

    • DecompileOptions

      public DecompileOptions()
  • Method Details

    • grabFromToolAndProgram

      public void grabFromToolAndProgram(Plugin ownerPlugin, ToolOptions opt, Program program)
      Grab all the decompiler options from various sources within a specific tool and program and cache them in this object.
      Parameters:
      ownerPlugin - the plugin that owns the "tool options" for the decompiler
      opt - the Options object that contains the "tool options" specific to the decompiler
      program - the program whose "program options" are relevant to the decompiler
    • grabFromProgram

      public void grabFromProgram(Program program)
      Grab all the decompiler options from the program specifically and cache them in this object.
      Parameters:
      program - the program whose "program options" are relevant to the decompiler
    • getProtoEvalModel

      public String getProtoEvalModel()
    • setProtoEvalModel

      public void setProtoEvalModel(String protoEvalModel)
    • registerOptions

      public void registerOptions(Plugin ownerPlugin, ToolOptions opt, Program program)
      This registers all the decompiler tool options with ghidra, and has the side effect of pulling all the current values for the options if they exist
      Parameters:
      ownerPlugin - the plugin to which the options should be registered
      opt - the options object to register with
      program - the program
    • encode

      public void encode(Encoder encoder, DecompInterface iface) throws IOException
      Encode all the configuration options to a stream for the decompiler process. This object is global to all decompile processes so we can tailor to the specific process by passing in the interface.
      Parameters:
      encoder - is the stream encoder
      iface - specific DecompInterface being sent options
      Throws:
      IOException - for errors writing to the underlying stream
    • getMaxWidth

      public int getMaxWidth()
    • setMaxWidth

      public void setMaxWidth(int maxwidth)
    • getKeywordColor

      public Color getKeywordColor()
      Returns:
      color associated with keyword tokens
    • getTypeColor

      public Color getTypeColor()
      Returns:
      color associated with data-type tokens
    • getFunctionColor

      public Color getFunctionColor()
      Returns:
      color associated with a function name token
    • getCommentColor

      public Color getCommentColor()
      Returns:
      color used to display comments
    • getConstantColor

      public Color getConstantColor()
      Returns:
      color associated with constant tokens
    • getVariableColor

      public Color getVariableColor()
      Returns:
      color associated with (local) variable tokens
    • getParameterColor

      public Color getParameterColor()
      Returns:
      color associated with parameter tokens
    • getGlobalColor

      public Color getGlobalColor()
      Returns:
      color associated with global variable tokens
    • getSpecialColor

      public Color getSpecialColor()
      Returns:
      color associated with volatile variables or other special tokens
    • getDefaultColor

      public Color getDefaultColor()
      Returns:
      color for generic syntax or other unspecified tokens
    • getErrorColor

      public Color getErrorColor()
      Returns:
      color used on tokens that need to warn of an error or other unusual conditions
    • getCodeViewerBackgroundColor

      public Color getCodeViewerBackgroundColor()
      Returns:
      the background color for the decompiler window
    • getCurrentVariableHighlightColor

      public Color getCurrentVariableHighlightColor()
      Returns:
      the color used display the current highlighted variable
    • getMiddleMouseHighlightColor

      public Color getMiddleMouseHighlightColor()
      Returns:
      color used to highlight token(s) selected with a middle button clock
    • getSearchHighlightColor

      public Color getSearchHighlightColor()
      Returns:
      color used to highlight search results
    • getMiddleMouseHighlightButton

      public int getMiddleMouseHighlightButton()
    • isPRECommentIncluded

      public boolean isPRECommentIncluded()
    • setPRECommentIncluded

      public void setPRECommentIncluded(boolean commentPREInclude)
    • isPLATECommentIncluded

      public boolean isPLATECommentIncluded()
    • setPLATECommentIncluded

      public void setPLATECommentIncluded(boolean commentPLATEInclude)
    • isPOSTCommentIncluded

      public boolean isPOSTCommentIncluded()
    • setPOSTCommentIncluded

      public void setPOSTCommentIncluded(boolean commentPOSTInclude)
    • isEOLCommentIncluded

      public boolean isEOLCommentIncluded()
    • setEOLCommentIncluded

      public void setEOLCommentIncluded(boolean commentEOLInclude)
    • isWARNCommentIncluded

      public boolean isWARNCommentIncluded()
    • setWARNCommentIncluded

      public void setWARNCommentIncluded(boolean commentWARNInclude)
    • isHeadCommentIncluded

      public boolean isHeadCommentIncluded()
    • setHeadCommentIncluded

      public void setHeadCommentIncluded(boolean commentHeadInclude)
    • isEliminateUnreachable

      public boolean isEliminateUnreachable()
    • setEliminateUnreachable

      public void setEliminateUnreachable(boolean eliminateUnreachable)
    • isSimplifyDoublePrecision

      public boolean isSimplifyDoublePrecision()
    • setSimplifyDoublePrecision

      public void setSimplifyDoublePrecision(boolean simplifyDoublePrecision)
    • isDisplayLineNumbers

      public boolean isDisplayLineNumbers()
    • getDisplayLanguage

      public DecompilerLanguage getDisplayLanguage()
    • isConventionPrint

      public boolean isConventionPrint()
    • setConventionPrint

      public void setConventionPrint(boolean conventionPrint)
    • isNoCastPrint

      public boolean isNoCastPrint()
    • setNoCastPrint

      public void setNoCastPrint(boolean noCastPrint)
    • setDisplayLanguage

      public void setDisplayLanguage(DecompilerLanguage val)
    • getDefaultFont

      public Font getDefaultFont()
    • getDefaultTimeout

      public int getDefaultTimeout()
    • setDefaultTimeout

      public void setDefaultTimeout(int timeout)
    • getMaxPayloadMBytes

      public int getMaxPayloadMBytes()
    • setMaxPayloadMBytes

      public void setMaxPayloadMBytes(int mbytes)
    • getMaxInstructions

      public int getMaxInstructions()
    • setMaxInstructions

      public void setMaxInstructions(int num)
    • getCommentStyle

      public DecompileOptions.CommentStyleEnum getCommentStyle()
    • setCommentStyle

      public void setCommentStyle(DecompileOptions.CommentStyleEnum commentStyle)
    • getCacheSize

      public int getCacheSize()