From 4a51cff5dc958c8ac8a1bce2a17d65a2217697a5 Mon Sep 17 00:00:00 2001 From: ShinobiSheep Date: Tue, 27 Nov 2018 13:55:41 +0100 Subject: [PATCH] Various small changes --- Win_1337_Patch/1337.Designer.cs | 21 +++------------ Win_1337_Patch/1337.cs | 31 ++++++++++------------- Win_1337_Patch/Properties/AssemblyInfo.cs | 4 +-- Win_1337_Patch/Win_1337_Patch.csproj | 4 +++ 4 files changed, 23 insertions(+), 37 deletions(-) diff --git a/Win_1337_Patch/1337.Designer.cs b/Win_1337_Patch/1337.Designer.cs index 5963524..df15762 100644 --- a/Win_1337_Patch/1337.Designer.cs +++ b/Win_1337_Patch/1337.Designer.cs @@ -37,7 +37,6 @@ private void InitializeComponent() this.btnSelect1337 = new System.Windows.Forms.Button(); this.linkdfox = new System.Windows.Forms.LinkLabel(); this.Patch = new System.Windows.Forms.Button(); - this.cfixoff = new System.Windows.Forms.Button(); this.controlloBackup = new System.Windows.Forms.CheckBox(); this.cfileoffsett = new System.Windows.Forms.CheckBox(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); @@ -65,7 +64,7 @@ private void InitializeComponent() this.t1337.Size = new System.Drawing.Size(309, 20); this.t1337.TabIndex = 16; this.t1337.TabStop = false; - this.t1337.Text = "Select .1337 File..."; + this.t1337.Text = "Select 1337 File..."; this.t1337.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.t1337.DragDrop += new System.Windows.Forms.DragEventHandler(this.t1337_DragDrop); this.t1337.DragEnter += new System.Windows.Forms.DragEventHandler(this.t1337_DragEnter); @@ -115,7 +114,7 @@ private void InitializeComponent() this.linkdfox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.linkdfox.ForeColor = System.Drawing.Color.BlueViolet; this.linkdfox.LinkColor = System.Drawing.Color.Indigo; - this.linkdfox.Location = new System.Drawing.Point(255, 62); + this.linkdfox.Location = new System.Drawing.Point(226, 62); this.linkdfox.Name = "linkdfox"; this.linkdfox.Size = new System.Drawing.Size(77, 13); this.linkdfox.TabIndex = 73; @@ -135,18 +134,6 @@ private void InitializeComponent() this.Patch.UseVisualStyleBackColor = true; this.Patch.Click += new System.EventHandler(this.Patch_Click); // - // cfixoff - // - this.cfixoff.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cfixoff.ForeColor = System.Drawing.Color.Crimson; - this.cfixoff.Location = new System.Drawing.Point(156, 57); - this.cfixoff.Name = "cfixoff"; - this.cfixoff.Size = new System.Drawing.Size(88, 23); - this.cfixoff.TabIndex = 75; - this.cfixoff.Text = "Exit"; - this.cfixoff.UseVisualStyleBackColor = true; - this.cfixoff.Click += new System.EventHandler(this.Esci_Click); - // // controlloBackup // this.controlloBackup.AutoSize = true; @@ -186,7 +173,6 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(432, 83); this.Controls.Add(this.cfileoffsett); this.Controls.Add(this.controlloBackup); - this.Controls.Add(this.cfixoff); this.Controls.Add(this.Patch); this.Controls.Add(this.linkdfox); this.Controls.Add(this.btnSelect1337); @@ -200,7 +186,7 @@ private void InitializeComponent() this.MinimumSize = new System.Drawing.Size(448, 122); this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Win 1337 Apply Patch File v1.8..."; + this.Text = "Win 1337 Apply Patch File"; this.Load += new System.EventHandler(this.DFoX_Load); this.ResumeLayout(false); this.PerformLayout(); @@ -215,7 +201,6 @@ private void InitializeComponent() private System.Windows.Forms.Button btnSelect1337; private System.Windows.Forms.LinkLabel linkdfox; private System.Windows.Forms.Button Patch; - private System.Windows.Forms.Button cfixoff; private System.Windows.Forms.CheckBox controlloBackup; private System.Windows.Forms.CheckBox cfileoffsett; private System.Windows.Forms.ToolTip toolTip1; diff --git a/Win_1337_Patch/1337.cs b/Win_1337_Patch/1337.cs index a9be69a..5c14d26 100644 --- a/Win_1337_Patch/1337.cs +++ b/Win_1337_Patch/1337.cs @@ -17,6 +17,10 @@ public partial class Form1 : Form public Form1() { InitializeComponent(); + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + string ver = "v" + version.Major + "." + version.Minor; + this.Text = "Win 1337 Apply Patch File " + ver; + linkdfox.Text = ver + " By DeltaFoX"; } private void set() { @@ -35,6 +39,7 @@ private void set() apriDialogoFile1.Filter = "File " + ext + "|" + nf; apriDialogoFile1.FilterIndex = 0; apriDialogoFile1.Title = "Select the file \"" + nf + "\" File..."; + if (apriDialogoFile1.ShowDialog() == DialogResult.OK) { exe = apriDialogoFile1.FileName; @@ -45,8 +50,8 @@ private void set() } else { - t1337.Text = "Select .1337 File..."; - texe.Text = "Name of Exe/Dll to Patch..."; + t1337.Text = "Select a .1337 File..."; + texe.Text = "Select the Exe/Dll to Patch..."; f1337 = String.Empty; exe = String.Empty; } @@ -72,7 +77,7 @@ private void btnSelect1337_Click(object sender, EventArgs e) OpenFileDialog apriDialogoFile1 = new OpenFileDialog(); apriDialogoFile1.Filter = "File 1337|*.*"; apriDialogoFile1.FilterIndex = 0; - apriDialogoFile1.Title = "Select the file 1337 File..."; + apriDialogoFile1.Title = "Select the .1337 File..."; apriDialogoFile1.InitialDirectory = url1337 != "" ? url1337 : Directory.GetCurrentDirectory() + "\\"; apriDialogoFile1.RestoreDirectory = true; if (apriDialogoFile1.ShowDialog() == DialogResult.OK) @@ -97,34 +102,26 @@ private bool check_Symbol(string s) { if (!s.StartsWith(">")) { - MessageBox.Show("File 1337 is not valid...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("The .1337 File is not valid...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } return true; } - private void Esci_Click(object sender, EventArgs e) - { - Application.Exit(); - } private void Patch_Click(object sender, EventArgs e) { if (f1337 == String.Empty) { - MessageBox.Show("Select a 1337 File...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Select a .1337 File...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { DFoX_Patch(); } - catch (UnauthorizedAccessException) - { - MessageBox.Show("Sorry !!!\nYou Run the Program as Administrator...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } catch { - MessageBox.Show("Problems on Patch...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Problem occured when Patching...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } @@ -140,7 +137,7 @@ private void DFoX_Patch() return; if (lines[0].Substring(1).ToLower().Trim() != Path.GetFileName(exe).ToLower().Trim()) { - MessageBox.Show("File 1337 is not valid for selected exe/dll...\n\n(\"" + lines[0].Substring(1).ToLower() + "\" but you have selected \"" + Path.GetFileName(exe).ToLower() + "\")", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("The .1337 File is not valid for selected exe/dll...\n\n(\"" + lines[0].Substring(1).ToLower() + "\" but you have selected \"" + Path.GetFileName(exe).ToLower() + "\")", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } byte[] bexe = File.ReadAllBytes(exe); @@ -211,7 +208,7 @@ private void DFoX_Load(object sender, EventArgs e) exe = urlexe; } else - texe.Text = "Name of Exe/Dll to Patch..."; + texe.Text = "Select the Exe/Dll to Patch..."; if (url1337 != "" && urlexe != "") { t1337.Text = Ellipsis.Compact(url1337, t1337, EllipsisFormat.Path); @@ -219,7 +216,7 @@ private void DFoX_Load(object sender, EventArgs e) f1337 = url1337; } else - t1337.Text = "Select .1337 File..."; + t1337.Text = "Select a .1337 File..."; } private void cfileoffsett_CheckedChanged(object sender, EventArgs e) diff --git a/Win_1337_Patch/Properties/AssemblyInfo.cs b/Win_1337_Patch/Properties/AssemblyInfo.cs index c89e728..4221447 100644 --- a/Win_1337_Patch/Properties/AssemblyInfo.cs +++ b/Win_1337_Patch/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // usando l'asterisco '*' come illustrato di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.8.0.0")] -[assembly: AssemblyFileVersion("1.8.0.0")] +[assembly: AssemblyVersion("1.9.0.0")] +[assembly: AssemblyFileVersion("1.9.0.0")] diff --git a/Win_1337_Patch/Win_1337_Patch.csproj b/Win_1337_Patch/Win_1337_Patch.csproj index be928de..1ab5e23 100644 --- a/Win_1337_Patch/Win_1337_Patch.csproj +++ b/Win_1337_Patch/Win_1337_Patch.csproj @@ -34,6 +34,9 @@ vampire.ico + + app.manifest + @@ -71,6 +74,7 @@ True + SettingsSingleFileGenerator Settings.Designer.cs