Class GhidraProgramUtilities

java.lang.Object
ghidra.program.util.GhidraProgramUtilities

public class GhidraProgramUtilities extends Object
  • Method Details

    • getCurrentProgram

      public static Program getCurrentProgram(PluginTool tool)
      Returns the current program for the given tool or null if no program is open.
      Parameters:
      tool - the tool get get the current program for
      Returns:
      the current program for the given tool or null if no program is open
    • shouldAskToAnalyze

      public static boolean shouldAskToAnalyze(Program program)
      Returns true if the user should be asked to analyze. They will only be asked if the program hasn't already been analyzed (analyzed flag property is false or null) or the "ask to analyze" flag property is true or null (default is true unless explicitly set to false).
      Parameters:
      program - the program to check for the property
      Returns:
      true if the user should be prompted to analyze the program
    • resetAnalysisFlags

      public static void resetAnalysisFlags(Program program)
      Resets the analysis flags to the program defaults With this reset, the user will be prompted to analyze the program the next time it is opened.
      Parameters:
      program - the program whose analysis flags should be reset
    • markProgramAnalyzed

      public static void markProgramAnalyzed(Program program)
      Marks the program has having been analyzed
      Parameters:
      program - the program to set property
    • markProgramNotToAskToAnalyze

      public static void markProgramNotToAskToAnalyze(Program program)
    • isAnalyzed

      public static boolean isAnalyzed(Program program)
      Returns true if the program has been analyzed at least once.
      Parameters:
      program - the program to test to see if it has been analyzed
      Returns:
      true if the program has been analyzed at least once.