Skip to content

Xbox ISO Support#81

Merged
mnadareski merged 4 commits intoSabreTools:mainfrom
Deterous:xboxiso
Apr 13, 2026
Merged

Xbox ISO Support#81
mnadareski merged 4 commits intoSabreTools:mainfrom
Deterous:xboxiso

Conversation

@Deterous
Copy link
Copy Markdown
Member

New model for Xbox / Xbox360 disc images. Supports printing and extraction of Xbox / Xbox 360 redump-style ISO files (both video and game partition), through dual ISO9660 and XDVDFS wrappers.

DiscImage is "higher level" than tracks/volumes as it is intended to represent the entire disc (which consists of two separate volumes/tracks). For simplicity, I have not explicitly added padding bytes between the two partitions, and have added a single "XGDType" field in the DiscImage model to indicate which disc type it is (for ease of determining the XDVDFS game partition offset and length in the stream). The constants value will need updating in the future if new disc types are found (pre-production discs with unusual offsets/lengths).

@Deterous Deterous changed the title Xboxiso Xbox ISO Support Apr 13, 2026
/// </summary>
/// <param name="data">Stream representing the XboxISO DiscImage</param>
/// <returns>An XboxISO DiscImage DiscImage on success, null on failure</returns>
public static XboxISO? Create(Stream? data)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll admit that this wasn't quite what I was expecting, but it certainly works for now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If you think there's a nicer way feel free to tell me, I think its elegant enough (at least the idea, not necessarily my implementation)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was expecting most of this logic to live in a reader, not the wrapper directly. This is a unique situation all around so that will take some thinking if that's appropriate or not.

Copy link
Copy Markdown
Member Author

@Deterous Deterous Apr 13, 2026

Choose a reason for hiding this comment

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

Because it is possible for standard ISOs to "look like" Xbox ISOs purely based on the sector count, my implementation is intended to prevent wasted compute. Serialization would waste a lot of effort reading the ISO9660 to then later realize that it is not in fact an Xbox ISO, then WrapperFactory would go ahead and parse the entire ISO again. This logic could be moved into a reader, but I figure that there's no unique reading going on, it doesn't make sense to add a dummy reader (a new model definitel make sense, at least). All the wrapper is doing is some logic to read some magic bytes, before calling the two sub-readers.

var videoWrapper = new SabreTools.Wrappers.ISO9660(VideoPartition, _dataSource, initialOffset, _dataSource.Length);
bool success = videoWrapper?.Extract(outputDirectory, includeDebug) ?? false;

var gameWrapper = new SabreTools.Wrappers.XDVDFS(GamePartition, _dataSource, initialOffset + Constants.XisoOffsets[XGDType], Constants.XisoLengths[XGDType]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick: Is it ever possible for the type and array to mismatch?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Only if the code is bad. I have the possible types defined in the wrapper constructor, and the length of the array defined in the model's constants

@mnadareski mnadareski merged commit 0e5380a into SabreTools:main Apr 13, 2026
1 check passed
@Deterous Deterous deleted the xboxiso branch April 13, 2026 13:42
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