Package ghidra.app.util.bin.format.omf
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
A generic OMF record
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte
protected byte[]
protected long
protected BinaryReader
protected int
protected long
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte
Computes the record's checksumbyte[]
getData()
byte
int
Returns the record length.long
Returns the record offset.int
Returns the record type.boolean
Returns true if this record has big fields; otherwise, false.abstract void
Parses thisOmfRecord
's type-spefic dataabstract DataType
Returns a structure datatype representing the contents of the implementor of this interface.toString()
boolean
Validates the record's checksum
-
Field Details
-
recordType
protected int recordType -
recordLength
protected int recordLength -
data
protected byte[] data -
checkSum
protected byte checkSum -
recordOffset
protected long recordOffset -
dataReader
-
dataEnd
protected long dataEnd
-
-
Constructor Details
-
OmfRecord
public OmfRecord() -
OmfRecord
Creates a newOmfRecord
- Parameters:
reader
- ABinaryReader
positioned at the start of the record- Throws:
IOException
- if there was an IO-related error
-
-
Method Details
-
parseData
Parses thisOmfRecord
's type-spefic data- Throws:
IOException
- if there was an IO-related errorOmfException
- if there was a problem with the OMF specification
-
toDataType
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 interfaceStructConverter
- Returns:
- returns a structure datatype representing the implementor of this interface
- Throws:
DuplicateNameException
- when a datatype of the same name already existsIOException
- 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
Computes the record's checksum- Returns:
- The record's checksum
- Throws:
IOException
- if an IO-related error occurred
-
validCheckSum
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
-