Class OmfRecord

java.lang.Object
ghidra.app.util.bin.format.omf.OmfRecord
All Implemented Interfaces:
StructConverter
Direct Known Subclasses:
Omf166DepList, Omf51ModuleEnd, Omf51ModuleHeader, OmfCommentRecord, OmfData, OmfExternalSymbol, OmfFileHeader, OmfFixupRecord, OmfGroupRecord, OmfModuleEnd, OmfNamesRecord, OmfObsoleteRecord, OmfSegmentHeader, OmfSymbolRecord, OmfUnknownRecord, OmfUnsupportedRecord

public abstract class OmfRecord extends Object implements StructConverter
A generic OMF record
  • Field Details

    • recordType

      protected int recordType
    • recordLength

      protected int recordLength
    • data

      protected byte[] data
    • checkSum

      protected byte checkSum
    • recordOffset

      protected long recordOffset
    • dataReader

      protected BinaryReader dataReader
    • dataEnd

      protected long dataEnd
  • Constructor Details

  • Method Details

    • parseData

      public abstract void parseData() throws IOException, OmfException
      Parses this OmfRecord's type-spefic data
      Throws:
      IOException - if there was an IO-related error
      OmfException - if there was a problem with the OMF specification
    • toDataType

      public abstract 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:
    • getRecordType

      public int getRecordType()
      Returns the record type.
      Returns:
      the record type
    • getRecordLength

      public int getRecordLength()
      Returns the record length.
      Returns:
      the record length
    • getRecordOffset

      public long getRecordOffset()
      Returns the record offset.
      Returns:
      the record offset
    • getRecordChecksum

      public byte getRecordChecksum()
    • getData

      public byte[] getData()
    • calcCheckSum

      public byte calcCheckSum() throws IOException
      Computes the record's checksum
      Returns:
      The record's checksum
      Throws:
      IOException - if an IO-related error occurred
    • validCheckSum

      public boolean validCheckSum() throws IOException
      Validates the record's checksum
      Returns:
      True if the checksum is valid; otherwise, false
      Throws:
      IOException - if an IO-related error occurred
    • hasBigFields

      public boolean hasBigFields()
      Returns true if this record has big fields; otherwise, false.
      Returns:
      true if this record has big fields; otherwise, false
    • toString

      public String toString()
      Overrides:
      toString in class Object