Skip to content

Commit

Permalink
Merge pull request #23 from danny8376/gc_romcode_fix
Browse files Browse the repository at this point in the history
Modify reserved_flag2 for GC injections
  • Loading branch information
ZestyTS committed Jun 16, 2022
2 parents 4aceb9e + a655047 commit 2078c58
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion UWUVCI AIO WPF/Classes/Injection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,10 +1290,27 @@ 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;

//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(Path.Combine(tempPath, "TempBase", "files", "game.iso"), 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
Directory.Delete(Path.Combine(tempPath, "TempBase"), true);
mvvm.Progress = 55;

mvm.msg = "Replacing TIK and TMD...";
using (Process extract = new Process())
{
Expand Down

0 comments on commit 2078c58

Please sign in to comment.