diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs index 49a6f1b..bb179a6 100644 --- a/AssemblyInfo.cs +++ b/AssemblyInfo.cs @@ -3,14 +3,14 @@ using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyTitle("libWiiSharp_Modified")] -[assembly: AssemblyDescription("A wii related .NET library modified to add features for othe programs.")] +[assembly: AssemblyDescription("A wii related .NET library modified to add features for other programs.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Leathl,SC reproductions")] [assembly: AssemblyProduct("libWiiSharp_Modified")] -[assembly: AssemblyCopyright("Copyright © Leathl 2011, Copyright © Github Contributors 2020")] +[assembly: AssemblyCopyright("Copyright © Leathl 2011, Copyright © Github Contributors 2020-2022")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(true)] [assembly: Guid("af701263-5875-4866-9c09-d7f62e9f0ff0")] -[assembly: AssemblyFileVersion("0.4.0.0")] +[assembly: AssemblyFileVersion("0.6.0.0")] [assembly: NeutralResourcesLanguage("en")] -[assembly: AssemblyVersion("0.4.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.6.0.0")] \ No newline at end of file diff --git a/BNS.cs b/BNS.cs index 25a1215..c681323 100644 --- a/BNS.cs +++ b/BNS.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/Brlan.cs b/Brlan.cs index 051731c..0f3c731 100644 --- a/Brlan.cs +++ b/Brlan.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/Brlyt.cs b/Brlyt.cs index 64734c2..85c299e 100644 --- a/Brlyt.cs +++ b/Brlyt.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/CertificateChain.cs b/CertificateChain.cs index 5ee82ca..c154c97 100644 --- a/CertificateChain.cs +++ b/CertificateChain.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/CommonKey.cs b/CommonKey.cs index 8d0851d..7cad39a 100644 --- a/CommonKey.cs +++ b/CommonKey.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/ContentIndices.cs b/ContentIndices.cs index b61a1d9..6e77bdf 100644 --- a/ContentIndices.cs +++ b/ContentIndices.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/HbcTransmitter.cs b/HbcTransmitter.cs index efc14f8..1b88d7f 100644 --- a/HbcTransmitter.cs +++ b/HbcTransmitter.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/Headers.cs b/Headers.cs index 066a31f..255d0bd 100644 --- a/Headers.cs +++ b/Headers.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/HexView.cs b/HexView.cs index 6373f7a..a993d40 100644 --- a/HexView.cs +++ b/HexView.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/IosPatcher.cs b/IosPatcher.cs index 3a50e68..df310ff 100644 --- a/IosPatcher.cs +++ b/IosPatcher.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp -*Copyright(C) 2009 Leathl -* Copyright(C) 2020 - 2021 Github Contributors + * Copyright(C) 2009 Leathl + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/Licenses/SkiaSharp.license b/Licenses/SkiaSharp.license new file mode 100644 index 0000000..aaa5965 --- /dev/null +++ b/Licenses/SkiaSharp.license @@ -0,0 +1,9 @@ +MIT License +Copyright (c) 2015-2016 Xamarin, Inc. +Copyright (c) 2017-2018 Microsoft Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Lz77.cs b/Lz77.cs index 5367c3f..8c4ec81 100644 --- a/Lz77.cs +++ b/Lz77.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/MessageEventArgs.cs b/MessageEventArgs.cs index 15b461e..4f04767 100644 --- a/MessageEventArgs.cs +++ b/MessageEventArgs.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/NusClient.cs b/NusClient.cs index aa777ed..1463423 100644 --- a/NusClient.cs +++ b/NusClient.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -36,7 +36,9 @@ namespace libWiiSharp public class NusClient : IDisposable { private const string nusUrl = "http://nus.cdn.shop.wii.com/ccs/download/"; +#pragma warning disable SYSLIB0014 // Type or member is obsolete private readonly WebClient wcNus = new WebClient(); +#pragma warning restore SYSLIB0014 // Type or member is obsolete private bool useLocalFiles; private bool continueWithoutTicket; private bool isDisposed; @@ -182,7 +184,6 @@ namespace libWiiSharp if (!File.Exists("cetk") && !continueWithoutTicket) { FireDebug(" Downloading Ticket..."); - Console.WriteLine("Downloading"); try { byte[] tikArray = wcNus.DownloadData(str2 + "cetk"); @@ -193,7 +194,6 @@ namespace libWiiSharp throw new Exception("CETK Doesn't Exist and Downloading Ticket Failed:\n" + ex.Message); } } - Console.WriteLine("Continuing"); FireDebug("Parsing Ticket..."); Ticket tik = Ticket.Load("cetk"); FireProgress(40); @@ -474,6 +474,7 @@ namespace libWiiSharp byte[] bytes = BitConverter.GetBytes(tmd.Contents[contentIndex].Index); numArray[0] = bytes[1]; numArray[1] = bytes[0]; +#pragma warning disable SYSLIB0022 // Type or member is obsolete RijndaelManaged rijndaelManaged = new RijndaelManaged { Mode = CipherMode.CBC, @@ -483,6 +484,7 @@ namespace libWiiSharp Key = titleKey, IV = numArray }; +#pragma warning restore SYSLIB0022 // Type or member is obsolete ICryptoTransform decryptor = rijndaelManaged.CreateDecryptor(); MemoryStream memoryStream = new MemoryStream(content); CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read); diff --git a/README.md b/README.md index de3ed9f..be936aa 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # libWiiSharp -libWiiSharp is a Wii related .NET (2.0+) library. +libWiiSharp is a Wii related .NET library running on .Net 6 LTS. It can be used with any .NET language to easily develop Wii related applications. -It was originally created by Leathl, and the maintainer of [this repo](https://github.com/TheShadowEevee/libWiiSharp) is [TheShadowEevee](https://github.com/TheShadowEevee). +Originally created by Leathl, The current maintainer of [this repo](https://github.com/TheShadowEevee/libWiiSharp) is [TheShadowEevee](https://github.com/TheShadowEevee). All public functions are documented and most should be pretty self-explanatory. @@ -16,6 +16,8 @@ If you want to contribute, you can do so at [the github repo](https://github.com libWiiSharp is released under the terms of the GNU General Public License v3. See the LICENSE file for more info +TPL code uses SkiaSharp, which is released under the MIT License. See the Licenses folder for information. + ## Credits From the original libWiiSharp: - Xuzz, SquidMan, megazig, Matt_P, Omega and The Lemon Man for Wii.py diff --git a/Shared.cs b/Shared.cs index ba87464..538a937 100644 --- a/Shared.cs +++ b/Shared.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/TMD.cs b/TMD.cs index df3402b..32d428b 100644 --- a/TMD.cs +++ b/TMD.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/TPL.cs b/TPL.cs index acf2182..099aaf5 100644 --- a/TPL.cs +++ b/TPL.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -22,8 +22,7 @@ using System; using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Imaging; +using SkiaSharp; using System.IO; using System.Runtime.InteropServices; @@ -52,7 +51,7 @@ namespace libWiiSharp RGB5A3 = 2, None = 255, // 0x000000FF } - + public class TPL : IDisposable { private TPL_Header tplHeader = new TPL_Header(); @@ -147,11 +146,11 @@ namespace libWiiSharp } public static TPL FromImage( - Image img, + SKBitmap img, TPL_TextureFormat tplFormat, TPL_PaletteFormat paletteFormat = TPL_PaletteFormat.RGB5A3) { - return FromImages(new Image[1] { img }, new TPL_TextureFormat[1] + return FromImages(new SKBitmap[1] { img }, new TPL_TextureFormat[1] { tplFormat }, new TPL_PaletteFormat[1] { paletteFormat }); @@ -167,10 +166,10 @@ namespace libWiiSharp throw new Exception("You must specify a format for each image!"); } - List imageList = new List(); + List imageList = new List(); foreach (string imagePath in imagePaths) { - imageList.Add(Image.FromFile(imagePath)); + imageList.Add(SKBitmap.Decode(imagePath)); } TPL tpl = new TPL(); @@ -179,7 +178,7 @@ namespace libWiiSharp } public static TPL FromImages( - Image[] images, + SKBitmap[] images, TPL_TextureFormat[] tplFormats, TPL_PaletteFormat[] paletteFormats) { @@ -240,11 +239,11 @@ namespace libWiiSharp } public void CreateFromImage( - Image img, + SKBitmap img, TPL_TextureFormat tplFormat, TPL_PaletteFormat paletteFormat = TPL_PaletteFormat.RGB5A3) { - PrivCreateFromImages(new Image[1] { img }, new TPL_TextureFormat[1] + PrivCreateFromImages(new SKBitmap[1] { img }, new TPL_TextureFormat[1] { tplFormat }, new TPL_PaletteFormat[1] { paletteFormat }); @@ -260,17 +259,17 @@ namespace libWiiSharp throw new Exception("You must specify a format for each image!"); } - List imageList = new List(); + List imageList = new List(); foreach (string imagePath in imagePaths) { - imageList.Add(Image.FromFile(imagePath)); + imageList.Add(SKBitmap.Decode(imagePath)); } PrivCreateFromImages(imageList.ToArray(), tplFormats, paletteFormats); } public void CreateFromImages( - Image[] images, + SKBitmap[] images, TPL_TextureFormat[] tplFormats, TPL_PaletteFormat[] paletteFormats) { @@ -322,12 +321,12 @@ namespace libWiiSharp return ToMemoryStream().ToArray(); } - public Image ExtractTexture() + public SKBitmap ExtractTexture() { return ExtractTexture(0); } - public Image ExtractTexture(int index) + public SKBitmap ExtractTexture(int index) { byte[] data = tplTextureHeaders[index].TextureFormat switch { @@ -359,32 +358,51 @@ namespace libWiiSharp File.Delete(savePath); } - Image texture = ExtractTexture(index); + SKBitmap texture = ExtractTexture(index); switch (Path.GetExtension(savePath).ToLower()) { - case ".tif": - case ".tiff": - texture.Save(savePath, ImageFormat.Tiff); + case ".webp": + SKData webp = SKImage.FromBitmap(texture).Encode(SKEncodedImageFormat.Webp, 100); + using (var filestream = File.OpenWrite(savePath)) + { + webp.SaveTo(filestream); + } break; case ".bmp": - texture.Save(savePath, ImageFormat.Bmp); + SKData bmp = SKImage.FromBitmap(texture).Encode(SKEncodedImageFormat.Bmp, 100); + using (var filestream = File.OpenWrite(savePath)) + { + bmp.SaveTo(filestream); + } break; case ".gif": - texture.Save(savePath, ImageFormat.Gif); + SKData gif = SKImage.FromBitmap(texture).Encode(SKEncodedImageFormat.Gif, 100); + using (var filestream = File.OpenWrite(savePath)) + { + gif.SaveTo(filestream); + } break; case ".jpg": case ".jpeg": - texture.Save(savePath, ImageFormat.Jpeg); + SKData jpeg = SKImage.FromBitmap(texture).Encode(SKEncodedImageFormat.Jpeg, 100); + using (var filestream = File.OpenWrite(savePath)) + { + jpeg.SaveTo(filestream); + } break; default: - texture.Save(savePath, ImageFormat.Png); + SKData png = SKImage.FromBitmap(texture).Encode(SKEncodedImageFormat.Png, 100); + using (var filestream = File.OpenWrite(savePath)) + { + png.SaveTo(filestream); + } break; } } - public Image[] ExtractAllTextures() + public SKBitmap[] ExtractAllTextures() { - List imageList = new List(); + List imageList = new List(); for (int index = 0; index < tplHeader.NumOfTextures; ++index) { imageList.Add(ExtractTexture(index)); @@ -411,10 +429,10 @@ namespace libWiiSharp TPL_TextureFormat tplFormat, TPL_PaletteFormat paletteFormat = TPL_PaletteFormat.RGB5A3) { - AddTexture(Image.FromFile(imagePath), tplFormat, paletteFormat); + AddTexture(SKBitmap.Decode(imagePath), tplFormat, paletteFormat); } - public void AddTexture(Image img, TPL_TextureFormat tplFormat, TPL_PaletteFormat paletteFormat = TPL_PaletteFormat.RGB5A3) + public void AddTexture(SKBitmap img, TPL_TextureFormat tplFormat, TPL_PaletteFormat paletteFormat = TPL_PaletteFormat.RGB5A3) { TPL_TextureEntry tplTextureEntry = new TPL_TextureEntry(); TPL_TextureHeader tplTextureHeader = new TPL_TextureHeader(); @@ -465,10 +483,10 @@ namespace libWiiSharp return (TPL_PaletteFormat)tplPaletteHeaders[index].PaletteFormat; } - public Size GetTextureSize(int index) + /*public Size GetTextureSize(int index) { return new Size(tplTextureHeaders[index].TextureWidth, tplTextureHeaders[index].TextureHeight); - } + }*/ private void WriteToStream(Stream writeStream) { @@ -657,7 +675,7 @@ namespace libWiiSharp } private void PrivCreateFromImages( - Image[] images, + SKBitmap[] images, TPL_TextureFormat[] tplFormats, TPL_PaletteFormat[] paletteFormats) { @@ -670,7 +688,7 @@ namespace libWiiSharp tplHeader.NumOfTextures = (uint)images.Length; for (int index = 0; index < images.Length; ++index) { - Image image = images[index]; + SKBitmap image = images[index]; TPL_TextureEntry tplTextureEntry = new TPL_TextureEntry(); TPL_TextureHeader tplTextureHeader = new TPL_TextureHeader(); TPL_PaletteHeader tplPaletteHeader = new TPL_PaletteHeader(); @@ -695,33 +713,30 @@ namespace libWiiSharp } } - private byte[] ImageToTpl(Image img, TPL_TextureFormat tplFormat) + private byte[] ImageToTpl(SKBitmap img, TPL_TextureFormat tplFormat) { return tplFormat switch { - TPL_TextureFormat.I4 => ToI4((Bitmap)img), - TPL_TextureFormat.I8 => ToI8((Bitmap)img), - TPL_TextureFormat.IA4 => ToIA4((Bitmap)img), - TPL_TextureFormat.IA8 => ToIA8((Bitmap)img), - TPL_TextureFormat.RGB565 => ToRGB565((Bitmap)img), - TPL_TextureFormat.RGB5A3 => ToRGB5A3((Bitmap)img), - TPL_TextureFormat.RGBA8 => ToRGBA8((Bitmap)img), + TPL_TextureFormat.I4 => ToI4(img), + TPL_TextureFormat.I8 => ToI8(img), + TPL_TextureFormat.IA4 => ToIA4(img), + TPL_TextureFormat.IA8 => ToIA8(img), + TPL_TextureFormat.RGB565 => ToRGB565(img), + TPL_TextureFormat.RGB5A3 => ToRGB5A3(img), + TPL_TextureFormat.RGBA8 => ToRGBA8(img), TPL_TextureFormat.CI4 or TPL_TextureFormat.CI8 or TPL_TextureFormat.CI14X2 => new byte[0], _ => throw new FormatException("Format not supported!\nCurrently, images can only be converted to the following formats:\nI4, I8, IA4, IA8, RGB565, RGB5A3, RGBA8, CI4, CI8 , CI14X2."), }; } - private uint[] ImageToRgba(Image img) + private uint[] ImageToRgba(SKBitmap bitmap) { - Bitmap bitmap = (Bitmap)img; - BitmapData bitmapdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); - byte[] numArray = new byte[bitmapdata.Height * Math.Abs(bitmapdata.Stride)]; - Marshal.Copy(bitmapdata.Scan0, numArray, 0, numArray.Length); - bitmap.UnlockBits(bitmapdata); + byte[] numArray = new byte[bitmap.Height * (Math.Abs(bitmap.Width) * 4)]; + Marshal.Copy(bitmap.GetAddress(0, 0), numArray, 0, numArray.Length); return Shared.ByteArrayToUIntArray(numArray); } - private Bitmap RgbaToImage(byte[] data, int width, int height) + private SKBitmap RgbaToImage(byte[] data, int width, int height) { if (width == 0) { @@ -733,12 +748,10 @@ namespace libWiiSharp height = 1; } - Bitmap bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); + SKBitmap bitmap = new SKBitmap(width, height); try { - BitmapData bitmapdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, bitmap.PixelFormat); - Marshal.Copy(data, 0, bitmapdata.Scan0, data.Length); - bitmap.UnlockBits(bitmapdata); + Marshal.Copy(data, 0, bitmap.GetAddress(0, 0), data.Length); return bitmap; } catch @@ -854,7 +867,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToRGBA8(Bitmap img) + private byte[] ToRGBA8(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; @@ -959,7 +972,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToRGB5A3(Bitmap img) + private byte[] ToRGB5A3(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; @@ -1038,7 +1051,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToRGB565(Bitmap img) + private byte[] ToRGB565(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; @@ -1103,7 +1116,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToI4(Bitmap img) + private byte[] ToI4(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; @@ -1163,7 +1176,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToI8(Bitmap img) + private byte[] ToI8(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; @@ -1222,7 +1235,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToIA4(Bitmap img) + private byte[] ToIA4(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; @@ -1281,7 +1294,7 @@ namespace libWiiSharp return Shared.UIntArrayToByteArray(array); } - private byte[] ToIA8(Bitmap img) + private byte[] ToIA8(SKBitmap img) { uint[] rgba = ImageToRgba(img); int width = img.Width; diff --git a/Ticket.cs b/Ticket.cs index 80a940d..9df78e7 100644 --- a/Ticket.cs +++ b/Ticket.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -489,6 +489,7 @@ namespace libWiiSharp byte[] numArray = commonKeyIndex == 1 ? CommonKey.GetKoreanKey() : CommonKey.GetStandardKey(); byte[] bytes = BitConverter.GetBytes(Shared.Swap(titleId)); Array.Resize(ref bytes, 16); +#pragma warning disable SYSLIB0022 // Type or member is obsolete RijndaelManaged rijndaelManaged = new RijndaelManaged { Mode = CipherMode.CBC, @@ -498,6 +499,7 @@ namespace libWiiSharp Key = numArray, IV = bytes }; +#pragma warning restore SYSLIB0022 // Type or member is obsolete ICryptoTransform decryptor = rijndaelManaged.CreateDecryptor(); MemoryStream memoryStream = new MemoryStream(encryptedTitleKey); CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read); @@ -514,6 +516,7 @@ namespace libWiiSharp byte[] numArray = commonKeyIndex == 1 ? CommonKey.GetKoreanKey() : CommonKey.GetStandardKey(); byte[] bytes = BitConverter.GetBytes(Shared.Swap(titleId)); Array.Resize(ref bytes, 16); +#pragma warning disable SYSLIB0022 // Type or member is obsolete RijndaelManaged rijndaelManaged = new RijndaelManaged { Mode = CipherMode.CBC, @@ -523,6 +526,7 @@ namespace libWiiSharp Key = numArray, IV = bytes }; +#pragma warning restore SYSLIB0022 // Type or member is obsolete ICryptoTransform encryptor = rijndaelManaged.CreateEncryptor(); MemoryStream memoryStream = new MemoryStream(decryptedTitleKey); CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Read); diff --git a/U8.cs b/U8.cs index 3f206c3..4060ac2 100644 --- a/U8.cs +++ b/U8.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/WAD.cs b/WAD.cs index 0f9a935..ab2bc0e 100644 --- a/WAD.cs +++ b/WAD.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -1007,6 +1007,7 @@ namespace libWiiSharp byte[] bytes = BitConverter.GetBytes(tmd.Contents[contentIndex].Index); numArray[0] = bytes[1]; numArray[1] = bytes[0]; +#pragma warning disable SYSLIB0022 // Type or member is obsolete RijndaelManaged rijndaelManaged = new RijndaelManaged { Mode = CipherMode.CBC, @@ -1016,6 +1017,7 @@ namespace libWiiSharp Key = titleKey, IV = numArray }; +#pragma warning restore SYSLIB0022 // Type or member is obsolete ICryptoTransform decryptor = rijndaelManaged.CreateDecryptor(); MemoryStream memoryStream = new MemoryStream(content); CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read); @@ -1034,6 +1036,7 @@ namespace libWiiSharp byte[] bytes = BitConverter.GetBytes(tmd.Contents[contentIndex].Index); numArray[0] = bytes[1]; numArray[1] = bytes[0]; +#pragma warning disable SYSLIB0022 // Type or member is obsolete RijndaelManaged rijndaelManaged = new RijndaelManaged { Mode = CipherMode.CBC, @@ -1043,6 +1046,7 @@ namespace libWiiSharp Key = titleKey, IV = numArray }; +#pragma warning restore SYSLIB0022 // Type or member is obsolete ICryptoTransform encryptor = rijndaelManaged.CreateEncryptor(); MemoryStream memoryStream = new MemoryStream(content); CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Read); diff --git a/Wave.cs b/Wave.cs index ef71a5e..bbdf015 100644 --- a/Wave.cs +++ b/Wave.cs @@ -1,6 +1,6 @@ /* This file is part of libWiiSharp * Copyright (C) 2009 Leathl - * Copyright (C) 2020 - 2021 Github Contributors + * Copyright (C) 2020 - 2022 TheShadowEevee, Github Contributors * * libWiiSharp is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published diff --git a/libWiiSharp.csproj b/libWiiSharp.csproj index 28c20fb..fae96e0 100644 --- a/libWiiSharp.csproj +++ b/libWiiSharp.csproj @@ -3,10 +3,11 @@ net6.0-windows latest Library - 0.4.0.0 + 0.6.0.0 false true true + annotations true @@ -17,13 +18,10 @@ - - - all - - - + + + \ No newline at end of file