Class LoadSpec

java.lang.Object
ghidra.app.util.opinion.LoadSpec

public class LoadSpec extends Object
Represents a possible way for a Loader to load something.
  • Constructor Details

    • LoadSpec

      public LoadSpec(Loader loader, long imageBase, LanguageCompilerSpecPair languageCompilerSpec, boolean isPreferred)
      Constructs a LoadSpec from a manually supplied LanguageCompilerSpecPair.
      Parameters:
      loader - This LoadSpec's Loader.
      imageBase - The desired image base address for the load.
      languageCompilerSpec - The language/compiler spec ID. If this is not needed or not known, use LoadSpec(Loader, long, boolean).
      isPreferred - true if this LoadSpec is preferred; otherwise, false.
    • LoadSpec

      public LoadSpec(Loader loader, long imageBase, QueryResult languageCompilerSpecQueryResult)
      Constructs a LoadSpec from a QueryResult.
      Parameters:
      loader - This LoadSpec's Loader.
      imageBase - The desired image base address for the load.
      languageCompilerSpecQueryResult - The language/compiler spec ID.
    • LoadSpec

      public LoadSpec(Loader loader, long imageBase, boolean requiresLanguageCompilerSpec)
      Constructs a LoadSpec with an unknown language/compiler. Some Loader's do not require a language/compiler.
      Parameters:
      loader - This LoadSpec's Loader.
      imageBase - The desired image base address for the load.
      requiresLanguageCompilerSpec - True if this LoadSpec requires a language/compiler; otherwise, false. If a language/compiler is required, it will have to be supplied to the Loader by some other means, and this LoadSpec will be considered incomplete.
      See Also:
  • Method Details

    • getLoader

      public Loader getLoader()
      Gets this LoadSpec's Loader.
      Returns:
      This LoadSpec's Loader.
    • getDesiredImageBase

      public long getDesiredImageBase()
      Gets the desired image base to use during the load.
      Returns:
      The desired image base to use during the load.
    • getLanguageCompilerSpec

      public LanguageCompilerSpecPair getLanguageCompilerSpec()
      Returns:
      This LoadSpec's LanguageCompilerSpecPair. Could be null if this LoadSpec doesn't need or know the language/compiler.
    • isPreferred

      public boolean isPreferred()
      Gets whether or not this LoadSpec is a preferred LoadSpec.
      Returns:
      True if this LoadSpec is a preferred LoadSpec; otherwise, false.
    • requiresLanguageCompilerSpec

      public boolean requiresLanguageCompilerSpec()
      Gets whether or not this LoadSpec requires a language/compiler to load something.
      Returns:
      True if this LoadSpec requires a language/compiler to load something; otherwise, false.
    • isComplete

      public boolean isComplete()
      Gets whether or not this LoadSpec is complete. A LoadSpec is not considered complete if it requires a language/compiler to load something, but the language/compiler is currently unknown.
      Returns:
      True if this LoadSpec is complete; otherwise, false.