public static List<OmfRecord> readRecords(AbstractOmfRecordFactory factory)
			throws OmfException, IOException {
		List<OmfRecord> records = new ArrayList<>();
		factory.reset();

		while (true) {
			OmfRecord rec = factory.readNextRecord();
			records.add(rec);
			if (rec.getRecordType() == factory.getEndRecordType()) {
				break;
			}
		}
		
		return records;
	}
Reads all the {@link OmfRecord records} associated with the given 
{@link AbstractOmfRecordFactory}

@param factory The {@link AbstractOmfRecordFactory}
@return A {@link List} of read {@link OmfRecord records}
@throws IOException if there was an IO-related error
@throws OmfException if there was a problem with the OMF specification
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/omf/OmfUtils.java