Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify reserved_flag2 for GC injections #23

Merged
merged 2 commits into from
Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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