Various small changes

This commit is contained in:
ShinobiSheep 2018-11-27 13:55:41 +01:00
commit 4a51cff5dc
4 changed files with 23 additions and 37 deletions

View file

@ -37,7 +37,6 @@
this.btnSelect1337 = new System.Windows.Forms.Button(); this.btnSelect1337 = new System.Windows.Forms.Button();
this.linkdfox = new System.Windows.Forms.LinkLabel(); this.linkdfox = new System.Windows.Forms.LinkLabel();
this.Patch = new System.Windows.Forms.Button(); this.Patch = new System.Windows.Forms.Button();
this.cfixoff = new System.Windows.Forms.Button();
this.controlloBackup = new System.Windows.Forms.CheckBox(); this.controlloBackup = new System.Windows.Forms.CheckBox();
this.cfileoffsett = new System.Windows.Forms.CheckBox(); this.cfileoffsett = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
@ -65,7 +64,7 @@
this.t1337.Size = new System.Drawing.Size(309, 20); this.t1337.Size = new System.Drawing.Size(309, 20);
this.t1337.TabIndex = 16; this.t1337.TabIndex = 16;
this.t1337.TabStop = false; 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.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.t1337.DragDrop += new System.Windows.Forms.DragEventHandler(this.t1337_DragDrop); this.t1337.DragDrop += new System.Windows.Forms.DragEventHandler(this.t1337_DragDrop);
this.t1337.DragEnter += new System.Windows.Forms.DragEventHandler(this.t1337_DragEnter); this.t1337.DragEnter += new System.Windows.Forms.DragEventHandler(this.t1337_DragEnter);
@ -115,7 +114,7 @@
this.linkdfox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 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.ForeColor = System.Drawing.Color.BlueViolet;
this.linkdfox.LinkColor = System.Drawing.Color.Indigo; 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.Name = "linkdfox";
this.linkdfox.Size = new System.Drawing.Size(77, 13); this.linkdfox.Size = new System.Drawing.Size(77, 13);
this.linkdfox.TabIndex = 73; this.linkdfox.TabIndex = 73;
@ -135,18 +134,6 @@
this.Patch.UseVisualStyleBackColor = true; this.Patch.UseVisualStyleBackColor = true;
this.Patch.Click += new System.EventHandler(this.Patch_Click); 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 // controlloBackup
// //
this.controlloBackup.AutoSize = true; this.controlloBackup.AutoSize = true;
@ -186,7 +173,6 @@
this.ClientSize = new System.Drawing.Size(432, 83); this.ClientSize = new System.Drawing.Size(432, 83);
this.Controls.Add(this.cfileoffsett); this.Controls.Add(this.cfileoffsett);
this.Controls.Add(this.controlloBackup); this.Controls.Add(this.controlloBackup);
this.Controls.Add(this.cfixoff);
this.Controls.Add(this.Patch); this.Controls.Add(this.Patch);
this.Controls.Add(this.linkdfox); this.Controls.Add(this.linkdfox);
this.Controls.Add(this.btnSelect1337); this.Controls.Add(this.btnSelect1337);
@ -200,7 +186,7 @@
this.MinimumSize = new System.Drawing.Size(448, 122); this.MinimumSize = new System.Drawing.Size(448, 122);
this.Name = "Form1"; this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 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.Load += new System.EventHandler(this.DFoX_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -215,7 +201,6 @@
private System.Windows.Forms.Button btnSelect1337; private System.Windows.Forms.Button btnSelect1337;
private System.Windows.Forms.LinkLabel linkdfox; private System.Windows.Forms.LinkLabel linkdfox;
private System.Windows.Forms.Button Patch; private System.Windows.Forms.Button Patch;
private System.Windows.Forms.Button cfixoff;
private System.Windows.Forms.CheckBox controlloBackup; private System.Windows.Forms.CheckBox controlloBackup;
private System.Windows.Forms.CheckBox cfileoffsett; private System.Windows.Forms.CheckBox cfileoffsett;
private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.ToolTip toolTip1;

View file

@ -17,6 +17,10 @@ namespace Win_1337_Patch
public Form1() public Form1()
{ {
InitializeComponent(); 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() private void set()
{ {
@ -35,6 +39,7 @@ namespace Win_1337_Patch
apriDialogoFile1.Filter = "File " + ext + "|" + nf; apriDialogoFile1.Filter = "File " + ext + "|" + nf;
apriDialogoFile1.FilterIndex = 0; apriDialogoFile1.FilterIndex = 0;
apriDialogoFile1.Title = "Select the file \"" + nf + "\" File..."; apriDialogoFile1.Title = "Select the file \"" + nf + "\" File...";
if (apriDialogoFile1.ShowDialog() == DialogResult.OK) if (apriDialogoFile1.ShowDialog() == DialogResult.OK)
{ {
exe = apriDialogoFile1.FileName; exe = apriDialogoFile1.FileName;
@ -45,8 +50,8 @@ namespace Win_1337_Patch
} }
else else
{ {
t1337.Text = "Select .1337 File..."; t1337.Text = "Select a .1337 File...";
texe.Text = "Name of Exe/Dll to Patch..."; texe.Text = "Select the Exe/Dll to Patch...";
f1337 = String.Empty; f1337 = String.Empty;
exe = String.Empty; exe = String.Empty;
} }
@ -72,7 +77,7 @@ namespace Win_1337_Patch
OpenFileDialog apriDialogoFile1 = new OpenFileDialog(); OpenFileDialog apriDialogoFile1 = new OpenFileDialog();
apriDialogoFile1.Filter = "File 1337|*.*"; apriDialogoFile1.Filter = "File 1337|*.*";
apriDialogoFile1.FilterIndex = 0; apriDialogoFile1.FilterIndex = 0;
apriDialogoFile1.Title = "Select the file 1337 File..."; apriDialogoFile1.Title = "Select the .1337 File...";
apriDialogoFile1.InitialDirectory = url1337 != "" ? url1337 : Directory.GetCurrentDirectory() + "\\"; apriDialogoFile1.InitialDirectory = url1337 != "" ? url1337 : Directory.GetCurrentDirectory() + "\\";
apriDialogoFile1.RestoreDirectory = true; apriDialogoFile1.RestoreDirectory = true;
if (apriDialogoFile1.ShowDialog() == DialogResult.OK) if (apriDialogoFile1.ShowDialog() == DialogResult.OK)
@ -97,34 +102,26 @@ namespace Win_1337_Patch
{ {
if (!s.StartsWith(">")) 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 false;
} }
return true; return true;
} }
private void Esci_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void Patch_Click(object sender, EventArgs e) private void Patch_Click(object sender, EventArgs e)
{ {
if (f1337 == String.Empty) 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; return;
} }
try try
{ {
DFoX_Patch(); DFoX_Patch();
} }
catch (UnauthorizedAccessException)
{
MessageBox.Show("Sorry !!!\nYou Run the Program as Administrator...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch catch
{ {
MessageBox.Show("Problems on Patch...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Problem occured when Patching...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
} }
@ -140,7 +137,7 @@ namespace Win_1337_Patch
return; return;
if (lines[0].Substring(1).ToLower().Trim() != Path.GetFileName(exe).ToLower().Trim()) 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; return;
} }
byte[] bexe = File.ReadAllBytes(exe); byte[] bexe = File.ReadAllBytes(exe);
@ -211,7 +208,7 @@ namespace Win_1337_Patch
exe = urlexe; exe = urlexe;
} }
else else
texe.Text = "Name of Exe/Dll to Patch..."; texe.Text = "Select the Exe/Dll to Patch...";
if (url1337 != "" && urlexe != "") if (url1337 != "" && urlexe != "")
{ {
t1337.Text = Ellipsis.Compact(url1337, t1337, EllipsisFormat.Path); t1337.Text = Ellipsis.Compact(url1337, t1337, EllipsisFormat.Path);
@ -219,7 +216,7 @@ namespace Win_1337_Patch
f1337 = url1337; f1337 = url1337;
} }
else else
t1337.Text = "Select .1337 File..."; t1337.Text = "Select a .1337 File...";
} }
private void cfileoffsett_CheckedChanged(object sender, EventArgs e) private void cfileoffsett_CheckedChanged(object sender, EventArgs e)

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // È 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: // usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.0.0")] [assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")] [assembly: AssemblyFileVersion("1.9.0.0")]

View file

@ -34,6 +34,9 @@
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>vampire.ico</ApplicationIcon> <ApplicationIcon>vampire.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -71,6 +74,7 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="app.config" /> <None Include="app.config" />
<None Include="app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>