Package ghidra.app.util.bin.format.golang.rtti

# Class GoModuledata

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

All Implemented Interfaces:
  `StructureMarkup<GoModuledata>`

public class GoModuledata extends Object implements StructureMarkup<GoModuledata>
Represents a Go moduledata structure, which contains a lot of valuable bootstrapping data for RTTI and function data.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GoModuledata()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `additionalMarkup(MarkupSession session)`
  Called to allow the implementor to perform custom markup of itself.
  `boolean`
  `containsFuncDataInstance(long offset)`
  Returns true if this GoModuleData is the module data that contains the specified GoFuncData structure.
  `List<GoFuncData>`
  `getAllFunctionData()`
  Returns a list of all functions contained in this module.
  `GoSlice`
  `getCutab()`
  Returns the cutab slice.
  `AddressRange`
  `getDataRange()`
  `GoSlice`
  `getFiletab()`
  Returns the filetab slice.
  `GoFuncData`
  `getFuncDataInstance(long offset)`
  Reads a `GoFuncData` structure from the pclntable.
  `GoSlice`
  `getFuncnametab()`
  Returns a slice that contains all the function names.
  `GoSlice`
  `getFunctabEntriesSlice()`
  Returns an artificial slice of the functab entries that are valid.
  `GoRttiMapper`
  `getGoBinary()`
  Returns a reference to the controlling `Go binary` context.
  `long`
  `getGofunc()`
  Returns the offset of the gofunc location.
  `List<GoItab>`
  `getItabs()`
  Returns list of the GoItabs present in this module.
  `GoPcHeader`
  `getPcHeader()`
  `Address`
  `getPcHeaderAddress()`
  `GoSlice`
  `getPclntable()`
  Returns the pclntable slice.
  `GoSlice`
  `getPctab()`
  Returns the pctab slice.
  `GoSlice`
  `getPcValueTable()`
  `AddressRange`
  `getRoDataRange()`
  `StructureContext<GoModuledata>`
  `getStructureContext()`
  `Address`
  `getText()`
  Returns the address of the beginning of the text section.
  `AddressRange`
  `getTextRange()`
  `List<Address>`
  `getTypeList()`
  Returns list of locations of the types contained in this module.
  `long`
  `getTypesEndOffset()`
  Returns the ending offset of type info.
  `long`
  `getTypesOffset()`
  Returns the starting offset of type info.
  `AddressRange`
  `getUninitializedDataRange()`
  `AddressRange`
  `getUninitializedNoPtrDataRange()`
  `boolean`
  `isValid()`
  Returns true if this module data structure contains sane values.
  `boolean`
  `matchesPcHeader(GoPcHeader otherPcHeader)`
  Compares the data in this structure to fields in a GoPcHeader and returns true if they match.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.app.util.bin.format.golang.structmapping.StructureMarkup

  `getExternalInstancesToMarkup, getStructureLabel, getStructureName, getStructureNamespace`

- ## Constructor Details

  - ### GoModuledata

    public GoModuledata()

- ## Method Details

  - ### matchesPcHeader

    public boolean matchesPcHeader(GoPcHeader otherPcHeader)
    Compares the data in this structure to fields in a GoPcHeader and returns true if they match.
    Parameters:
      `otherPcHeader` - GoPcHeader instance
    Returns:
      boolean true if match, false if no match

  - ### getPcHeader

    public GoPcHeader getPcHeader() throws IOException
    Throws:
      `IOException`

  - ### getPcHeaderAddress

    public Address getPcHeaderAddress()

  - ### getText

    public Address getText()
    Returns the address of the beginning of the text section.
    Returns:
      the address of the beginning of the text section

  - ### getTextRange

    public AddressRange getTextRange()

  - ### getRoDataRange

    public AddressRange getRoDataRange()

  - ### getDataRange

    public AddressRange getDataRange()

  - ### getUninitializedDataRange

    public AddressRange getUninitializedDataRange()

  - ### getUninitializedNoPtrDataRange

    public AddressRange getUninitializedNoPtrDataRange()

  - ### getTypesOffset

    public long getTypesOffset()
    Returns the starting offset of type info.
    Returns:
      the starting offset of type info

  - ### getTypesEndOffset

    public long getTypesEndOffset()
    Returns the ending offset of type info.
    Returns:
      the ending offset of type info

  - ### getGofunc

    public long getGofunc()
    Returns the offset of the gofunc location.
    Returns:
      the offset of the gofunc location

  - ### getFuncDataInstance

    public GoFuncData getFuncDataInstance(long offset) throws IOException
    Reads a `GoFuncData` structure from the pclntable.
    Parameters:
      `offset` - relative to the pclntable
    Returns:
      `GoFuncData`
    Throws:
      `IOException` - if error reading data

  - ### containsFuncDataInstance

    public boolean containsFuncDataInstance(long offset)
    Returns true if this GoModuleData is the module data that contains the specified GoFuncData structure.
    Parameters:
      `offset` - offset of a GoFuncData structure
    Returns:
      true if this GoModuleData is the module data that contains the specified GoFuncData structure

  - ### getFunctabEntriesSlice

    public GoSlice getFunctabEntriesSlice()
    Returns an artificial slice of the functab entries that are valid.
    Returns:
      an artificial slice of the functab entries that are valid

  - ### isValid

    public boolean isValid()
    Returns true if this module data structure contains sane values.
    Returns:
      true if this module data structure contains sane values

  - ### getFuncnametab

    public GoSlice getFuncnametab()
    Returns a slice that contains all the function names.
    Returns:
      a slice that contains all the function names

  - ### getAllFunctionData

    public List<GoFuncData> getAllFunctionData() throws IOException
    Returns a list of all functions contained in this module.
    Returns:
      a list of all functions contained in this module
    Throws:
      `IOException` - if error reading data

  - ### getCutab

    public GoSlice getCutab()
    Returns the cutab slice.
    Returns:
      the cutab slice

  - ### getFiletab

    public GoSlice getFiletab()
    Returns the filetab slice.
    Returns:
      the filetab slice

  - ### getPclntable

    public GoSlice getPclntable()
    Returns the pclntable slice.
    Returns:
      the pclntable slice

  - ### getPctab

    public GoSlice getPctab()
    Returns the pctab slice.
    Returns:
      the pctab slice

  - ### getPcValueTable

    public GoSlice getPcValueTable()

  - ### getGoBinary

    public GoRttiMapper getGoBinary()
    Returns a reference to the controlling `Go binary` context.
    Returns:
      a reference to the controlling `Go binary` context

  - ### getStructureContext

    public StructureContext<GoModuledata> getStructureContext()
    Specified by:
      `getStructureContext` in interface `StructureMarkup<GoModuledata>`

  - ### additionalMarkup

    public void additionalMarkup(MarkupSession session) throws IOException, CancelledException
    Description copied from interface: `StructureMarkup`
    Called to allow the implementor to perform custom markup of itself.
    Specified by:
      `additionalMarkup` in interface `StructureMarkup<GoModuledata>`
    Parameters:
      `session` - state and methods to assist marking up the program
    Throws:
      `IOException` - if error during markup
      `CancelledException` - if cancelled

  - ### getItabs

    public List<GoItab> getItabs() throws IOException
    Returns list of the GoItabs present in this module.
    Returns:
      list of the GoItabs present in this module
    Throws:
      `IOException` - if error reading data

  - ### getTypeList

    public List<Address> getTypeList() throws IOException
    Returns list of locations of the types contained in this module.
    Returns:
      list of locations of the types contained in this module
    Throws:
      `IOException` - if error reading data