diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 26a786ee..bed3dfc2 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 9aaa23b2..59ee20dc 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index a1e56f13..43c78974 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index f0abc0f0..d7659d33 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index 03e54a0c..889bffc4 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Switch_Toolbox_Library/FileFormats/SizeTables/RSTB.cs b/Switch_Toolbox_Library/FileFormats/SizeTables/RSTB.cs index 94b3624e..7bea4440 100644 --- a/Switch_Toolbox_Library/FileFormats/SizeTables/RSTB.cs +++ b/Switch_Toolbox_Library/FileFormats/SizeTables/RSTB.cs @@ -265,7 +265,7 @@ namespace Switch_Toolbox.Library float.TryParse(value, out output); } - public int CalculateFileSize(string FileName, byte[] Data, bool IsWiiU,bool IsYaz0Compressed, bool Force) + public int CalculateFileSize(string FileName, byte[] Data, bool IsWiiU, bool IsYaz0Compressed, bool Force) { return CalculateFileSizeByExtension(FileName, Data, IsWiiU, System.IO.Path.GetExtension(FileName), IsYaz0Compressed, Force); } @@ -285,10 +285,26 @@ namespace Switch_Toolbox.Library } } else + { Size = (int)new System.IO.FileInfo(FileName).Length; + } } else - Size = Data.Length; + { + if (IsYaz0Compressed) + { + using (var reader = new FileReader(new System.IO.MemoryStream(Data))) + { + reader.ByteOrder = Syroot.BinaryData.ByteOrder.BigEndian; + reader.Seek(4, System.IO.SeekOrigin.Begin); + Size = reader.ReadInt32(); + } + } + else + { + Size = Data.Length; + } + } byte[] FileData = Data;