diff --git a/NCMDump.Net.sln b/NCMDump.Net.sln index c2f7324..302f551 100644 --- a/NCMDump.Net.sln +++ b/NCMDump.Net.sln @@ -7,26 +7,26 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCMDumpCore", "NCMDumpCore\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCMDumpCLI", "NCMDumpCLI\NCMDumpCLI.csproj", "{4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NCMDumpGUI", "NCMDumpGUI\NCMDumpGUI.csproj", "{F4B097C1-58BB-4A79-8997-8225639D2A92}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCMDumpGUI", "NCMDumpGUI\NCMDumpGUI.csproj", "{F4B097C1-58BB-4A79-8997-8225639D2A92}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|Any CPU.Build.0 = Release|Any CPU - {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|Any CPU.Build.0 = Release|Any CPU - {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|Any CPU.Build.0 = Release|Any CPU + {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|x64.ActiveCfg = Debug|x64 + {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Debug|x64.Build.0 = Debug|x64 + {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|x64.ActiveCfg = Release|x64 + {6D29FF99-9A20-4AC2-8246-746C2AE4FB73}.Release|x64.Build.0 = Release|x64 + {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|x64.ActiveCfg = Debug|x64 + {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Debug|x64.Build.0 = Debug|x64 + {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|x64.ActiveCfg = Release|x64 + {4CB104C3-FE3A-4CF4-9910-5FB0150B22A6}.Release|x64.Build.0 = Release|x64 + {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|x64.ActiveCfg = Debug|x64 + {F4B097C1-58BB-4A79-8997-8225639D2A92}.Debug|x64.Build.0 = Debug|x64 + {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|x64.ActiveCfg = Release|x64 + {F4B097C1-58BB-4A79-8997-8225639D2A92}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NCMDumpCLI/NCMDumpCLI.csproj b/NCMDumpCLI/NCMDumpCLI.csproj index 7706245..b8f29a2 100644 --- a/NCMDumpCLI/NCMDumpCLI.csproj +++ b/NCMDumpCLI/NCMDumpCLI.csproj @@ -9,7 +9,8 @@ NCMDumpCLI.ico x64 app.manifest - 1.3.0 + 1.4.0 + x64 diff --git a/NCMDumpCLI/Program.cs b/NCMDumpCLI/Program.cs index b8b044a..cecd4e4 100644 --- a/NCMDumpCLI/Program.cs +++ b/NCMDumpCLI/Program.cs @@ -57,7 +57,6 @@ async void WalkThrough(DirectoryInfo dir) Console.WriteLine(); } - } } diff --git a/NCMDumpCore/NCMDump.cs b/NCMDumpCore/NCMDump.cs index 25eede4..954c349 100644 --- a/NCMDumpCore/NCMDump.cs +++ b/NCMDumpCore/NCMDump.cs @@ -11,19 +11,21 @@ public class NCMDump readonly byte[] coreKey = { 0x68, 0x7A, 0x48, 0x52, 0x41, 0x6D, 0x73, 0x6F, 0x35, 0x6B, 0x49, 0x6E, 0x62, 0x61, 0x78, 0x57 }; readonly byte[] metaKey = { 0x23, 0x31, 0x34, 0x6C, 0x6A, 0x6B, 0x5F, 0x21, 0x5C, 0x5D, 0x26, 0x30, 0x55, 0x3C, 0x27, 0x28 }; + public NCMDump() + { + } private bool ReadHeader(ref MemoryStream ms) { byte[] header = new byte[8]; - // Header Should be "CTENFDAM" ms.Read(header, 0, header.Length); - return Encoding.ASCII.GetString(header) == "CTENFDAM"; + // Header Should be "CTENFDAM" + return Enumerable.SequenceEqual(header, new byte[] { 067, 084, 069, 078, 070, 068, 065, 077 }); } private byte[] MakeKeybox(ref MemoryStream ms) { // read keybox length - uint KeyboxLength = ReadUint32(ms); - //Console.WriteLine($"AES Key Length: {KeyboxLength}"); + uint KeyboxLength = ReadUint32(ref ms); // read raw keybox data var buffer = new byte[KeyboxLength]; @@ -66,7 +68,7 @@ private byte[] MakeKeybox(ref MemoryStream ms) private MetaInfo ReadMeta(ref MemoryStream ms) { // read meta length - var MetaLength = ReadUint32(ms); + var MetaLength = ReadUint32(ref ms); var RawMetaData = new byte[MetaLength]; ms.Read(RawMetaData, 0, RawMetaData.Length); for (int i = 0; i < RawMetaData.Length; i++) @@ -194,7 +196,7 @@ void AddCover(TagLib.File tagfile) } } - private uint ReadUint32(MemoryStream ms) + private uint ReadUint32(ref MemoryStream ms) { byte[] buffer = new byte[4]; ms.Read(buffer, 0, buffer.Length); @@ -242,7 +244,7 @@ public async Task ConvertAsync(string path) ms.Seek(5, SeekOrigin.Current); // read image length - var ImageLength = ReadUint32(ms); + var ImageLength = ReadUint32(ref ms); byte[]? ImageData; if (ImageLength != 0) { diff --git a/NCMDumpCore/NCMDumpCore.csproj b/NCMDumpCore/NCMDumpCore.csproj index 503975d..fbcb88f 100644 --- a/NCMDumpCore/NCMDumpCore.csproj +++ b/NCMDumpCore/NCMDumpCore.csproj @@ -4,10 +4,11 @@ net6.0 enable enable - 1.3.0 + 1.4.0 x64 + x64 diff --git a/NCMDumpGUI/App.xaml b/NCMDumpGUI/App.xaml index bf4d84f..d82d4ef 100644 --- a/NCMDumpGUI/App.xaml +++ b/NCMDumpGUI/App.xaml @@ -4,6 +4,11 @@ xmlns:local="clr-namespace:NCMDumpGUI" StartupUri="MainWindow.xaml"> - + + + + + + diff --git a/NCMDumpGUI/MainWindow.xaml b/NCMDumpGUI/MainWindow.xaml index 455efbd..aef9fa9 100644 --- a/NCMDumpGUI/MainWindow.xaml +++ b/NCMDumpGUI/MainWindow.xaml @@ -1,41 +1,39 @@ - + mc:Ignorable="d" + BorderThickness ="0" + Style="{StaticResource WindowBlur}" + Title="NCMDumpGUI" + Height="480" Width="720" + Icon="/NCMDump.png" + MinWidth="720" MinHeight="480" + ResizeMode="CanResize" + WindowStartupLocation="CenterScreen" + AllowDrop="True" + Closed="Window_Closed"> - - + + - + - - - - - - - - - - + -