Skip to content

Commit

Permalink
Various small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinobiSheep committed Nov 27, 2018
1 parent 71ce22e commit 4a51cff
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 37 deletions.
21 changes: 3 additions & 18 deletions Win_1337_Patch/1337.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions Win_1337_Patch/1337.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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;
Expand All @@ -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;
}
Expand All @@ -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)
Expand All @@ -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;
}
}
Expand All @@ -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);
Expand Down Expand Up @@ -211,15 +208,15 @@ 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);
toolTip1.SetToolTip(t1337, url1337);
f1337 = url1337;
}
else
t1337.Text = "Select .1337 File...";
t1337.Text = "Select a .1337 File...";
}

private void cfileoffsett_CheckedChanged(object sender, EventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions Win_1337_Patch/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
4 changes: 4 additions & 0 deletions Win_1337_Patch/Win_1337_Patch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<PropertyGroup>
<ApplicationIcon>vampire.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -71,6 +74,7 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down

0 comments on commit 4a51cff

Please sign in to comment.