Class GoPcHeader

java.lang.Object
ghidra.app.util.bin.format.golang.rtti.GoPcHeader

public class GoPcHeader extends Object
A low-level structure embedded in golang binaries that contains useful bootstrapping information.

  • Field Details

  • Constructor Details

    • GoPcHeader

      public GoPcHeader()
  • Method Details

    • getPclntabAddress

      public static Address getPclntabAddress(Program program)
      Returns the Address (if present) of the go pclntab section or symbol.
      Parameters:
      program - Program
      Returns:
      Address of go pclntab, or null if not present
    • hasPclntab

      public static boolean hasPclntab(Program program)
      Returns true if the specified program has an easily found pclntab
      Parameters:
      program - Program
      Returns:
      boolean true if program has a pclntab, false otherwise
    • findPclntabAddress

      public static Address findPclntabAddress(GoRttiMapper programContext, AddressRange range, TaskMonitor monitor) throws IOException
      Searches (possibly slowly) for a pclntab structure in the specified memory range, which is typically necessary in stripped PE binaries.
      Parameters:
      programContext - GoRttiMapper
      range - memory range to search (typically .rdata or .noptrdata sections)
      monitor - TaskMonitor that will let the user cancel
      Returns:
      Address of the found pclntab structure, or null if not found
      Throws:
      IOException - if error reading
    • isPclntab

      public static boolean isPclntab(ByteProvider provider) throws IOException
      Returns true if there is a pclntab at the current position of the specified ByteProvider.
      Parameters:
      provider - ByteProvider
      Returns:
      boolean true if the byte provider has the magic signature of a pclntab
      Throws:
      IOException - if error reading
    • getGoVersion

      public GoVer getGoVersion()
    • hasTextStart

      public boolean hasTextStart()
    • getTextStart

      public Address getTextStart()
    • getFuncnameAddress

      public Address getFuncnameAddress()
    • getCuAddress

      public Address getCuAddress()
    • getFiletabAddress

      public Address getFiletabAddress()
    • getPctabAddress

      public Address getPctabAddress()
    • getPclnAddress

      public Address getPclnAddress()