public DOL(string pathToExtractDirectory, ISOExtractor extractor) { Path = pathToExtractDirectory; var fileName = $"{Path}/{FileName}"; ExtractedFile = fileName.GetNewStream(); Offset = (int)extractor.ISOStream.GetUIntAtOffset(DOLStartOffsetLocation); var size = DolHeaderSize; for (int i = 0; i < DolSectionSizesCount; i++) { var offset = Offset + (i * 4) + DolSectionSizesStart; size += (int)extractor.ISOStream.GetUIntAtOffset(offset); } Size = size; if (Configuration.Verbose) { Console.WriteLine($"DOL Size: {Size:X}"); } extractor.ISOStream.CopySubStream(ExtractedFile, Offset, Size); ExtractedFile.Flush(); }
public FST(string pathToExtractDirectory, ISOExtractor extractor) { Path = pathToExtractDirectory; FileName = "Game.toc"; ExtractedFile = $"{Path}/{FileName}".GetNewStream(); // load toc Offset = (int)extractor.ISOStream.GetUIntAtOffset(TOCStartOffsetLocation); Size = (int)extractor.ISOStream.GetUIntAtOffset(TOCFileSizeLocation); if (Configuration.Verbose) { Console.WriteLine("Reading TOC from ISO"); Console.WriteLine($"TOC Start: {Offset:X}"); Console.WriteLine($"TOC Length: {Size:X}"); } // write to disk extractor.ISOStream.CopySubStream(ExtractedFile, Offset, Size); ExtractedFile.Flush(); Load(); }