From 4852d3e0747a9beba56637dae9e53734d7c47fc8 Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Sun, 5 Apr 2020 19:10:39 +1200 Subject: [PATCH] updatye --- LocalPSM+/PSMKeyGen.Designer.cs | 53 +++++++++-- LocalPSM+/PSMKeyGen.cs | 88 ++++++++++++++++-- LocalPSM+/Resources/UnityDev.krng | Bin 2884 -> 2884 bytes LocalPSM+/Resources/psm_target_kdbg_list.dat | Bin 262160 -> 262160 bytes LocalPSM+/Resources/psmdev.krng | Bin 2884 -> 2884 bytes .../Resources/unity_target_kdbg_list.dat | Bin 262160 -> 262160 bytes 6 files changed, 125 insertions(+), 16 deletions(-) diff --git a/LocalPSM+/PSMKeyGen.Designer.cs b/LocalPSM+/PSMKeyGen.Designer.cs index 7a3eb86..ee7e5a2 100644 --- a/LocalPSM+/PSMKeyGen.Designer.cs +++ b/LocalPSM+/PSMKeyGen.Designer.cs @@ -36,6 +36,8 @@ this.KeyGen = new System.Windows.Forms.Button(); this.LicenseGen = new System.Windows.Forms.Button(); this.Unity = new System.Windows.Forms.CheckBox(); + this.ProjectName = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -46,7 +48,7 @@ this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureBox1.Location = new System.Drawing.Point(12, 12); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(408, 114); + this.pictureBox1.Size = new System.Drawing.Size(408, 131); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; // @@ -54,10 +56,11 @@ // this.DevName.BackColor = System.Drawing.SystemColors.HotTrack; this.DevName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.DevName.Location = new System.Drawing.Point(12, 156); + this.DevName.ForeColor = System.Drawing.SystemColors.Window; + this.DevName.Location = new System.Drawing.Point(92, 175); this.DevName.MaxLength = 17; this.DevName.Name = "DevName"; - this.DevName.Size = new System.Drawing.Size(408, 20); + this.DevName.Size = new System.Drawing.Size(328, 20); this.DevName.TabIndex = 1; this.DevName.TextChanged += new System.EventHandler(this.DevName_TextChanged); // @@ -66,18 +69,19 @@ this.TextColor.AutoSize = true; this.TextColor.BackColor = System.Drawing.Color.Transparent; this.TextColor.ForeColor = System.Drawing.SystemColors.ControlLightLight; - this.TextColor.Location = new System.Drawing.Point(12, 140); + this.TextColor.Location = new System.Drawing.Point(12, 175); this.TextColor.Name = "TextColor"; - this.TextColor.Size = new System.Drawing.Size(97, 13); + this.TextColor.Size = new System.Drawing.Size(75, 13); this.TextColor.TabIndex = 2; - this.TextColor.Text = "Device Name / ID:"; + this.TextColor.Text = "Device Name:"; // // KeyGen // this.KeyGen.BackColor = System.Drawing.SystemColors.Highlight; this.KeyGen.Enabled = false; this.KeyGen.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.KeyGen.Location = new System.Drawing.Point(12, 182); + this.KeyGen.ForeColor = System.Drawing.SystemColors.Window; + this.KeyGen.Location = new System.Drawing.Point(12, 213); this.KeyGen.Name = "KeyGen"; this.KeyGen.Size = new System.Drawing.Size(201, 26); this.KeyGen.TabIndex = 3; @@ -89,7 +93,8 @@ // this.LicenseGen.BackColor = System.Drawing.SystemColors.Highlight; this.LicenseGen.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.LicenseGen.Location = new System.Drawing.Point(219, 182); + this.LicenseGen.ForeColor = System.Drawing.SystemColors.Window; + this.LicenseGen.Location = new System.Drawing.Point(219, 213); this.LicenseGen.Name = "LicenseGen"; this.LicenseGen.Size = new System.Drawing.Size(201, 26); this.LicenseGen.TabIndex = 4; @@ -102,12 +107,36 @@ this.Unity.AutoSize = true; this.Unity.BackColor = System.Drawing.Color.Transparent; this.Unity.ForeColor = System.Drawing.SystemColors.Control; - this.Unity.Location = new System.Drawing.Point(344, 140); + this.Unity.Location = new System.Drawing.Point(344, 151); this.Unity.Name = "Unity"; this.Unity.Size = new System.Drawing.Size(76, 17); this.Unity.TabIndex = 5; this.Unity.Text = "PSM Unity"; this.Unity.UseVisualStyleBackColor = false; + this.Unity.CheckedChanged += new System.EventHandler(this.Unity_CheckedChanged); + // + // ProjectName + // + this.ProjectName.BackColor = System.Drawing.SystemColors.HotTrack; + this.ProjectName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ProjectName.ForeColor = System.Drawing.SystemColors.Window; + this.ProjectName.Location = new System.Drawing.Point(92, 149); + this.ProjectName.MaxLength = 30; + this.ProjectName.Name = "ProjectName"; + this.ProjectName.Size = new System.Drawing.Size(246, 20); + this.ProjectName.TabIndex = 6; + this.ProjectName.Text = "*"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.label1.Location = new System.Drawing.Point(12, 151); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(74, 13); + this.label1.TabIndex = 7; + this.label1.Text = "Project Name:"; // // PSMKeyGen // @@ -115,7 +144,9 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImage = global::LocalPSM_.Properties.Resources.bg; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.ClientSize = new System.Drawing.Size(432, 236); + this.ClientSize = new System.Drawing.Size(432, 262); + this.Controls.Add(this.label1); + this.Controls.Add(this.ProjectName); this.Controls.Add(this.Unity); this.Controls.Add(this.LicenseGen); this.Controls.Add(this.KeyGen); @@ -145,6 +176,8 @@ private System.Windows.Forms.Button KeyGen; private System.Windows.Forms.Button LicenseGen; private System.Windows.Forms.CheckBox Unity; + private System.Windows.Forms.TextBox ProjectName; + private System.Windows.Forms.Label label1; } } diff --git a/LocalPSM+/PSMKeyGen.cs b/LocalPSM+/PSMKeyGen.cs index 6841806..fa28926 100644 --- a/LocalPSM+/PSMKeyGen.cs +++ b/LocalPSM+/PSMKeyGen.cs @@ -139,6 +139,7 @@ namespace LocalPSM_ KeyGen.Enabled = false; DevName.Enabled = false; + ProjectName.Enabled = false; Unity.Enabled = false; LicenseGen.Enabled = false; @@ -159,6 +160,7 @@ namespace LocalPSM_ KeyGen.Enabled = true; DevName.Enabled = true; + ProjectName.Enabled = true; Unity.Enabled = true; LicenseGen.Enabled = true; DevName_TextChanged(null, null); @@ -215,7 +217,27 @@ namespace LocalPSM_ krng[i] = (byte)DevName.Text[i - 0x454]; } - File.WriteAllBytes("_PSM_DEFAULT_.krng", krng); + for (int i = 0x70; i != 0x90; i++) + { + if (ProjectName.Text.Length < i - 0x70) + krng[i] = (byte)ProjectName.Text[i - 0x70]; + else + krng[i] = 0x00; + } + + string keyRngName = ProjectName.Text; + if (keyRngName == "*") + keyRngName = "+asterisk+"; + + for (int i = 0x8; i != 0x28; i++) + { + if (keyRngName.Length < i - 0x8) + krng[i] = (byte)keyRngName[i - 0x8]; + else + krng[i] = 0x00; + } + + File.WriteAllBytes(keyRngName + ".krng", krng); File.WriteAllBytes("kdev.p12", Properties.Resources.UnityDev_private); @@ -234,7 +256,7 @@ namespace LocalPSM_ File.WriteAllBytes(DevName.Text + ".seed", Seed); moveToKeys(DevName.Text + ".seed"); - moveToKeys("_PSM_DEFAULT_.krng"); + moveToKeys(keyRngName + ".krng"); moveToKeys("kdev.p12"); } else @@ -247,7 +269,27 @@ namespace LocalPSM_ krng[i] = (byte)DevName.Text[i - 0x454]; } - File.WriteAllBytes("+asterisk+.krng", krng); + for (int i = 0x70; i != 0x90; i++) + { + if (ProjectName.Text.Length > i - 0x70) + krng[i] = (byte)ProjectName.Text[i - 0x70]; + else + krng[i] = 0x00; + } + + string keyRngName = ProjectName.Text; + if (keyRngName == "*") + keyRngName = "+asterisk+"; + + for (int i = 0x8; i != 0x28; i++) + { + if (keyRngName.Length > i - 0x8) + krng[i] = (byte)keyRngName[i - 0x8]; + else + krng[i] = 0x00; + } + + File.WriteAllBytes(Path.ChangeExtension(keyRngName,"krng"), krng); File.WriteAllBytes("kdev.p12", Properties.Resources.psmdev_private); @@ -266,7 +308,7 @@ namespace LocalPSM_ File.WriteAllBytes(DevName.Text + ".seed", Seed); moveToKeys(DevName.Text + ".seed"); - moveToKeys("+asterisk+.krng"); + moveToKeys(keyRngName + ".krng"); moveToKeys("kdev.p12"); } @@ -278,9 +320,18 @@ namespace LocalPSM_ { File.WriteAllBytes("Code", Properties.Resources.unity_Code); File.WriteAllBytes("protected_kconsole_cache.dat", Properties.Resources.unity_protected_kconsole_cache); - File.WriteAllBytes("target_kdbg_list.dat", Properties.Resources.unity_target_kdbg_list); File.WriteAllBytes("vseed.dat", Properties.Resources.unity_vseed); + byte[] Kdbg = Properties.Resources.unity_target_kdbg_list; + for (int i = 0x38; i != 0x58; i++) + { + if (ProjectName.Text.Length > i - 0x38) + Kdbg[i] = (byte)ProjectName.Text[i - 0x38]; + else + Kdbg[i] = 0x00; + } + File.WriteAllBytes("target_kdbg_list.dat", Kdbg); + moveToCache("Code"); moveToCache("protected_kconsole_cache.dat"); moveToCache("target_kdbg_list.dat"); @@ -291,9 +342,19 @@ namespace LocalPSM_ File.WriteAllBytes("activever.dat", Properties.Resources.psm_activever); File.WriteAllBytes("Code", Properties.Resources.psm_Code); File.WriteAllBytes("protected_kconsole_cache.dat", Properties.Resources.psm_protected_kconsole_cache); - File.WriteAllBytes("target_kdbg_list.dat", Properties.Resources.psm_target_kdbg_list); File.WriteAllBytes("vseed.dat", Properties.Resources.psm_vseed); + byte[] Kdbg = Properties.Resources.psm_target_kdbg_list; + for (int i = 0x38; i != 0x58; i++) + { + if (ProjectName.Text.Length > i - 0x38) + Kdbg[i] = (byte)ProjectName.Text[i - 0x38]; + else + Kdbg[i] = 0x00; + } + File.WriteAllBytes("target_kdbg_list.dat", Kdbg); + + moveToCache("activever.dat"); moveToCache("Code"); moveToCache("protected_kconsole_cache.dat"); @@ -307,6 +368,7 @@ namespace LocalPSM_ { KeyGen.Enabled = false; DevName.Enabled = false; + ProjectName.Enabled = false; Unity.Enabled = false; LicenseGen.Enabled = false; @@ -317,6 +379,7 @@ namespace LocalPSM_ KeyGen.Enabled = true; DevName.Enabled = true; + ProjectName.Enabled = true; Unity.Enabled = true; LicenseGen.Enabled = true; @@ -336,5 +399,18 @@ namespace LocalPSM_ } + private void Unity_CheckedChanged(object sender, EventArgs e) + { + if(Unity.Checked) + { + if(ProjectName.Text == "*") + ProjectName.Text = "_PSM_DEFAULT_"; + } + else + { + if (ProjectName.Text == "_PSM_DEFAULT_") + ProjectName.Text = "*"; + } + } } } diff --git a/LocalPSM+/Resources/UnityDev.krng b/LocalPSM+/Resources/UnityDev.krng index 66bf58f51c5667d957f3490d2a13cab500ebf7d8..066b1b2584d1a7249630ea12ffc8fe9580dbc1c3 100644 GIT binary patch delta 24 gcmX>ic0`Odz|lL1ablzML=TP0Oq>xLPtic0^1xz|lL1k%56BJ|NgP-o@3;G1Mm{exji9L=O#KRIx(ujVEfj0F)yTOaK4? diff --git a/LocalPSM+/Resources/psm_target_kdbg_list.dat b/LocalPSM+/Resources/psm_target_kdbg_list.dat index 39eb54889352d3acf1664d6dae75065b1bf1cd0e..d7112d2daa46bbccd540bbe4e6abdbf5bfcbccf4 100644 GIT binary patch delta 25 fcmbQxATR-lEG7%GL^Muloxs>Sfobam=7#?OdfEyO delta 27 hcmbQxATR-lEEu&W3$lbaPH3IL*gAn}>jdV8{{VyK3OE1& diff --git a/LocalPSM+/Resources/psmdev.krng b/LocalPSM+/Resources/psmdev.krng index a21b1d8c5d4b19b8be735207ae93cbb5421de986..895c59e9379ebc51e0e0de0403d7bc58d911c911 100644 GIT binary patch delta 24 gcmX>ic0`Odz|lL1abltKL=TP0Oq>xLPtic0^1lz|lL1k%56hJF&PVwJ5VVTYI9Q*+dTwMy-v7m$?A9vI?~T diff --git a/LocalPSM+/Resources/unity_target_kdbg_list.dat b/LocalPSM+/Resources/unity_target_kdbg_list.dat index 5655d53190e69a97df18a1bb81a01988e24597e4..d920a28441ee2fb156edbbf2fb7de294ee7d3e6d 100644 GIT binary patch delta 25 fcmbQxATR-lEG7%GL^Muloxs>Sfobam=7#?OdfEyO delta 38 scmbQxATR-lEO_Gsf_>v%T-_W)eL~_VI(j!wXq~{=I)Q2H1m=eS00PDiN&o-=