diff --git a/UWUVCI AIO WPF/Classes/Injection.cs b/UWUVCI AIO WPF/Classes/Injection.cs index 4da598a..42f268b 100644 --- a/UWUVCI AIO WPF/Classes/Injection.cs +++ b/UWUVCI AIO WPF/Classes/Injection.cs @@ -1269,11 +1269,11 @@ namespace UWUVCI_AIO_WPF if (gameName == null || gameName == string.Empty) gameName = "NoName"; Regex reg = new Regex("[^a-zA-Z0-9 é -]"); //string outputPath = Path.Combine(Properties.Settings.Default.InjectionPath, gameName); - string outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE]{reg.Replace(gameName,"")}"); + string outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE]{reg.Replace(gameName,"")} [{mvvm.prodcode}]"); int i = 0; while (Directory.Exists(outputPath)) { - outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE]{reg.Replace(gameName, "")}_{i}"); + outputPath = Path.Combine(Properties.Settings.Default.OutPath, $"[LOADIINE]{reg.Replace(gameName, "")} [{mvvm.prodcode}]_{i}"); i++; } @@ -1516,8 +1516,9 @@ namespace UWUVCI_AIO_WPF string appXml = Path.Combine(baseRomPath, "code", "app.xml"); Random random = new Random(); string ID = $"{random.Next(0x3000, 0x10000):X4}{random.Next(0x3000, 0x10000):X4}"; - string ID2 = $"{random.Next(0x3000, 0x10000):X4}"; + string ID2 = $"{random.Next(0x3000, 0x10000):X4}"; + mvvm.prodcode = ID2; XmlDocument doc = new XmlDocument(); try { diff --git a/UWUVCI AIO WPF/Models/MainViewModel.cs b/UWUVCI AIO WPF/Models/MainViewModel.cs index 9a0793d..0782d91 100644 --- a/UWUVCI AIO WPF/Models/MainViewModel.cs +++ b/UWUVCI AIO WPF/Models/MainViewModel.cs @@ -33,6 +33,7 @@ namespace UWUVCI_AIO_WPF { public class MainViewModel : BaseModel { + public string prodcode = ""; //public GameConfig GameConfiguration { get; set; } private GameConfig gameConfiguration = new GameConfig(); @@ -203,7 +204,33 @@ namespace UWUVCI_AIO_WPF private List lTG16 = new List(); + public string ReadCkeyFromOtp() + { string ret = ""; + using (var dialog = new System.Windows.Forms.OpenFileDialog()) + { + dialog.Filter = "OTP.bin | otp.bin"; + DialogResult res = dialog.ShowDialog(); + if (res == DialogResult.OK) + { + var filepath = dialog.FileName; + using (var fs = new FileStream(filepath, + FileMode.Open, + FileAccess.Read)) + { + byte[] test = new byte[16]; + fs.Seek(0xE0, SeekOrigin.Begin); + fs.Read(test, 0, 16); + fs.Close(); + foreach(var b in test) + { + ret += string.Format("{0:X2}", b); + } + } + } + } + return ret; + } public List LTG16 { @@ -838,6 +865,7 @@ namespace UWUVCI_AIO_WPF bootsound = ""; NKITFLAG = false; CBasePath = null; + prodcode = ""; if(Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"))) Directory.Delete(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"), true); } diff --git a/UWUVCI AIO WPF/UI/Windows/EnterKey.xaml b/UWUVCI AIO WPF/UI/Windows/EnterKey.xaml index 573e6a4..a67c2da 100644 --- a/UWUVCI AIO WPF/UI/Windows/EnterKey.xaml +++ b/UWUVCI AIO WPF/UI/Windows/EnterKey.xaml @@ -19,8 +19,11 @@ + +