summaryrefslogtreecommitdiffstats
path: root/CreateServer/Form1.cs
diff options
context:
space:
mode:
Diffstat (limited to 'CreateServer/Form1.cs')
-rw-r--r--CreateServer/Form1.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/CreateServer/Form1.cs b/CreateServer/Form1.cs
new file mode 100644
index 0000000..0a54427
--- /dev/null
+++ b/CreateServer/Form1.cs
@@ -0,0 +1,52 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Reflection;
+using System.IO;
+using System.Text;
+
+namespace BigEyes.CreateServer
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (this.saveFileDialog1.ShowDialog() == DialogResult.OK)
+ {
+ Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("BigEyes.CreateServer.Server.exe");
+ byte[] b = new byte[fs.Length];
+ fs.Read(b, 0, b.Length);
+ fs.Close();
+ fs = new FileStream(this.saveFileDialog1.FileName, FileMode.Create);
+ fs.Write(b, 0, b.Length);
+ b = new byte[0x1a];
+ int location = -1;
+ for (int i = 0; i != fs.Length - 0x1a; i++)
+ {
+ fs.Position = i;
+ fs.Read(b, 0, 0x1a);
+ if (ASCIIEncoding.Default.GetString(b) == "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+ {
+ location = i;
+ break;
+ }
+ }
+ for (int i = 0; i != b.Length; i++)
+ {
+ b[i] = 0;
+ }
+ fs.Position = location;
+ fs.Write(b, 0, b.Length);
+ fs.Position = location;
+ b = ASCIIEncoding.Default.GetBytes(this.textBox1.Text);
+ fs.Write(b,0,b.Length);
+ fs.Close();
+ MessageBox.Show("BigEyes Server written to disk!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+ }
+} \ No newline at end of file