Skip to content

Add sim parsing for Steam2 sim/sid installers#95

Open
HeroponRikiBestest wants to merge 2 commits into
SabreTools:mainfrom
HeroponRikiBestest:main
Open

Add sim parsing for Steam2 sim/sid installers#95
HeroponRikiBestest wants to merge 2 commits into
SabreTools:mainfrom
HeroponRikiBestest:main

Conversation

@HeroponRikiBestest

@HeroponRikiBestest HeroponRikiBestest commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This PR adds sim parsing for the steam2 installer sim/sid set. Sid parsing will come in a later PR. Sid parsing won't be included in the main serialization for similar reasons as for why MSCABs currently do not have their data parsed unless you're extracting.

{
public static readonly byte[] SimSignatureBytes = [0x1F, 0x4C, 0xD0, 0x3F];

public const uint SimSignatureUInt32 = 0x3FD04C1F; // All other values in the structure are little endian, assuming this is too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The postfix comment can be made into a <remarks>

Comment thread SabreTools.Data.Models/Steam2Installer/FileEntry.cs
/// <summary>
/// The set of sid file volumes
/// </summary>
// public SidFile[] Sid { get; set; } = new();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this gets uncommented at some point, the proper syntax would be [] not new().

{
// Cache the current offset
long initialOffset = data.Position;
// Create a new Steam2 Installer set to populate

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Newline before this comment

}
}

public static SimFile? ParseSim(Stream data)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Generic Parse summary should be added.


// Try to parse the entry table
var table = ParseTable(data, fileEntriesCount, stringsBytes);
if (table == null || table.Length != fileEntriesCount)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Currently prefer the is null syntax instead of == null


// Read file path and name strings
int nameOffset = (int)obj.NameOffset;
int pathOffset = (int)obj.PathOffset;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: You can move the pathOffset creation to above the path read.

// Read file path and name strings
int nameOffset = (int)obj.NameOffset;
int pathOffset = (int)obj.PathOffset;
string? name = stringsBytes.ReadNullTerminatedAnsiString(ref nameOffset); // Unsure on encoding, assumed ascii/ansi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an empty string be valid for either of these cases? Like if it was just \0 is that possible?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as far as I'm aware or have seen.

I don't think an empty string would be a valid case, we've certainly never encountered one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants