From 78a45da09d111aea0a94e81f5453fc642fb69503 Mon Sep 17 00:00:00 2001 From: ZestyTS Date: Wed, 17 Aug 2022 17:22:15 -0700 Subject: [PATCH] Attempted to read key from otp.bin file --- .../Configurations/WiiConfig.xaml.cs | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/UWUVCI AIO WPF/UI/Frames/InjectFrames/Configurations/WiiConfig.xaml.cs b/UWUVCI AIO WPF/UI/Frames/InjectFrames/Configurations/WiiConfig.xaml.cs index bc37425..374e814 100644 --- a/UWUVCI AIO WPF/UI/Frames/InjectFrames/Configurations/WiiConfig.xaml.cs +++ b/UWUVCI AIO WPF/UI/Frames/InjectFrames/Configurations/WiiConfig.xaml.cs @@ -259,6 +259,30 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations } + public string ReadAncastFromOtp() + { + var ret = ""; + using (var dialog = new System.Windows.Forms.OpenFileDialog()) + { + dialog.Filter = "OTP.bin | otp.bin"; + var res = dialog.ShowDialog(); + if (res == System.Windows.Forms.DialogResult.OK) + { + var filepath = dialog.FileName; + var test = new byte[16]; + + using (var fs = new FileStream(filepath, FileMode.Open, FileAccess.Read)) + { + fs.Seek(0xE0, SeekOrigin.Begin); + fs.Read(test, 0, 16); + } + foreach (var b in test) + ret += string.Format("{0:X2}", b); + } + } + return ret; + } + private void InjectGame(object sender, RoutedEventArgs e) { if (File.Exists(tv.Text)) @@ -305,10 +329,6 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations } mvm.GameConfiguration.GameName = gn.Text; - /*TODO: Make this work - * - C2W_Patcher doesn't work, but idfk what it's supposed to do so /shrug - * - idfk what this shit is supposed to do - */ if (!string.IsNullOrEmpty(ancastKey.Text)) { ancastKey.Text = ancastKey.Text.ToUpper(); @@ -1048,7 +1068,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations private void ancast_OTP(object sender, RoutedEventArgs e) { - + ancastKey.Text = ReadAncastFromOtp(); } } }