Skip to content

Commit

Permalink
v1.8
Browse files Browse the repository at this point in the history
v1.8 Released..
Code optimization...
  • Loading branch information
Paolo authored Oct 26, 2018
1 parent eff9c84 commit 7f0c8f2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 78 deletions.
2 changes: 1 addition & 1 deletion Win_1337_Patch/1337.Designer.cs

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

127 changes: 53 additions & 74 deletions Win_1337_Patch/1337.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,52 @@ public Form1()
{
InitializeComponent();
}

private void set()
{
t1337.Text = Ellipsis.Compact(f1337, t1337, EllipsisFormat.Path);
toolTip1.SetToolTip(t1337, f1337);
Properties.Settings.Default["url1337"] = f1337;
Properties.Settings.Default.Save();
string[] lines = File.ReadAllLines(f1337);
if (!check_Symbol(lines[0]))
return;
string unf = lines[0].Substring(1).ToLower().Trim();
string nf = Path.GetFileName(unf);
string ext = Path.GetExtension(unf);
OpenFileDialog apriDialogoFile1 = new OpenFileDialog();
apriDialogoFile1.FileName = nf;
apriDialogoFile1.Filter = "File " + ext + "|" + nf;
apriDialogoFile1.FilterIndex = 0;
apriDialogoFile1.Title = "Select the file \"" + nf + "\" File...";
if (apriDialogoFile1.ShowDialog() == DialogResult.OK)
{
exe = apriDialogoFile1.FileName;
texe.Text = Ellipsis.Compact(Path.GetFileName(exe), texe, EllipsisFormat.Path);
toolTip1.SetToolTip(texe, exe);
Properties.Settings.Default["urlexe"] = exe;
Properties.Settings.Default.Save();
}
else
{
t1337.Text = "Select .1337 File...";
texe.Text = "Name of Exe/Dll to Patch...";
f1337 = String.Empty;
exe = String.Empty;
}
}
private void t1337_DragDrop(object sender, DragEventArgs e)
{
try
{
f1337 = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0];
set();
}
catch
{
//Nothing;
}
return;
}
private void btnSelect1337_Click(object sender, EventArgs e)
{
try
Expand All @@ -33,36 +78,7 @@ private void btnSelect1337_Click(object sender, EventArgs e)
if (apriDialogoFile1.ShowDialog() == DialogResult.OK)
{
f1337 = apriDialogoFile1.FileName;
t1337.Text = Ellipsis.Compact(f1337, t1337, EllipsisFormat.Path);
toolTip1.SetToolTip(t1337, f1337);
Properties.Settings.Default["url1337"] = f1337;
Properties.Settings.Default.Save();
string[] lines = File.ReadAllLines(f1337);
if (lines[0].Substring(0, 1) != ">")
{
MessageBox.Show("File 1337 is not valid...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string unf = lines[0].Substring(1).ToLower().Trim();
string nf = Path.GetFileName(unf);
string ext = Path.GetExtension(unf);
apriDialogoFile1.FileName = nf;
apriDialogoFile1.Filter = "File " + ext + "|" + nf;
apriDialogoFile1.FilterIndex = 0;
apriDialogoFile1.Title = "Select the file \"" + nf + "\" File...";
if (apriDialogoFile1.ShowDialog() == DialogResult.OK)
{
exe = apriDialogoFile1.FileName;
texe.Text = Ellipsis.Compact(Path.GetFileName(exe), texe, EllipsisFormat.Path);
toolTip1.SetToolTip(texe, exe);
Properties.Settings.Default["urlexe"] = exe;
Properties.Settings.Default.Save();
}
else
{
t1337.Text = "Select .1337 File...";
f1337 = String.Empty;
}
set();
}
}
catch
Expand All @@ -77,48 +93,14 @@ private void t1337_DragEnter(object sender, DragEventArgs e)
e.Effect = DragDropEffects.All;
}

private void t1337_DragDrop(object sender, DragEventArgs e)
private bool check_Symbol(string s)
{
try
if (!s.StartsWith(">"))
{
f1337 = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0];
t1337.Text = Ellipsis.Compact(f1337, t1337, EllipsisFormat.Path);
toolTip1.SetToolTip(t1337, f1337);
Properties.Settings.Default["url1337"] = f1337;
Properties.Settings.Default.Save();
string[] lines = File.ReadAllLines(f1337);
if (lines[0].Substring(0, 1) != ">")
{
MessageBox.Show("File 1337 is not valid...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string unf = lines[0].Substring(1).ToLower().Trim();
string nf = Path.GetFileName(unf);
string ext = Path.GetExtension(unf);
OpenFileDialog apriDialogoFile1 = new OpenFileDialog();
apriDialogoFile1.FileName = nf;
apriDialogoFile1.Filter = "File " + ext + "|" + nf;
apriDialogoFile1.FilterIndex = 0;
apriDialogoFile1.Title = "Select the file \"" + nf + "\" File...";
if (apriDialogoFile1.ShowDialog() == DialogResult.OK)
{
exe = apriDialogoFile1.FileName;
texe.Text = Ellipsis.Compact(Path.GetFileName(exe), texe, EllipsisFormat.Path);
toolTip1.SetToolTip(texe, exe);
Properties.Settings.Default["urlexe"] = exe;
Properties.Settings.Default.Save();
}
else
{
t1337.Text = "Select .1337 File...";
f1337 = String.Empty;
}
}
catch
{
//Nothing;
MessageBox.Show("File 1337 is not valid...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return;
return true;
}
private void Esci_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -154,11 +136,8 @@ private void DFoX_Patch()
return;
}
string[] lines = File.ReadAllLines(f1337);
if (lines[0].Substring(0, 1) != ">")
{
MessageBox.Show("File 1337 is not valid...", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (!check_Symbol(lines[0]))
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);
Expand Down
6 changes: 3 additions & 3 deletions Win_1337_Patch/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("DeFconX")]
[assembly: AssemblyProduct("Win_1337_Patch")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("DeltaFoX")]
[assembly: AssemblyCulture("")]

Expand All @@ -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.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]

0 comments on commit 7f0c8f2

Please sign in to comment.