Package ghidra.app.util.bin.format.omf
Class OmfUtils
java.lang.Object
ghidra.app.util.bin.format.omf.OmfUtils
Utility class for OMF-based file formats
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stream<T> filterRecords(List<OmfRecord> records, Class<T> classType) static final StringgetRecordName(int type, Class<?> recordTypesClass) Gets the name of the given record typestatic OmfIndexreadIndex(BinaryReader reader) static Omf2or4readInt2Or4(BinaryReader reader, boolean isBig) readRecords(AbstractOmfRecordFactory factory) Reads all therecordsassociated with the givenAbstractOmfRecordFactorystatic OmfStringreadString(BinaryReader reader) Read the OMF string format: 1-byte length, followed by that many ascii charactersstatic DataTypetoOmfRecordDataType(OmfRecord record, String name)
-
Field Details
-
CATEGORY_PATH
Data type category- See Also:
-
-
Constructor Details
-
OmfUtils
public OmfUtils()
-
-
Method Details
-
readInt2Or4
- Throws:
IOException
-
readIndex
- Throws:
IOException
-
readString
Read the OMF string format: 1-byte length, followed by that many ascii characters- Parameters:
reader- ABinaryReaderpositioned at the start of the string- Returns:
- the read OMF string
- Throws:
IOException- if an IO-related error occurred
-
getRecordName
Gets the name of the given record type- Parameters:
type- The record typerecordTypesClass- The class that contains accessible OMF type fields- Returns:
- The name of the given record type
-
toOmfRecordDataType
- Parameters:
record- The OMF record to convertname- The name of the OMF record- Returns:
- A
DataTypefor the given OMF record
-
readRecords
public static List<OmfRecord> readRecords(AbstractOmfRecordFactory factory) throws OmfException, IOException Reads all therecordsassociated with the givenAbstractOmfRecordFactory- Parameters:
factory- TheAbstractOmfRecordFactory- Returns:
- A
Listof readrecords - Throws:
IOException- if there was an IO-related errorOmfException- if there was a problem with the OMF specification
-
filterRecords
-