mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 19:36:11 +00:00
753 lines
26 KiB
C#
753 lines
26 KiB
C#
|
// Decompiled with JetBrains decompiler
|
|||
|
// Type: SnipeInject_V3.Form1
|
|||
|
// Assembly: SnipeInject V3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
|||
|
// MVID: 4B17C691-AC0C-43B1-A878-F82F3184CC13
|
|||
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Virut.ce-b22de4b82be7b4258a77c2a7e06a62fdba63fc55c228d9fb47aca9d3d83142fb.exe
|
|||
|
|
|||
|
using Microsoft.VisualBasic;
|
|||
|
using Microsoft.VisualBasic.CompilerServices;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.ComponentModel;
|
|||
|
using System.Diagnostics;
|
|||
|
using System.Drawing;
|
|||
|
using System.IO;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
using System.Runtime.InteropServices;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace SnipeInject_V3
|
|||
|
{
|
|||
|
[DesignerGenerated]
|
|||
|
public class Form1 : Form
|
|||
|
{
|
|||
|
private static List<WeakReference> __ENCList = new List<WeakReference>();
|
|||
|
private IContainer components;
|
|||
|
[AccessedThroughProperty("Label2")]
|
|||
|
private Label _Label2;
|
|||
|
[AccessedThroughProperty("Label4")]
|
|||
|
private Label _Label4;
|
|||
|
[AccessedThroughProperty("TextBox1")]
|
|||
|
private TextBox _TextBox1;
|
|||
|
[AccessedThroughProperty("Timer1")]
|
|||
|
private Timer _Timer1;
|
|||
|
[AccessedThroughProperty("OpenFileDialog1")]
|
|||
|
private OpenFileDialog _OpenFileDialog1;
|
|||
|
[AccessedThroughProperty("Dlls")]
|
|||
|
private ListBox _Dlls;
|
|||
|
[AccessedThroughProperty("CheckBox1")]
|
|||
|
private CheckBox _CheckBox1;
|
|||
|
[AccessedThroughProperty("CheckBox2")]
|
|||
|
private CheckBox _CheckBox2;
|
|||
|
[AccessedThroughProperty("CheckBox3")]
|
|||
|
private CheckBox _CheckBox3;
|
|||
|
[AccessedThroughProperty("Button1")]
|
|||
|
private Button _Button1;
|
|||
|
[AccessedThroughProperty("Button2")]
|
|||
|
private Button _Button2;
|
|||
|
[AccessedThroughProperty("Button3")]
|
|||
|
private Button _Button3;
|
|||
|
[AccessedThroughProperty("Button4")]
|
|||
|
private Button _Button4;
|
|||
|
[AccessedThroughProperty("GroupBox1")]
|
|||
|
private GroupBox _GroupBox1;
|
|||
|
[AccessedThroughProperty("GroupBox2")]
|
|||
|
private GroupBox _GroupBox2;
|
|||
|
[AccessedThroughProperty("Label6")]
|
|||
|
private Label _Label6;
|
|||
|
[AccessedThroughProperty("Label1")]
|
|||
|
private Label _Label1;
|
|||
|
private int TargetProcessHandle;
|
|||
|
private int pfnStartAddr;
|
|||
|
private string pszLibFileRemote;
|
|||
|
private int TargetBufferSize;
|
|||
|
public const int PROCESS_VM_READ = 16;
|
|||
|
public const int TH32CS_SNAPPROCESS = 2;
|
|||
|
public const int MEM_COMMIT = 4096;
|
|||
|
public const int PAGE_READWRITE = 4;
|
|||
|
public const int PROCESS_CREATE_THREAD = 2;
|
|||
|
public const int PROCESS_VM_OPERATION = 8;
|
|||
|
public const int PROCESS_VM_WRITE = 32;
|
|||
|
private string DLLFileName;
|
|||
|
private string ExeName;
|
|||
|
|
|||
|
[DebuggerNonUserCode]
|
|||
|
static Form1()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public Form1()
|
|||
|
{
|
|||
|
this.Load += new EventHandler(this.Form1_Load);
|
|||
|
Form1.__ENCAddToList((object) this);
|
|||
|
this.ExeName = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
|
|||
|
this.InitializeComponent();
|
|||
|
}
|
|||
|
|
|||
|
[DebuggerNonUserCode]
|
|||
|
private static void __ENCAddToList(object value)
|
|||
|
{
|
|||
|
lock (Form1.__ENCList)
|
|||
|
{
|
|||
|
if (Form1.__ENCList.Count == Form1.__ENCList.Capacity)
|
|||
|
{
|
|||
|
int index1 = 0;
|
|||
|
int num = checked (Form1.__ENCList.Count - 1);
|
|||
|
int index2 = 0;
|
|||
|
while (index2 <= num)
|
|||
|
{
|
|||
|
if (Form1.__ENCList[index2].IsAlive)
|
|||
|
{
|
|||
|
if (index2 != index1)
|
|||
|
Form1.__ENCList[index1] = Form1.__ENCList[index2];
|
|||
|
checked { ++index1; }
|
|||
|
}
|
|||
|
checked { ++index2; }
|
|||
|
}
|
|||
|
Form1.__ENCList.RemoveRange(index1, checked (Form1.__ENCList.Count - index1));
|
|||
|
Form1.__ENCList.Capacity = Form1.__ENCList.Count;
|
|||
|
}
|
|||
|
Form1.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[DebuggerNonUserCode]
|
|||
|
protected override void Dispose(bool disposing)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (!disposing || this.components == null)
|
|||
|
return;
|
|||
|
this.components.Dispose();
|
|||
|
}
|
|||
|
finally
|
|||
|
{
|
|||
|
base.Dispose(disposing);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[DebuggerStepThrough]
|
|||
|
private void InitializeComponent()
|
|||
|
{
|
|||
|
this.components = (IContainer) new System.ComponentModel.Container();
|
|||
|
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1));
|
|||
|
this.Label2 = new Label();
|
|||
|
this.Label4 = new Label();
|
|||
|
this.TextBox1 = new TextBox();
|
|||
|
this.Timer1 = new Timer(this.components);
|
|||
|
this.OpenFileDialog1 = new OpenFileDialog();
|
|||
|
this.Dlls = new ListBox();
|
|||
|
this.CheckBox1 = new CheckBox();
|
|||
|
this.CheckBox2 = new CheckBox();
|
|||
|
this.CheckBox3 = new CheckBox();
|
|||
|
this.Button1 = new Button();
|
|||
|
this.Button2 = new Button();
|
|||
|
this.Button3 = new Button();
|
|||
|
this.Button4 = new Button();
|
|||
|
this.GroupBox1 = new GroupBox();
|
|||
|
this.GroupBox2 = new GroupBox();
|
|||
|
this.Label6 = new Label();
|
|||
|
this.Label1 = new Label();
|
|||
|
this.GroupBox1.SuspendLayout();
|
|||
|
this.SuspendLayout();
|
|||
|
this.Label2.AutoSize = true;
|
|||
|
Label label2_1 = this.Label2;
|
|||
|
Point point1 = new Point(22, 187);
|
|||
|
Point point2 = point1;
|
|||
|
label2_1.Location = point2;
|
|||
|
this.Label2.Name = "Label2";
|
|||
|
Label label2_2 = this.Label2;
|
|||
|
Size size1 = new Size(30, 13);
|
|||
|
Size size2 = size1;
|
|||
|
label2_2.Size = size2;
|
|||
|
this.Label2.TabIndex = 1;
|
|||
|
this.Label2.Text = "DLL:";
|
|||
|
this.Label4.AutoSize = true;
|
|||
|
this.Label4.ForeColor = Color.Teal;
|
|||
|
Label label4_1 = this.Label4;
|
|||
|
point1 = new Point(13, 26);
|
|||
|
Point point3 = point1;
|
|||
|
label4_1.Location = point3;
|
|||
|
this.Label4.Name = "Label4";
|
|||
|
Label label4_2 = this.Label4;
|
|||
|
size1 = new Size(40, 13);
|
|||
|
Size size3 = size1;
|
|||
|
label4_2.Size = size3;
|
|||
|
this.Label4.TabIndex = 3;
|
|||
|
this.Label4.Text = "Status:";
|
|||
|
TextBox textBox1_1 = this.TextBox1;
|
|||
|
point1 = new Point(92, 160);
|
|||
|
Point point4 = point1;
|
|||
|
textBox1_1.Location = point4;
|
|||
|
this.TextBox1.Name = "TextBox1";
|
|||
|
TextBox textBox1_2 = this.TextBox1;
|
|||
|
size1 = new Size(148, 20);
|
|||
|
Size size4 = size1;
|
|||
|
textBox1_2.Size = size4;
|
|||
|
this.TextBox1.TabIndex = 4;
|
|||
|
this.OpenFileDialog1.FileName = "OpenFileDialog1";
|
|||
|
this.OpenFileDialog1.Multiselect = true;
|
|||
|
this.Dlls.FormattingEnabled = true;
|
|||
|
ListBox dlls1 = this.Dlls;
|
|||
|
point1 = new Point(92, 187);
|
|||
|
Point point5 = point1;
|
|||
|
dlls1.Location = point5;
|
|||
|
this.Dlls.Name = "Dlls";
|
|||
|
ListBox dlls2 = this.Dlls;
|
|||
|
size1 = new Size(148, 134);
|
|||
|
Size size5 = size1;
|
|||
|
dlls2.Size = size5;
|
|||
|
this.Dlls.TabIndex = 5;
|
|||
|
this.CheckBox1.AutoSize = true;
|
|||
|
CheckBox checkBox1_1 = this.CheckBox1;
|
|||
|
point1 = new Point(17, 19);
|
|||
|
Point point6 = point1;
|
|||
|
checkBox1_1.Location = point6;
|
|||
|
this.CheckBox1.Name = "CheckBox1";
|
|||
|
CheckBox checkBox1_2 = this.CheckBox1;
|
|||
|
size1 = new Size(135, 20);
|
|||
|
Size size6 = size1;
|
|||
|
checkBox1_2.Size = size6;
|
|||
|
this.CheckBox1.TabIndex = 6;
|
|||
|
this.CheckBox1.Text = "Close After Injection";
|
|||
|
this.CheckBox1.UseVisualStyleBackColor = true;
|
|||
|
this.CheckBox2.AutoSize = true;
|
|||
|
CheckBox checkBox2_1 = this.CheckBox2;
|
|||
|
point1 = new Point(17, 42);
|
|||
|
Point point7 = point1;
|
|||
|
checkBox2_1.Location = point7;
|
|||
|
this.CheckBox2.Name = "CheckBox2";
|
|||
|
CheckBox checkBox2_2 = this.CheckBox2;
|
|||
|
size1 = new Size(130, 20);
|
|||
|
Size size7 = size1;
|
|||
|
checkBox2_2.Size = size7;
|
|||
|
this.CheckBox2.TabIndex = 7;
|
|||
|
this.CheckBox2.Text = "Automatic Injection";
|
|||
|
this.CheckBox2.UseVisualStyleBackColor = true;
|
|||
|
this.CheckBox3.AutoSize = true;
|
|||
|
CheckBox checkBox3_1 = this.CheckBox3;
|
|||
|
point1 = new Point(17, 65);
|
|||
|
Point point8 = point1;
|
|||
|
checkBox3_1.Location = point8;
|
|||
|
this.CheckBox3.Name = "CheckBox3";
|
|||
|
CheckBox checkBox3_2 = this.CheckBox3;
|
|||
|
size1 = new Size(115, 20);
|
|||
|
Size size8 = size1;
|
|||
|
checkBox3_2.Size = size8;
|
|||
|
this.CheckBox3.TabIndex = 8;
|
|||
|
this.CheckBox3.Text = "Manual Injection";
|
|||
|
this.CheckBox3.UseVisualStyleBackColor = true;
|
|||
|
Button button1_1 = this.Button1;
|
|||
|
point1 = new Point(12, 218);
|
|||
|
Point point9 = point1;
|
|||
|
button1_1.Location = point9;
|
|||
|
this.Button1.Name = "Button1";
|
|||
|
Button button1_2 = this.Button1;
|
|||
|
size1 = new Size(75, 23);
|
|||
|
Size size9 = size1;
|
|||
|
button1_2.Size = size9;
|
|||
|
this.Button1.TabIndex = 9;
|
|||
|
this.Button1.Text = "Browse";
|
|||
|
this.Button1.UseVisualStyleBackColor = true;
|
|||
|
Button button2_1 = this.Button2;
|
|||
|
point1 = new Point(11, 247);
|
|||
|
Point point10 = point1;
|
|||
|
button2_1.Location = point10;
|
|||
|
this.Button2.Name = "Button2";
|
|||
|
Button button2_2 = this.Button2;
|
|||
|
size1 = new Size(75, 23);
|
|||
|
Size size10 = size1;
|
|||
|
button2_2.Size = size10;
|
|||
|
this.Button2.TabIndex = 10;
|
|||
|
this.Button2.Text = "Clear";
|
|||
|
this.Button2.UseVisualStyleBackColor = true;
|
|||
|
Button button3_1 = this.Button3;
|
|||
|
point1 = new Point(11, 276);
|
|||
|
Point point11 = point1;
|
|||
|
button3_1.Location = point11;
|
|||
|
this.Button3.Name = "Button3";
|
|||
|
Button button3_2 = this.Button3;
|
|||
|
size1 = new Size(75, 45);
|
|||
|
Size size11 = size1;
|
|||
|
button3_2.Size = size11;
|
|||
|
this.Button3.TabIndex = 11;
|
|||
|
this.Button3.Text = "Clear Selected";
|
|||
|
this.Button3.UseVisualStyleBackColor = true;
|
|||
|
Button button4_1 = this.Button4;
|
|||
|
point1 = new Point(128, 327);
|
|||
|
Point point12 = point1;
|
|||
|
button4_1.Location = point12;
|
|||
|
this.Button4.Name = "Button4";
|
|||
|
Button button4_2 = this.Button4;
|
|||
|
size1 = new Size(75, 36);
|
|||
|
Size size12 = size1;
|
|||
|
button4_2.Size = size12;
|
|||
|
this.Button4.TabIndex = 12;
|
|||
|
this.Button4.Text = "Inject";
|
|||
|
this.Button4.UseVisualStyleBackColor = true;
|
|||
|
this.GroupBox1.BackColor = Color.Transparent;
|
|||
|
this.GroupBox1.Controls.Add((Control) this.CheckBox1);
|
|||
|
this.GroupBox1.Controls.Add((Control) this.CheckBox2);
|
|||
|
this.GroupBox1.Controls.Add((Control) this.CheckBox3);
|
|||
|
this.GroupBox1.Font = new Font("Arial Narrow", 9.75f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
|
|||
|
this.GroupBox1.ForeColor = Color.DarkOrange;
|
|||
|
GroupBox groupBox1_1 = this.GroupBox1;
|
|||
|
point1 = new Point(246, 236);
|
|||
|
Point point13 = point1;
|
|||
|
groupBox1_1.Location = point13;
|
|||
|
this.GroupBox1.Name = "GroupBox1";
|
|||
|
GroupBox groupBox1_2 = this.GroupBox1;
|
|||
|
size1 = new Size(150, 116);
|
|||
|
Size size13 = size1;
|
|||
|
groupBox1_2.Size = size13;
|
|||
|
this.GroupBox1.TabIndex = 13;
|
|||
|
this.GroupBox1.TabStop = false;
|
|||
|
this.GroupBox1.Text = "Settings";
|
|||
|
this.GroupBox2.BackColor = Color.Transparent;
|
|||
|
this.GroupBox2.Font = new Font("Arial Narrow", 9f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
|
|||
|
GroupBox groupBox2_1 = this.GroupBox2;
|
|||
|
point1 = new Point(246, 155);
|
|||
|
Point point14 = point1;
|
|||
|
groupBox2_1.Location = point14;
|
|||
|
this.GroupBox2.Name = "GroupBox2";
|
|||
|
GroupBox groupBox2_2 = this.GroupBox2;
|
|||
|
size1 = new Size(152, 75);
|
|||
|
Size size14 = size1;
|
|||
|
groupBox2_2.Size = size14;
|
|||
|
this.GroupBox2.TabIndex = 14;
|
|||
|
this.GroupBox2.TabStop = false;
|
|||
|
this.GroupBox2.Text = "Credits: Snipermon For MPGH";
|
|||
|
this.Label6.AutoSize = true;
|
|||
|
Label label6_1 = this.Label6;
|
|||
|
point1 = new Point(22, 163);
|
|||
|
Point point15 = point1;
|
|||
|
label6_1.Location = point15;
|
|||
|
this.Label6.Name = "Label6";
|
|||
|
Label label6_2 = this.Label6;
|
|||
|
size1 = new Size(48, 13);
|
|||
|
Size size15 = size1;
|
|||
|
label6_2.Size = size15;
|
|||
|
this.Label6.TabIndex = 16;
|
|||
|
this.Label6.Text = "Process:";
|
|||
|
this.Label1.AutoSize = true;
|
|||
|
Label label1_1 = this.Label1;
|
|||
|
point1 = new Point(68, 26);
|
|||
|
Point point16 = point1;
|
|||
|
label1_1.Location = point16;
|
|||
|
this.Label1.Name = "Label1";
|
|||
|
Label label1_2 = this.Label1;
|
|||
|
size1 = new Size(0, 13);
|
|||
|
Size size16 = size1;
|
|||
|
label1_2.Size = size16;
|
|||
|
this.Label1.TabIndex = 17;
|
|||
|
this.AutoScaleDimensions = new SizeF(6f, 13f);
|
|||
|
this.AutoScaleMode = AutoScaleMode.Font;
|
|||
|
this.BackgroundImage = (Image) componentResourceManager.GetObject("$this.BackgroundImage");
|
|||
|
this.BackgroundImageLayout = ImageLayout.Stretch;
|
|||
|
size1 = new Size(401, 371);
|
|||
|
this.ClientSize = size1;
|
|||
|
this.Controls.Add((Control) this.Label1);
|
|||
|
this.Controls.Add((Control) this.Label6);
|
|||
|
this.Controls.Add((Control) this.GroupBox2);
|
|||
|
this.Controls.Add((Control) this.GroupBox1);
|
|||
|
this.Controls.Add((Control) this.Button4);
|
|||
|
this.Controls.Add((Control) this.Button3);
|
|||
|
this.Controls.Add((Control) this.Button2);
|
|||
|
this.Controls.Add((Control) this.Button1);
|
|||
|
this.Controls.Add((Control) this.Dlls);
|
|||
|
this.Controls.Add((Control) this.TextBox1);
|
|||
|
this.Controls.Add((Control) this.Label4);
|
|||
|
this.Controls.Add((Control) this.Label2);
|
|||
|
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
|
|||
|
this.MaximizeBox = false;
|
|||
|
this.Name = nameof (Form1);
|
|||
|
this.Text = "SnipeInject V3";
|
|||
|
this.GroupBox1.ResumeLayout(false);
|
|||
|
this.GroupBox1.PerformLayout();
|
|||
|
this.ResumeLayout(false);
|
|||
|
this.PerformLayout();
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Label Label2
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Label2;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label2 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Label Label4
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Label4;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label4 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual TextBox TextBox1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._TextBox1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._TextBox1 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Timer Timer1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Timer1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.Timer1_Tick);
|
|||
|
if (this._Timer1 != null)
|
|||
|
this._Timer1.Tick -= eventHandler;
|
|||
|
this._Timer1 = value;
|
|||
|
if (this._Timer1 == null)
|
|||
|
return;
|
|||
|
this._Timer1.Tick += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual OpenFileDialog OpenFileDialog1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._OpenFileDialog1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
CancelEventHandler cancelEventHandler = new CancelEventHandler(this.OpenFileDialog1_FileOk);
|
|||
|
if (this._OpenFileDialog1 != null)
|
|||
|
this._OpenFileDialog1.FileOk -= cancelEventHandler;
|
|||
|
this._OpenFileDialog1 = value;
|
|||
|
if (this._OpenFileDialog1 == null)
|
|||
|
return;
|
|||
|
this._OpenFileDialog1.FileOk += cancelEventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual ListBox Dlls
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Dlls;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Dlls = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual CheckBox CheckBox1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._CheckBox1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._CheckBox1 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual CheckBox CheckBox2
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._CheckBox2;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.CheckBox2_CheckedChanged);
|
|||
|
if (this._CheckBox2 != null)
|
|||
|
this._CheckBox2.CheckedChanged -= eventHandler;
|
|||
|
this._CheckBox2 = value;
|
|||
|
if (this._CheckBox2 == null)
|
|||
|
return;
|
|||
|
this._CheckBox2.CheckedChanged += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual CheckBox CheckBox3
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._CheckBox3;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.CheckBox3_CheckedChanged);
|
|||
|
if (this._CheckBox3 != null)
|
|||
|
this._CheckBox3.CheckedChanged -= eventHandler;
|
|||
|
this._CheckBox3 = value;
|
|||
|
if (this._CheckBox3 == null)
|
|||
|
return;
|
|||
|
this._CheckBox3.CheckedChanged += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Button Button1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Button1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.Button1_Click);
|
|||
|
if (this._Button1 != null)
|
|||
|
this._Button1.Click -= eventHandler;
|
|||
|
this._Button1 = value;
|
|||
|
if (this._Button1 == null)
|
|||
|
return;
|
|||
|
this._Button1.Click += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Button Button2
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Button2;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.Button2_Click);
|
|||
|
if (this._Button2 != null)
|
|||
|
this._Button2.Click -= eventHandler;
|
|||
|
this._Button2 = value;
|
|||
|
if (this._Button2 == null)
|
|||
|
return;
|
|||
|
this._Button2.Click += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Button Button3
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Button3;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.Button3_Click);
|
|||
|
if (this._Button3 != null)
|
|||
|
this._Button3.Click -= eventHandler;
|
|||
|
this._Button3 = value;
|
|||
|
if (this._Button3 == null)
|
|||
|
return;
|
|||
|
this._Button3.Click += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Button Button4
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Button4;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|||
|
{
|
|||
|
EventHandler eventHandler = new EventHandler(this.Button4_Click);
|
|||
|
if (this._Button4 != null)
|
|||
|
this._Button4.Click -= eventHandler;
|
|||
|
this._Button4 = value;
|
|||
|
if (this._Button4 == null)
|
|||
|
return;
|
|||
|
this._Button4.Click += eventHandler;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal virtual GroupBox GroupBox1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._GroupBox1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._GroupBox1 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual GroupBox GroupBox2
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._GroupBox2;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._GroupBox2 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Label Label6
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Label6;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label6 = value;
|
|||
|
}
|
|||
|
|
|||
|
internal virtual Label Label1
|
|||
|
{
|
|||
|
[DebuggerNonUserCode] get => this._Label1;
|
|||
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label1 = value;
|
|||
|
}
|
|||
|
|
|||
|
[DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int ReadProcessMemory(
|
|||
|
int hProcess,
|
|||
|
int lpBaseAddress,
|
|||
|
[MarshalAs(UnmanagedType.VBByRefStr)] ref string lpBuffer,
|
|||
|
int nSize,
|
|||
|
ref int lpNumberOfBytesWritten);
|
|||
|
|
|||
|
[DllImport("kernel32", EntryPoint = "LoadLibraryA", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int LoadLibrary([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpLibFileName);
|
|||
|
|
|||
|
[DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int VirtualAllocEx(
|
|||
|
int hProcess,
|
|||
|
int lpAddress,
|
|||
|
int dwSize,
|
|||
|
int flAllocationType,
|
|||
|
int flProtect);
|
|||
|
|
|||
|
[DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int WriteProcessMemory(
|
|||
|
int hProcess,
|
|||
|
int lpBaseAddress,
|
|||
|
[MarshalAs(UnmanagedType.VBByRefStr)] ref string lpBuffer,
|
|||
|
int nSize,
|
|||
|
ref int lpNumberOfBytesWritten);
|
|||
|
|
|||
|
[DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int GetProcAddress(int hModule, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpProcName);
|
|||
|
|
|||
|
[DllImport("Kernel32", EntryPoint = "GetModuleHandleA", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
private static extern int GetModuleHandle([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpModuleName);
|
|||
|
|
|||
|
[DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int CreateRemoteThread(
|
|||
|
int hProcess,
|
|||
|
int lpThreadAttributes,
|
|||
|
int dwStackSize,
|
|||
|
int lpStartAddress,
|
|||
|
int lpParameter,
|
|||
|
int dwCreationFlags,
|
|||
|
ref int lpThreadId);
|
|||
|
|
|||
|
[DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
public static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId);
|
|||
|
|
|||
|
[DllImport("user32", EntryPoint = "FindWindowA", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
private static extern int FindWindow([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpClassName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpWindowName);
|
|||
|
|
|||
|
[DllImport("kernel32", EntryPoint = "CloseHandleA", CharSet = CharSet.Ansi, SetLastError = true)]
|
|||
|
private static extern int CloseHandle(int hObject);
|
|||
|
|
|||
|
private void Inject()
|
|||
|
{
|
|||
|
int num1;
|
|||
|
int lErl;
|
|||
|
int num2;
|
|||
|
try
|
|||
|
{
|
|||
|
ProjectData.ClearProjectError();
|
|||
|
num1 = 2;
|
|||
|
this.Timer1.Stop();
|
|||
|
this.TargetProcessHandle = Form1.OpenProcess(42, 0, Process.GetProcessesByName(this.TextBox1.Text)[0].Id);
|
|||
|
this.pszLibFileRemote = this.OpenFileDialog1.FileName;
|
|||
|
string lpModuleName = "Kernel32";
|
|||
|
int moduleHandle = Form1.GetModuleHandle(ref lpModuleName);
|
|||
|
string str = "LoadLibraryA";
|
|||
|
ref string local1 = ref str;
|
|||
|
this.pfnStartAddr = Form1.GetProcAddress(moduleHandle, ref local1);
|
|||
|
this.TargetBufferSize = checked (1 + Strings.Len(this.pszLibFileRemote));
|
|||
|
int num3 = Form1.VirtualAllocEx(this.TargetProcessHandle, 0, this.TargetBufferSize, 4096, 4);
|
|||
|
int targetProcessHandle1 = this.TargetProcessHandle;
|
|||
|
int lpBaseAddress = num3;
|
|||
|
ref string local2 = ref this.pszLibFileRemote;
|
|||
|
int targetBufferSize = this.TargetBufferSize;
|
|||
|
int num4 = 0;
|
|||
|
ref int local3 = ref num4;
|
|||
|
Form1.WriteProcessMemory(targetProcessHandle1, lpBaseAddress, ref local2, targetBufferSize, ref local3);
|
|||
|
int targetProcessHandle2 = this.TargetProcessHandle;
|
|||
|
int pfnStartAddr = this.pfnStartAddr;
|
|||
|
int lpParameter = num3;
|
|||
|
int num5 = 0;
|
|||
|
ref int local4 = ref num5;
|
|||
|
Form1.CreateRemoteThread(targetProcessHandle2, 0, 0, pfnStartAddr, lpParameter, 0, ref local4);
|
|||
|
Form1.CloseHandle(this.TargetProcessHandle);
|
|||
|
label_2:
|
|||
|
lErl = 1;
|
|||
|
this.Show();
|
|||
|
goto label_8;
|
|||
|
label_3:
|
|||
|
num2 = -1;
|
|||
|
switch (num1)
|
|||
|
{
|
|||
|
case 2:
|
|||
|
goto label_2;
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex) when (ex is Exception & num1 != 0 & num2 == 0)
|
|||
|
{
|
|||
|
ProjectData.SetProjectError(ex, lErl);
|
|||
|
goto label_3;
|
|||
|
}
|
|||
|
throw ProjectData.CreateProjectError(-2146828237);
|
|||
|
label_8:
|
|||
|
if (num2 == 0)
|
|||
|
return;
|
|||
|
ProjectData.ClearProjectError();
|
|||
|
}
|
|||
|
|
|||
|
private void OpenFileDialog1_FileOk(object sender, CancelEventArgs e)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
private void Form1_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
this.Button1.Text = "Browse";
|
|||
|
this.Label1.Text = "Process";
|
|||
|
this.Timer1.Interval = 50;
|
|||
|
this.Timer1.Start();
|
|||
|
}
|
|||
|
|
|||
|
private void Timer1_Tick(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!File.Exists(this.OpenFileDialog1.FileName))
|
|||
|
return;
|
|||
|
if (Process.GetProcessesByName(this.TextBox1.Text).Length == 0)
|
|||
|
{
|
|||
|
this.Label1.Text = "Waiting For " + this.TextBox1.Text + ".exe...";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
this.Timer1.Stop();
|
|||
|
this.Label1.Text = "Succefully Injected!";
|
|||
|
this.Inject();
|
|||
|
if (this.CheckBox1.Checked)
|
|||
|
this.Close();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void Button3_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
int index = checked (this.Dlls.SelectedItems.Count - 1);
|
|||
|
while (index >= 0)
|
|||
|
{
|
|||
|
this.Dlls.Items.Remove(RuntimeHelpers.GetObjectValue(this.Dlls.SelectedItems[index]));
|
|||
|
checked { index += -1; }
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void Button2_Click(object sender, EventArgs e) => this.Dlls.Items.Clear();
|
|||
|
|
|||
|
private void Button1_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
this.OpenFileDialog1.Filter = "DLL (*.dll) |*.dll|(*.*) |*.*";
|
|||
|
int num = (int) this.OpenFileDialog1.ShowDialog();
|
|||
|
this.Dlls.Items.Add((object) this.OpenFileDialog1.FileName.Substring(this.OpenFileDialog1.FileName.LastIndexOf("\\")).Replace("\\", ""));
|
|||
|
}
|
|||
|
|
|||
|
private void Button4_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!File.Exists(this.OpenFileDialog1.FileName))
|
|||
|
return;
|
|||
|
if (Process.GetProcessesByName(this.TextBox1.Text).Length == 0)
|
|||
|
{
|
|||
|
this.Label1.Text = "Waiting for " + this.TextBox1.Text + ".exe Injekcjia(F12)...";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
this.Timer1.Stop();
|
|||
|
this.Label1.Text = "Pomyslna Injekcjia!";
|
|||
|
this.Inject();
|
|||
|
if (this.CheckBox1.Checked)
|
|||
|
this.Close();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void CheckBox2_CheckedChanged(object sender, EventArgs e)
|
|||
|
{
|
|||
|
this.Button4.Enabled = false;
|
|||
|
this.Timer1.Enabled = true;
|
|||
|
}
|
|||
|
|
|||
|
private void CheckBox3_CheckedChanged(object sender, EventArgs e)
|
|||
|
{
|
|||
|
this.Button4.Enabled = true;
|
|||
|
this.Timer1.Enabled = false;
|
|||
|
}
|
|||
|
|
|||
|
private short GetAsyncKeyState(int vKey)
|
|||
|
{
|
|||
|
if (this.GetAsyncKeyState(123) != (short) 0 && File.Exists(this.OpenFileDialog1.FileName))
|
|||
|
{
|
|||
|
if (Process.GetProcessesByName(this.TextBox1.Text).Length == 0)
|
|||
|
{
|
|||
|
this.Label1.Text = "Waiting for " + this.TextBox1.Text + ".exe Injekcjia(F12)...";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
this.Timer1.Stop();
|
|||
|
this.Label1.Text = "Succefully Injected!";
|
|||
|
this.Inject();
|
|||
|
}
|
|||
|
}
|
|||
|
short asyncKeyState;
|
|||
|
return asyncKeyState;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|