Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- using System.Diagnostics;
- namespace SimpleBinder
- {
- public class Stub : Form
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Stub());
- }
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.SuspendLayout();
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(144, 135);
- this.ControlBox = false;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "Form1";
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
- this.Load += new System.EventHandler(this.Form1_Load);
- this.ResumeLayout(false);
- }
- #endregion
- public Stub()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- try
- {
- byte[] source = File.ReadAllBytes(Process.GetCurrentProcess().MainModule.FileName);
- byte[] data = new byte[1024];
- Array.Copy(source, source.Length - 1024, data, 0, 1024);
- string[] info = Encoding.UTF8.GetString(data).Split('|');
- byte[] target = new byte[int.Parse(info[1])];
- Array.Copy(source, source.Length - 1024 - target.Length, target, 0, target.Length);
- File.WriteAllBytes(info[0], target);
- }
- finally
- {
- this.Close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement