From 01b3c562b63dba598a40cf8e9bbdabfa7597dd13 Mon Sep 17 00:00:00 2001 From: DannyAAM Date: Mon, 25 Apr 2022 10:14:50 +0800 Subject: [PATCH 1/2] also replace romcode for gc injections --- UWUVCI AIO WPF/Classes/Injection.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/UWUVCI AIO WPF/Classes/Injection.cs b/UWUVCI AIO WPF/Classes/Injection.cs index f6c961d..e785839 100644 --- a/UWUVCI AIO WPF/Classes/Injection.cs +++ b/UWUVCI AIO WPF/Classes/Injection.cs @@ -1294,6 +1294,22 @@ private static void GC(string romPath, MainViewModel mvm, bool force) romPath = Path.Combine(tempPath, "game.iso"); mvvm.Progress = 50; + //GET ROMCODE and change it + mvm.msg = "Trying to save rom code..."; + //READ FIRST 4 BYTES + byte[] chars = new byte[4]; + FileStream fstrm = new FileStream(romPath, FileMode.Open); + fstrm.Read(chars, 0, 4); + fstrm.Close(); + string procod = ByteArrayToString(chars); + string metaXml = Path.Combine(baseRomPath, "meta", "meta.xml"); + XmlDocument doc = new XmlDocument(); + doc.Load(metaXml); + doc.SelectSingleNode("menu/reserved_flag2").InnerText = procod.ToHex(); + doc.Save(metaXml); + //edit emta.xml + mvvm.Progress = 55; + mvm.msg = "Replacing TIK and TMD..."; using (Process extract = new Process()) { From a6550478080d78080c0d0679364dcffbf6f1cc05 Mon Sep 17 00:00:00 2001 From: DannyAAM Date: Mon, 25 Apr 2022 10:34:17 +0800 Subject: [PATCH 2/2] fix for using correct iso file for rom code --- UWUVCI AIO WPF/Classes/Injection.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UWUVCI AIO WPF/Classes/Injection.cs b/UWUVCI AIO WPF/Classes/Injection.cs index e785839..79a7b84 100644 --- a/UWUVCI AIO WPF/Classes/Injection.cs +++ b/UWUVCI AIO WPF/Classes/Injection.cs @@ -1290,7 +1290,7 @@ private static void GC(string romPath, MainViewModel mvm, bool force) throw new Exception("WIIAn error occured while Creating the ISO"); } - Directory.Delete(Path.Combine(tempPath, "TempBase"), true); + //Directory.Delete(Path.Combine(tempPath, "TempBase"), true); romPath = Path.Combine(tempPath, "game.iso"); mvvm.Progress = 50; @@ -1298,7 +1298,7 @@ private static void GC(string romPath, MainViewModel mvm, bool force) mvm.msg = "Trying to save rom code..."; //READ FIRST 4 BYTES byte[] chars = new byte[4]; - FileStream fstrm = new FileStream(romPath, FileMode.Open); + FileStream fstrm = new FileStream(Path.Combine(tempPath, "TempBase", "files", "game.iso"), FileMode.Open); fstrm.Read(chars, 0, 4); fstrm.Close(); string procod = ByteArrayToString(chars); @@ -1308,6 +1308,7 @@ private static void GC(string romPath, MainViewModel mvm, bool force) doc.SelectSingleNode("menu/reserved_flag2").InnerText = procod.ToHex(); doc.Save(metaXml); //edit emta.xml + Directory.Delete(Path.Combine(tempPath, "TempBase"), true); mvvm.Progress = 55; mvm.msg = "Replacing TIK and TMD...";