From 0d1e828d064fff669a9d0b60b068408d8d6a7f91 Mon Sep 17 00:00:00 2001 From: crskycode Date: Mon, 15 Mar 2021 04:21:53 +0800 Subject: [PATCH] Update Scheme Tool --- SchemeTool/Program.cs | 21 ++++++++++++++++++++- SchemeTool/SchemeTool.csproj | 14 ++++++++++++++ SchemeTool/packages.config | 7 +++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 SchemeTool/packages.config diff --git a/SchemeTool/Program.cs b/SchemeTool/Program.cs index a38e8bb6..d3699b25 100644 --- a/SchemeTool/Program.cs +++ b/SchemeTool/Program.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; @@ -25,7 +26,25 @@ namespace SchemeTool GameRes.Formats.KiriKiri.Xp3Scheme scheme = format.Scheme as GameRes.Formats.KiriKiri.Xp3Scheme; // Add scheme information here + +#if false + byte[] cb = File.ReadAllBytes(@"MEM_10014628_00001000.mem"); + var cb2 = MemoryMarshal.Cast(cb); + for (int i = 0; i < cb2.Length; i++) + cb2[i] = ~cb2[i]; + var cs = new GameRes.Formats.KiriKiri.CxScheme + { + Mask = 0x000, + Offset = 0x000, + PrologOrder = new byte[] { 0, 1, 2 }, + OddBranchOrder = new byte[] { 0, 1, 2, 3, 4, 5 }, + EvenBranchOrder = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }, + ControlBlock = cb2.ToArray() + }; + GameRes.Formats.KiriKiri.ICrypt crypt = new GameRes.Formats.KiriKiri.CxEncryption(cs); +#else GameRes.Formats.KiriKiri.ICrypt crypt = new GameRes.Formats.KiriKiri.XorCrypt(0x00); +#endif scheme.KnownSchemes.Add("game title", crypt); } @@ -36,7 +55,7 @@ namespace SchemeTool if (gameMap != null) { // Add file name here - gameMap.Add("file.exe", "game title"); + gameMap.Add("game.exe", "game title"); } // Save database diff --git a/SchemeTool/SchemeTool.csproj b/SchemeTool/SchemeTool.csproj index 9339af1e..c071caa8 100644 --- a/SchemeTool/SchemeTool.csproj +++ b/SchemeTool/SchemeTool.csproj @@ -34,7 +34,20 @@ + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + @@ -48,6 +61,7 @@ + diff --git a/SchemeTool/packages.config b/SchemeTool/packages.config new file mode 100644 index 00000000..b4c87a28 --- /dev/null +++ b/SchemeTool/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file