From c179cf410b1536952175c8dc5dc2d5ad8aa67cd7 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Mon, 20 Apr 2026 12:59:39 +0900 Subject: [PATCH] XboxISO separate functions for partition extraction (#89) * XboxISO funcs for partition extraction * Add new parameter with default --- SabreTools.Wrappers/XboxISO.Extraction.cs | 29 +++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/SabreTools.Wrappers/XboxISO.Extraction.cs b/SabreTools.Wrappers/XboxISO.Extraction.cs index cd9b4b2b..2197b750 100644 --- a/SabreTools.Wrappers/XboxISO.Extraction.cs +++ b/SabreTools.Wrappers/XboxISO.Extraction.cs @@ -9,15 +9,30 @@ namespace SabreTools.Wrappers { long initialOffset = _dataSource.Position; - // Extract all files from the video partition - var videoWrapper = new ISO9660(VideoPartition, _dataSource, initialOffset, _dataSource.Length); - bool success = videoWrapper?.Extract(outputDirectory, includeDebug) ?? false; - - // Extract all files from the game partition - var gameWrapper = new XDVDFS(GamePartition, _dataSource, initialOffset + Constants.XisoOffsets[XGDType], Constants.XisoLengths[XGDType]); - success |= gameWrapper?.Extract(outputDirectory, includeDebug) ?? false; + bool success = ExtractVideoPartition(outputDirectory, includeDebug, initialOffset); + success |= ExtractGamePartition(outputDirectory, includeDebug); return success; } + + /// + /// Extract all files from the Video ISO partition only + /// + public bool ExtractVideoPartition(string outputDirectory, bool includeDebug, long initialOffset = 0) + { + // Extract all files from the video partition + var videoWrapper = new ISO9660(VideoPartition, _dataSource, initialOffset, _dataSource.Length); + return videoWrapper?.Extract(outputDirectory, includeDebug) ?? false; + } + + /// + /// Extract all files from the XDVDFS (XISO) game partition only + /// + public bool ExtractGamePartition(string outputDirectory, bool includeDebug, long initialOffset = 0) + { + // Extract all files from the game partition + var gameWrapper = new XDVDFS(GamePartition, _dataSource, initialOffset + Constants.XisoOffsets[XGDType], Constants.XisoLengths[XGDType]); + return gameWrapper?.Extract(outputDirectory, includeDebug) ?? false; + } } }