Class GoBuildInfo

java.lang.Object
ghidra.app.util.bin.format.golang.GoBuildInfo
All Implemented Interfaces:
ElfInfoItem

public class GoBuildInfo extends Object implements ElfInfoItem
A program section that contains Go build information strings, namely go module package names, go module dependencies, and build/compiler flags, as well as the golang version itself.
  • Field Details

  • Method Details

    • fromProgram

      public static GoBuildInfo fromProgram(Program program)
      Reads a GoBuildInfo ".go.buildinfo" section from the specified Program, if present.
      Parameters:
      program - Program that contains the ".go.buildinfo" section
      Returns:
      new GoBuildInfo instance, if present, null if missing or error
    • findBuildInfo

      public static ElfInfoItem.ItemWithAddress<GoBuildInfo> findBuildInfo(Program program)
      Searches for the GoBuildInfo structure in the most common and easy locations.
      Parameters:
      program - Program to search
      Returns:
      new GoBuildInfo instance, if present, null if missing or error
    • read

      public static GoBuildInfo read(BinaryReader reader, Program program) throws IOException
      Reads a GoBuildInfo ".go.buildinfo" section from the specified stream.
      Parameters:
      reader - BinaryReader that contains the ".go.buildinfo" section
      program - Program that contains the ".go.buildinfo" section
      Returns:
      new GoBuildInfo instance, never null
      Throws:
      IOException - if error reading or bad data
    • isPresent

      public static boolean isPresent(InputStream is)
      Probes the specified InputStream and returns true if it starts with a go buildinfo magic signature.
      Parameters:
      is - InputStream
      Returns:
      true if starts with buildinfo magic signature
    • getPointerSize

      public int getPointerSize()
    • getEndian

      public Endian getEndian()
    • getVersion

      public String getVersion()
    • getGoVer

      public GoVer getGoVer()
    • getPath

      public String getPath()
    • getModuleInfo

      public GoModuleInfo getModuleInfo()
    • getDependencies

      public List<GoModuleInfo> getDependencies()
    • getBuildSettings

      public List<GoBuildSettings> getBuildSettings()
    • markupProgram

      public void markupProgram(Program program, Address address)
      Description copied from interface: ElfInfoItem
      Markup a program's info and memory with this item.
      Specified by:
      markupProgram in interface ElfInfoItem
      Parameters:
      program - Program to markup
      address - Address of the item in the program
    • decorateProgramInfo

      public void decorateProgramInfo(Options props)
    • toString

      public String toString()
      Overrides:
      toString in class Object