Class SomHeader

java.lang.Object
ghidra.app.util.bin.format.som.SomHeader
All Implemented Interfaces:
StructConverter

public class SomHeader extends Object implements StructConverter
Represents a SOM header structure
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getSystemId

      public int getSystemId()
      Returns the system ID.
      Returns:
      the system ID
    • getMagic

      public int getMagic()
      Returns the magic.
      Returns:
      the magic
    • hasValidMagic

      public boolean hasValidMagic()
      Returns true if this SomHeader has a valid magic number; otherwise false.
      Returns:
      true if this SomHeader has a valid magic number; otherwise false
    • getVersionId

      public long getVersionId()
      Returns the version ID.
      Returns:
      the version ID
    • hasValidVersionId

      public boolean hasValidVersionId()
      Returns true if this SomHeader has a valid version ID; otherwise false.
      Returns:
      true if this SomHeader has a valid version ID; otherwise false
    • getFileType

      public SomSysClock getFileType()
      Returns the file time.
      Returns:
      the file time
    • getEntrySpace

      public long getEntrySpace()
      Returns the index of space containing entry point.
      Returns:
      the index of space containing entry point
    • getEntrySubspace

      public long getEntrySubspace()
      Returns the index of subspace for entry point.
      Returns:
      the index of subspace for entry point
    • getEntryOffset

      public long getEntryOffset()
      Returns the offset of entry point.
      Returns:
      the offset of entry point
    • getAuxHeaderLocation

      public long getAuxHeaderLocation()
      Returns the auxiliary header location.
      Returns:
      the auxiliary header location
    • getAuxHeaderSize

      public long getAuxHeaderSize()
      Returns the auxiliary header size.
      Returns:
      the auxiliary header size
    • getSomLength

      public long getSomLength()
      Returns the length in bytes of entire som.
      Returns:
      the length in bytes of entire som
    • getPresumedDp

      public long getPresumedDp()
      Returns the DP value assumed during compilation.
      Returns:
      the DP value assumed during compilation
    • getSpaceLocation

      public long getSpaceLocation()
      Returns the location in file of space dictionary.
      Returns:
      the location in file of space dictionary
    • getSpaceTotal

      public long getSpaceTotal()
      Returns the number of space entries.
      Returns:
      the number of space entries
    • getSubspaceLocation

      public long getSubspaceLocation()
      Returns the location of subspace entries.
      Returns:
      the location of subspace entries
    • getSubspaceTotal

      public long getSubspaceTotal()
      Returns the number of subspace entries.
      Returns:
      the number of subspace entries
    • getLoaderFixupLocation

      public long getLoaderFixupLocation()
      Returns the MPE/iX loader fixup location.
      Returns:
      the MPE/iX loader fixup location
    • getLoaderFixupTotal

      public long getLoaderFixupTotal()
      Returns the number of loader fixup records.
      Returns:
      the number of loader fixup records
    • getSpaceStringsLocation

      public long getSpaceStringsLocation()
      Returns the file location of string area for space and subspace names.
      Returns:
      the file location of string area for space and subspace names
    • getSpaceStringsSize

      public long getSpaceStringsSize()
      Returns the size of string area for space and subspace names.
      Returns:
      the size of string area for space and subspace names
    • getInitArrayLocation

      public long getInitArrayLocation()
      Returns the init array location.
      Returns:
      the init array location
    • getInitArrayTotal

      public long getInitArrayTotal()
      Returns the init array total.
      Returns:
      the init array total
    • getCompilerLocation

      public long getCompilerLocation()
      Returns the location in file of module dictionary.
      Returns:
      the location in file of module dictionary
    • getCompilerTotal

      public long getCompilerTotal()
      Returns the number of modules.
      Returns:
      the number of modules
    • getSymbolLocation

      public long getSymbolLocation()
      Returns the location in file of symbol dictionary.
      Returns:
      the location in file of symbol dictionary
    • getSymbolTotal

      public long getSymbolTotal()
      Returns the number of symbol records.
      Returns:
      the number of symbol records
    • getFixupRequestLocation

      public long getFixupRequestLocation()
      Returns the location in file of fixup requests.
      Returns:
      the location in file of fixup requests
    • getFixupRequestTotal

      public long getFixupRequestTotal()
      Returns the number of fixup requests.
      Returns:
      the number of fixup requests
    • getSymbolStringsLocation

      public long getSymbolStringsLocation()
      Returns the file location of string area for module and symbol names.
      Returns:
      the file location of string area for module and symbol names
    • getSymbolStringsSize

      public long getSymbolStringsSize()
      Returns the size of string area for module and symbol names.
      Returns:
      the size of string area for module and symbol names
    • getUnloadableSpLocation

      public long getUnloadableSpLocation()
      Returns the byte offset of first byte of data for unloadable spaces.
      Returns:
      the byte offset of first byte of data for unloadable spaces
    • getUnloadableSpSize

      public long getUnloadableSpSize()
      Returns the byte length of data for unloadable spaces.
      Returns:
      the byte length of data for unloadable spaces
    • getChecksum

      public long getChecksum()
      Returns the checksum.
      Returns:
      the checksum
    • getSpaces

      public List<SomSpace> getSpaces()
      Returns the List of spaces.
      Returns:
      the List of spaces
    • getSubspaces

      public List<SomSubspace> getSubspaces()
      Returns the List of subspaces.
      Returns:
      the List of subspaces
    • getAuxHeaders

      public List<SomAuxHeader> getAuxHeaders()
      Returns the List of auxiliary headers.
      Returns:
      the List of auxiliary headers
    • getAuxHeaders

      public <T> List<T> getAuxHeaders(Class<T> classType)
      Returns the List of auxiliary headers. of the given type}
      Type Parameters:
      T - The type of auxiliary header to get
      Parameters:
      classType - The type of auxiliary header to get
      Returns:
      the List of auxiliary headers
    • getFirstAuxHeader

      public <T> T getFirstAuxHeader(Class<T> classType)
      Returns the first found auxiliary header. of the given type}
      Type Parameters:
      T - The type of auxiliary header to get
      Parameters:
      classType - The type of auxiliary header to get
      Returns:
      the first found auxiliary header
    • getCompilationUnits

      public List<SomCompilationUnit> getCompilationUnits()
      Returns the List of compilation units.
      Returns:
      the List of compilation units
    • getSymbols

      public List<SomSymbol> getSymbols()
      Returns the List of symbols.
      Returns:
      the List of symbols
    • getTextAddress

      public Address getTextAddress(Program program) throws Exception
      Returns the starting address of the "text" space.
      Parameters:
      program - The Program
      Returns:
      the starting address of the "text" space
      Throws:
      Exception - if there was a problem getting the address
    • getDataAddress

      public Address getDataAddress(Program program) throws Exception
      Returns the starting address of the "data" space, or null if it wasn't found.
      Parameters:
      program - The Program
      Returns:
      the starting address of the "data" space, or null if it wasn't found
      Throws:
      Exception - if there was a problem getting the address
    • markup

      public void markup(Program program, Address headerAddr, TaskMonitor monitor) throws Exception
      Marks up this header
      Parameters:
      program - The Program
      headerAddr - The Address of this header
      monitor - A cancellable monitor
      Throws:
      Exception - if there was a problem during markup
    • toDataType

      public DataType toDataType() throws DuplicateNameException, IOException
      Description copied from interface: StructConverter
      Returns a structure datatype representing the contents of the implementor of this interface.

      For example, given:

       class A {
           int foo;
           double bar;
       }
       

      The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

      Specified by:
      toDataType in interface StructConverter
      Returns:
      returns a structure datatype representing the implementor of this interface
      Throws:
      DuplicateNameException - when a datatype of the same name already exists
      IOException - if an IO-related error occurs
      See Also: