Package ghidra.app.util.bin.format.omf

# Class OmfData

java.lang.Object
ghidra.app.util.bin.format.omf.OmfRecord
ghidra.app.util.bin.format.omf.OmfData

All Implemented Interfaces:
  `Comparable<OmfData>`

Direct Known Subclasses:
  `OmfEnumeratedData`, `OmfIteratedData`

public abstract class OmfData extends OmfRecord implements Comparable<OmfData>
Object representing data loaded directly into the final image.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected long`
  `dataOffset`
  `protected int`
  `segmentIndex`

  ### Fields inherited from class ghidra.app.util.bin.format.omf.OmfRecord

  `ALIAS, BAKPAT, BLKDEF, BLKEND, CEXTDEF, checkSum, COMDAT, COMDEF, COMENT, DEBSYM, END, ENDREC, EXTDEF, FIXUPP, GRPDEF, LCOMDEF, LEDATA, LEXTDEF, LHEADR, LIBDIC, LIBHED, LIBLOC, LIBNAM, LIDATA, LINNUM, LINSYM, LLNAMES, LNAMES, LOCSYM, LPUBDEF, MODEND, NBKPAT, OVLDEF, PEDATA, PIDATA, PUBDEF, recordLength, recordOffset, recordType, REDATA, REGINT, RHEADR, RIDATA, SEGDEF, START, THEADR, TYPDEF, VENDEXT, VERNUM`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OmfData()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(OmfData o)`
  Compare datablocks by data offset
  `abstract byte[]`
  `getByteArray(BinaryReader reader)`
  Create a byte array holding the data represented by this object.
  `long`
  `getDataOffset()`
  `abstract int`
  `getLength()`
  `int`
  `getSegmentIndex()`
  `abstract boolean`
  `isAllZeroes()`

  ### Methods inherited from class ghidra.app.util.bin.format.omf.OmfRecord

  `calcCheckSum, getRecordLength, getRecordName, getRecordOffset, getRecordType, hasBigFields, readCheckSumByte, readIndex, readInt1Or2, readInt2Or4, readRecord, readRecordHeader, readString, toString, validCheckSum`

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

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

- ## Field Details

  - ### segmentIndex

    protected int segmentIndex

  - ### dataOffset

    protected long dataOffset

- ## Constructor Details

  - ### OmfData

    public OmfData()

- ## Method Details

  - ### getSegmentIndex

    public int getSegmentIndex()
    Returns:
      get the segments index for this datablock

  - ### getDataOffset

    public long getDataOffset()
    Returns:
      the starting offset, within the loaded image, of this data

  - ### compareTo

    public int compareTo(OmfData o)
    Compare datablocks by data offset
    Specified by:
      `compareTo` in interface `Comparable<OmfData>`
    Returns:
      a value less than 0 for lower address, 0 for same address, or greater than 0 for higher address

  - ### getLength

    public abstract int getLength()
    Returns:
      the length of this data in bytes

  - ### getByteArray

    public abstract byte[] getByteArray(BinaryReader reader) throws IOException
    Create a byte array holding the data represented by this object. The length of the byte array should exactly match the value returned by getLength()
    Parameters:
      `reader` - is for pulling bytes directly from the binary image
    Returns:
      allocated and filled byte array
    Throws:
      `IOException` - for problems accessing data through the reader

  - ### isAllZeroes

    public abstract boolean isAllZeroes()
    Returns:
      true if this is a block entirely of zeroes