mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-07 05:44:39 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d265c14841 | ||
|
|
1148245226 | ||
|
|
f53d9f94e6 | ||
|
|
4e3d832834 |
@@ -65,8 +65,8 @@ namespace SabreTools.Serialization.CrossModel
|
||||
datItems.Add(ConvertToInternalModel(file));
|
||||
}
|
||||
|
||||
machine[Models.Metadata.Machine.DiskKey] = datItems.Where(i => i.ReadString(Models.Metadata.DatItem.TypeKey) == "disk")?.ToArray();
|
||||
machine[Models.Metadata.Machine.RomKey] = datItems.Where(i => i.ReadString(Models.Metadata.DatItem.TypeKey) == "rom")?.ToArray();
|
||||
machine[Models.Metadata.Machine.DiskKey] = datItems.Where(i => i.ReadString(Models.Metadata.DatItem.TypeKey) == "disk").Select(d => d as Models.Metadata.Disk).ToArray();
|
||||
machine[Models.Metadata.Machine.RomKey] = datItems.Where(i => i.ReadString(Models.Metadata.DatItem.TypeKey) == "rom").Select(d => d as Models.Metadata.Rom).ToArray();
|
||||
}
|
||||
|
||||
return machine;
|
||||
|
||||
@@ -1309,6 +1309,8 @@ namespace SabreTools.Serialization
|
||||
}
|
||||
|
||||
stringTableChildren.Add(stringData);
|
||||
if (stringData.Length == 0 && stringData.ValueLength == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
stringTable.Children = [.. stringTableChildren];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.4.0</Version>
|
||||
<Version>1.4.1</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
|
||||
@@ -424,7 +424,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled information block on success, null on error</returns>
|
||||
private static InformationBlock? ParseInformationBlock(Stream data)
|
||||
public static InformationBlock? ParseInformationBlock(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var informationBlock = new InformationBlock();
|
||||
@@ -491,7 +491,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled object table entry on success, null on error</returns>
|
||||
private static ObjectTableEntry ParseObjectTableEntry(Stream data)
|
||||
public static ObjectTableEntry ParseObjectTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ObjectTableEntry();
|
||||
@@ -511,7 +511,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled object page map entry on success, null on error</returns>
|
||||
private static ObjectPageMapEntry ParseObjectPageMapEntry(Stream data)
|
||||
public static ObjectPageMapEntry ParseObjectPageMapEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ObjectPageMapEntry();
|
||||
@@ -528,7 +528,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled resource table entry on success, null on error</returns>
|
||||
private static ResourceTableEntry ParseResourceTableEntry(Stream data)
|
||||
public static ResourceTableEntry ParseResourceTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ResourceTableEntry();
|
||||
@@ -547,7 +547,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled resident names table entry on success, null on error</returns>
|
||||
private static ResidentNamesTableEntry ParseResidentNamesTableEntry(Stream data)
|
||||
public static ResidentNamesTableEntry ParseResidentNamesTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ResidentNamesTableEntry();
|
||||
@@ -569,7 +569,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled entry table bundle on success, null on error</returns>
|
||||
private static EntryTableBundle? ParseEntryTableBundle(Stream data)
|
||||
public static EntryTableBundle? ParseEntryTableBundle(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var bundle = new EntryTableBundle();
|
||||
@@ -632,7 +632,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled module format directives table entry on success, null on error</returns>
|
||||
private static ModuleFormatDirectivesTableEntry ParseModuleFormatDirectivesTableEntry(Stream data)
|
||||
public static ModuleFormatDirectivesTableEntry ParseModuleFormatDirectivesTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ModuleFormatDirectivesTableEntry();
|
||||
@@ -649,7 +649,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled verify record directive table entry on success, null on error</returns>
|
||||
private static VerifyRecordDirectiveTableEntry ParseVerifyRecordDirectiveTableEntry(Stream data)
|
||||
public static VerifyRecordDirectiveTableEntry ParseVerifyRecordDirectiveTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new VerifyRecordDirectiveTableEntry();
|
||||
@@ -670,7 +670,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled fix-up page table entry on success, null on error</returns>
|
||||
private static FixupPageTableEntry ParseFixupPageTableEntry(Stream data)
|
||||
public static FixupPageTableEntry ParseFixupPageTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new FixupPageTableEntry();
|
||||
@@ -685,7 +685,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled fix-up record table entry on success, null on error</returns>
|
||||
private static FixupRecordTableEntry? ParseFixupRecordTableEntry(Stream data)
|
||||
public static FixupRecordTableEntry? ParseFixupRecordTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new FixupRecordTableEntry();
|
||||
@@ -904,7 +904,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled import module name table entry on success, null on error</returns>
|
||||
private static ImportModuleNameTableEntry ParseImportModuleNameTableEntry(Stream data)
|
||||
public static ImportModuleNameTableEntry ParseImportModuleNameTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ImportModuleNameTableEntry();
|
||||
@@ -925,7 +925,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled import module name table entry on success, null on error</returns>
|
||||
private static ImportModuleProcedureNameTableEntry ParseImportModuleProcedureNameTableEntry(Stream data)
|
||||
public static ImportModuleProcedureNameTableEntry ParseImportModuleProcedureNameTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new ImportModuleProcedureNameTableEntry();
|
||||
@@ -946,7 +946,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled per-page checksum table entry on success, null on error</returns>
|
||||
private static PerPageChecksumTableEntry ParsePerPageChecksumTableEntry(Stream data)
|
||||
public static PerPageChecksumTableEntry ParsePerPageChecksumTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new PerPageChecksumTableEntry();
|
||||
@@ -961,7 +961,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled non-resident names table entry on success, null on error</returns>
|
||||
private static NonResidentNamesTableEntry ParseNonResidentNameTableEntry(Stream data)
|
||||
public static NonResidentNamesTableEntry ParseNonResidentNameTableEntry(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entry = new NonResidentNamesTableEntry();
|
||||
@@ -984,7 +984,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="size">Total size of the debug information</param>
|
||||
/// <returns>Filled debug information on success, null on error</returns>
|
||||
private static DebugInformation? ParseDebugInformation(Stream data, long size)
|
||||
public static DebugInformation? ParseDebugInformation(Stream data, long size)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var debugInformation = new DebugInformation();
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled executable header on success, null on error</returns>
|
||||
private static ExecutableHeader? ParseExecutableHeader(Stream data)
|
||||
public static ExecutableHeader? ParseExecutableHeader(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var header = new ExecutableHeader();
|
||||
@@ -266,7 +266,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="count">Number of segment table entries to read</param>
|
||||
/// <returns>Filled segment table on success, null on error</returns>
|
||||
private static SegmentTableEntry[] ParseSegmentTable(Stream data, int count)
|
||||
public static SegmentTableEntry[] ParseSegmentTable(Stream data, int count)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var segmentTable = new SegmentTableEntry[count];
|
||||
@@ -290,7 +290,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="count">Number of resource table entries to read</param>
|
||||
/// <returns>Filled resource table on success, null on error</returns>
|
||||
private static ResourceTable ParseResourceTable(Stream data, int count)
|
||||
public static ResourceTable ParseResourceTable(Stream data, int count)
|
||||
{
|
||||
long initialOffset = data.Position;
|
||||
|
||||
@@ -355,7 +355,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="endOffset">First address not part of the resident-name table</param>
|
||||
/// <returns>Filled resident-name table on success, null on error</returns>
|
||||
private static ResidentNameTableEntry[] ParseResidentNameTable(Stream data, int endOffset)
|
||||
public static ResidentNameTableEntry[] ParseResidentNameTable(Stream data, int endOffset)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var residentNameTable = new List<ResidentNameTableEntry>();
|
||||
@@ -378,7 +378,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="count">Number of module-reference table entries to read</param>
|
||||
/// <returns>Filled module-reference table on success, null on error</returns>
|
||||
private static ModuleReferenceTableEntry[] ParseModuleReferenceTable(Stream data, int count)
|
||||
public static ModuleReferenceTableEntry[] ParseModuleReferenceTable(Stream data, int count)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var moduleReferenceTable = new ModuleReferenceTableEntry[count];
|
||||
@@ -399,7 +399,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="endOffset">First address not part of the imported-name table</param>
|
||||
/// <returns>Filled imported-name table on success, null on error</returns>
|
||||
private static Dictionary<ushort, ImportedNameTableEntry?> ParseImportedNameTable(Stream data, int endOffset)
|
||||
public static Dictionary<ushort, ImportedNameTableEntry?> ParseImportedNameTable(Stream data, int endOffset)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var importedNameTable = new Dictionary<ushort, ImportedNameTableEntry?>();
|
||||
@@ -422,7 +422,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="endOffset">First address not part of the entry table</param>
|
||||
/// <returns>Filled entry table on success, null on error</returns>
|
||||
private static EntryTableBundle[] ParseEntryTable(Stream data, int endOffset)
|
||||
public static EntryTableBundle[] ParseEntryTable(Stream data, int endOffset)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var entryTable = new List<EntryTableBundle>();
|
||||
@@ -461,7 +461,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="endOffset">First address not part of the nonresident-name table</param>
|
||||
/// <returns>Filled nonresident-name table on success, null on error</returns>
|
||||
private static NonResidentNameTableEntry[] ParseNonResidentNameTable(Stream data, int endOffset)
|
||||
public static NonResidentNameTableEntry[] ParseNonResidentNameTable(Stream data, int endOffset)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var residentNameTable = new List<NonResidentNameTableEntry>();
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled executable header on success, null on error</returns>
|
||||
private static COFFFileHeader ParseCOFFFileHeader(Stream data)
|
||||
public static COFFFileHeader ParseCOFFFileHeader(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var fileHeader = new COFFFileHeader();
|
||||
@@ -314,7 +314,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="optionalSize">Size of the optional header</param>
|
||||
/// <returns>Filled optional header on success, null on error</returns>
|
||||
private static OptionalHeader ParseOptionalHeader(Stream data, int optionalSize)
|
||||
public static OptionalHeader ParseOptionalHeader(Stream data, int optionalSize)
|
||||
{
|
||||
long initialOffset = data.Position;
|
||||
|
||||
@@ -484,7 +484,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="count">Number of section table entries to read</param>
|
||||
/// <returns>Filled section table on success, null on error</returns>
|
||||
private static SectionHeader[] ParseSectionTable(Stream data, int count)
|
||||
public static SectionHeader[] ParseSectionTable(Stream data, int count)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var sectionTable = new SectionHeader[count];
|
||||
@@ -524,7 +524,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="count">Number of COFF symbol table entries to read</param>
|
||||
/// <returns>Filled COFF symbol table on success, null on error</returns>
|
||||
private static COFFSymbolTableEntry[] ParseCOFFSymbolTable(Stream data, uint count)
|
||||
public static COFFSymbolTableEntry[] ParseCOFFSymbolTable(Stream data, uint count)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var coffSymbolTable = new COFFSymbolTableEntry[count];
|
||||
@@ -681,7 +681,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled COFF string table on success, null on error</returns>
|
||||
private static COFFStringTable ParseCOFFStringTable(Stream data)
|
||||
public static COFFStringTable ParseCOFFStringTable(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var coffStringTable = new COFFStringTable();
|
||||
@@ -712,7 +712,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="endOffset">First address not part of the attribute certificate table</param>
|
||||
/// <returns>Filled attribute certificate on success, null on error</returns>
|
||||
private static AttributeCertificateTableEntry[] ParseAttributeCertificateTable(Stream data, int endOffset)
|
||||
public static AttributeCertificateTableEntry[] ParseAttributeCertificateTable(Stream data, int endOffset)
|
||||
{
|
||||
var attributeCertificateTable = new List<AttributeCertificateTableEntry>();
|
||||
|
||||
@@ -743,7 +743,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// </summary>
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <returns>Filled delay-load directory table on success, null on error</returns>
|
||||
private static DelayLoadDirectoryTable ParseDelayLoadDirectoryTable(Stream data)
|
||||
public static DelayLoadDirectoryTable ParseDelayLoadDirectoryTable(Stream data)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var delayLoadDirectoryTable = new DelayLoadDirectoryTable();
|
||||
@@ -767,7 +767,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="endOffset">First address not part of the base relocation table</param>
|
||||
/// <param name="sections">Section table to use for virtual address translation</param>
|
||||
/// <returns>Filled base relocation table on success, null on error</returns>
|
||||
private static BaseRelocationBlock[] ParseBaseRelocationTable(Stream data, int endOffset, SectionHeader?[] sections)
|
||||
public static BaseRelocationBlock[] ParseBaseRelocationTable(Stream data, int endOffset, SectionHeader?[] sections)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var baseRelocationTable = new List<BaseRelocationBlock>();
|
||||
@@ -808,7 +808,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="endOffset">First address not part of the debug table</param>
|
||||
/// <param name="sections">Section table to use for virtual address translation</param>
|
||||
/// <returns>Filled debug table on success, null on error</returns>
|
||||
private static DebugTable ParseDebugTable(Stream data, int endOffset, SectionHeader?[] sections)
|
||||
public static DebugTable ParseDebugTable(Stream data, int endOffset, SectionHeader?[] sections)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var debugTable = new DebugTable();
|
||||
@@ -845,7 +845,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="data">Stream to parse</param>
|
||||
/// <param name="sections">Section table to use for virtual address translation</param>
|
||||
/// <returns>Filled export table on success, null on error</returns>
|
||||
private static ExportTable ParseExportTable(Stream data, SectionHeader?[] sections)
|
||||
public static ExportTable ParseExportTable(Stream data, SectionHeader?[] sections)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var exportTable = new ExportTable();
|
||||
@@ -962,7 +962,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="magic">Optional header magic number indicating PE32 or PE32+</param>
|
||||
/// <param name="sections">Section table to use for virtual address translation</param>
|
||||
/// <returns>Filled import table on success, null on error</returns>
|
||||
private static ImportTable ParseImportTable(Stream data, OptionalHeaderMagicNumber magic, SectionHeader?[] sections)
|
||||
public static ImportTable ParseImportTable(Stream data, OptionalHeaderMagicNumber magic, SectionHeader?[] sections)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var importTable = new ImportTable();
|
||||
@@ -1187,7 +1187,7 @@ namespace SabreTools.Serialization.Streams
|
||||
/// <param name="sections">Section table to use for virtual address translation</param>
|
||||
/// <param name="topLevel">Indicates if this is the top level or not</param>
|
||||
/// <returns>Filled resource directory table on success, null on error</returns>
|
||||
private static ResourceDirectoryTable? ParseResourceDirectoryTable(Stream data, long initialOffset, SectionHeader?[] sections, bool topLevel = false)
|
||||
public static ResourceDirectoryTable? ParseResourceDirectoryTable(Stream data, long initialOffset, SectionHeader?[] sections, bool topLevel = false)
|
||||
{
|
||||
// TODO: Use marshalling here instead of building
|
||||
var resourceDirectoryTable = new ResourceDirectoryTable();
|
||||
|
||||
Reference in New Issue
Block a user