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 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