Injector Source Code

Posts 1–10 of 10 · Page 1 of 1
Injector Source Code
Code:
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.IO
Imports System****ntime.CompilerServices
Imports System****ntime.InteropServices
Imports System.Windows.Forms

Namespace ***********
    <DesignerGenerated> _
    Public Class Form1
        Inherits Form
        ' Methods
        Public Sub New()
            AddHandler MyBase.Load, New EventHandler(AddressOf Me.Form1_Load)
            Me.ExeName = Path.GetFileNameWithoutExtension(Application.ExecutablePath)
            Me.InitializeComponent
        End Sub

        Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.OpenFileDialog1.Filter = "DLL (*.dll) |*.dll|(*.*) |*.*"
            Me.OpenFileDialog1.ShowDialog
            Dim item As String = Me.OpenFileDialog1.FileName.Substring(Me.OpenFileDialog1.FileName.LastIndexOf("\")).Replace("\", "")
            Me.Dlls.Items.Add(item)
        End Sub

        Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.Dlls.Items.Clear
        End Sub

        Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
            If File.Exists(Me.OpenFileDialog1.FileName) Then
                If (Process.GetProcessesByName(Me.TextBox2.Text).Length = 0) Then
                    Me.Label2.Text = ("Waiting for " & Me.TextBox2.Text & ".exe Injection(F12)...")
                Else
                    Me.Timer1.Stop
                    Me.Label2.Text = "Successful Injected!"
                    Me.Inject
                    If MyProject.Forms.Form2.CheckBox1.Checked Then
                        Me.Close
                    End If
                End If
            End If
        End Sub

        Private Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim i As Integer = (Me.Dlls.SelectedItems.Count - 1)
            Do While (i >= 0)
                Me.Dlls.Items.Remove(RuntimeHelpers.GetObjectValue(Me.Dlls.SelectedItems.Item(i)))
                i = (i + -1)
            Loop
        End Sub

        <DllImport("kernel32", EntryPoint:="CloseHandleA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Private Shared Function CloseHandle(ByVal hObject As Integer) As Integer
        End Function

        Private Sub CloseToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.Close
        End Sub

        <DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function CreateRemoteThread(ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByRef lpThreadId As Integer) As Integer
        End Function

        Private Sub CreditsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
            Interaction.MsgBox("Injector Made By ********", MsgBoxStyle.Information, Nothing)
        End Sub

        <DebuggerNonUserCode> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try 
                If (disposing AndAlso (Not Me.components Is Nothing)) Then
                    Me.components.Dispose
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub

        <DllImport("user32", EntryPoint:="FindWindowA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Private Shared Function FindWindow(<MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpClassName As String, <MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpWindowName As String) As Integer
        End Function

        Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
            Me.Button1.Text = "Add"
            Me.Label2.Text = "Waiting for select dll file"
            Me.Timer1.Interval = 50
            Me.Timer1.Start
        End Sub

        <DllImport("Kernel32", EntryPoint:="GetModuleHandleA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Private Shared Function GetModuleHandle(<MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpModuleName As String) As Integer
        End Function

        <DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function GetProcAddress(ByVal hModule As Integer, <MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpProcName As String) As Integer
        End Function

        <DebuggerStepThrough> _
        Private Sub InitializeComponent()
            Me.SuspendLayout()
            '
            'Form1
            '
            Me.AllowDrop = True
            Me.BackColor = System.Drawing.Color.Black
            Me.ClientSize = New System.Drawing.Size(284, 262)
            Me.MaximizeBox = False
            Me.MinimizeBox = False
            Me.Name = "Form1"
            Me.TransparencyKey = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
            Me.ResumeLayout(False)

        End Sub

        Private Sub Inject()
            Dim num6 As Integer
            Try 
                Dim num5 As Integer
                ProjectData.ClearProjectError
                Dim num4 As Integer = 2
                Me.Timer1.Stop
                Dim processesByName As Process() = Process.GetProcessesByName(Me.TextBox2.Text)
                Me.TargetProcessHandle = Form1.OpenProcess(&H2A, 0, processesByName(0).Id)
                Me.pszLibFileRemote = Me.OpenFileDialog1.FileName
                Dim lpModuleName As String = "Kernel32"
                Dim lpProcName As String = "LoadLibraryA"
                Me.pfnStartAddr = Form1.GetProcAddress(Form1.GetModuleHandle((lpModuleName)), (lpProcName))
                Me.TargetBufferSize = (1 + Strings.Len(Me.pszLibFileRemote))
                Dim lpBaseAddress As Integer = Form1.VirtualAllocEx(Me.TargetProcessHandle, 0, Me.TargetBufferSize, &H1000, 4)
                Dim lpNumberOfBytesWritten As Integer = 0
                Dim num2 As Integer = Form1.WriteProcessMemory(Me.TargetProcessHandle, lpBaseAddress, (Me.pszLibFileRemote), Me.TargetBufferSize, (lpNumberOfBytesWritten))
                lpNumberOfBytesWritten = 0
                Form1.CreateRemoteThread(Me.TargetProcessHandle, 0, 0, Me.pfnStartAddr, lpBaseAddress, 0, (lpNumberOfBytesWritten))
                Form1.CloseHandle(Me.TargetProcessHandle)
            Label_00DD:
                num6 = 1
                Me.Show
                If (num5 <> 0) Then
                    ProjectData.ClearProjectError
                End If
                Return
            Label_00E8:
                num5 = -1
                Select Case num4
                    Case 0, 1
                        goto Label_0124
                    Case 2
                        goto Label_00DD
                End Select
            Catch obj1 As Object When (?)
                ProjectData.SetProjectError(DirectCast(obj1, Exception), num6)
                goto Label_00E8
            End Try
        Label_0124:
            Throw ProjectData.CreateProjectError(-2146828237)
        End Sub

        <DllImport("kernel32", EntryPoint:="LoadLibraryA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function LoadLibrary(<MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpLibFileName As String) As Integer
        End Function

        Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As CancelEventArgs)
        End Sub

        <DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function OpenProcess(ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
        End Function

        Private Sub OptionsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
            MyProject.Forms.Form2.Show
        End Sub

        <DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function ReadProcessMemory(ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, <MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpBuffer As String, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        End Function

        Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
            If File.Exists(Me.OpenFileDialog1.FileName) Then
                If (Process.GetProcessesByName(Me.TextBox2.Text).Length = 0) Then
                    Me.Label2.Text = ("Waiting for " & Me.TextBox2.Text & ".exe...")
                Else
                    Me.Timer1.Stop
                    Me.Label2.Text = "Successful Injected!"
                    Me.Inject
                    If MyProject.Forms.Form2.CheckBox3.Checked Then
                        Me.Close
                    End If
                End If
            End If
        End Sub

        <DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function VirtualAllocEx(ByVal hProcess As Integer, ByVal lpAddress As Integer, ByVal dwSize As Integer, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As Integer
        End Function

        <DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function WriteProcessMemory(ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, <MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpBuffer As String, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        End Function


        ' Properties
        Friend Overridable Property Button1 As Button
            Get
                Return Me._Button1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.Button1_Click)
                If (Not Me._Button1 Is Nothing) Then
                    RemoveHandler Me._Button1.Click, handler
                End If
                Me._Button1 = WithEventsValue
                If (Not Me._Button1 Is Nothing) Then
                    AddHandler Me._Button1.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property Button2 As Button
            Get
                Return Me._Button2
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.Button2_Click)
                If (Not Me._Button2 Is Nothing) Then
                    RemoveHandler Me._Button2.Click, handler
                End If
                Me._Button2 = WithEventsValue
                If (Not Me._Button2 Is Nothing) Then
                    AddHandler Me._Button2.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property Button3 As Button
            Get
                Return Me._Button3
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.Button3_Click)
                If (Not Me._Button3 Is Nothing) Then
                    RemoveHandler Me._Button3.Click, handler
                End If
                Me._Button3 = WithEventsValue
                If (Not Me._Button3 Is Nothing) Then
                    AddHandler Me._Button3.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property Button4 As Button
            Get
                Return Me._Button4
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.Button4_Click)
                If (Not Me._Button4 Is Nothing) Then
                    RemoveHandler Me._Button4.Click, handler
                End If
                Me._Button4 = WithEventsValue
                If (Not Me._Button4 Is Nothing) Then
                    AddHandler Me._Button4.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property CloseToolStripMenuItem As ToolStripMenuItem
            Get
                Return Me._CloseToolStripMenuItem
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As ToolStripMenuItem)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.CloseToolStripMenuItem_Click)
                If (Not Me._CloseToolStripMenuItem Is Nothing) Then
                    RemoveHandler Me._CloseToolStripMenuItem.Click, handler
                End If
                Me._CloseToolStripMenuItem = WithEventsValue
                If (Not Me._CloseToolStripMenuItem Is Nothing) Then
                    AddHandler Me._CloseToolStripMenuItem.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property CreditsToolStripMenuItem As ToolStripMenuItem
            Get
                Return Me._CreditsToolStripMenuItem
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As ToolStripMenuItem)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.CreditsToolStripMenuItem_Click)
                If (Not Me._CreditsToolStripMenuItem Is Nothing) Then
                    RemoveHandler Me._CreditsToolStripMenuItem.Click, handler
                End If
                Me._CreditsToolStripMenuItem = WithEventsValue
                If (Not Me._CreditsToolStripMenuItem Is Nothing) Then
                    AddHandler Me._CreditsToolStripMenuItem.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property Dlls As ListBox
            Get
                Return Me._Dlls
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As ListBox)
                Me._Dlls = WithEventsValue
            End Set
        End Property

        Friend Overridable Property FilesToolStripMenuItem As ToolStripMenuItem
            Get
                Return Me._FilesToolStripMenuItem
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As ToolStripMenuItem)
                Me._FilesToolStripMenuItem = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label1 As Label
            Get
                Return Me._Label1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Label)
                Me._Label1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label2 As Label
            Get
                Return Me._Label2
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Label)
                Me._Label2 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label3 As Label
            Get
                Return Me._Label3
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Label)
                Me._Label3 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property MenuStrip1 As MenuStrip
            Get
                Return Me._MenuStrip1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As MenuStrip)
                Me._MenuStrip1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property OpenFileDialog1 As OpenFileDialog
            Get
                Return Me._OpenFileDialog1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As OpenFileDialog)
                Dim handler As CancelEventHandler = New CancelEventHandler(AddressOf Me.OpenFileDialog1_FileOk)
                If (Not Me._OpenFileDialog1 Is Nothing) Then
                    RemoveHandler Me._OpenFileDialog1.FileOk, handler
                End If
                Me._OpenFileDialog1 = WithEventsValue
                If (Not Me._OpenFileDialog1 Is Nothing) Then
                    AddHandler Me._OpenFileDialog1.FileOk, handler
                End If
            End Set
        End Property

        Friend Overridable Property OptionsToolStripMenuItem As ToolStripMenuItem
            Get
                Return Me._OptionsToolStripMenuItem
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As ToolStripMenuItem)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.OptionsToolStripMenuItem_Click)
                If (Not Me._OptionsToolStripMenuItem Is Nothing) Then
                    RemoveHandler Me._OptionsToolStripMenuItem.Click, handler
                End If
                Me._OptionsToolStripMenuItem = WithEventsValue
                If (Not Me._OptionsToolStripMenuItem Is Nothing) Then
                    AddHandler Me._OptionsToolStripMenuItem.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property SettingsToolStripMenuItem As ToolStripMenuItem
            Get
                Return Me._SettingsToolStripMenuItem
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As ToolStripMenuItem)
                Me._SettingsToolStripMenuItem = WithEventsValue
            End Set
        End Property

        Friend Overridable Property TextBox1 As TextBox
            Get
                Return Me._TextBox1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As TextBox)
                Me._TextBox1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property TextBox2 As TextBox
            Get
                Return Me._TextBox2
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As TextBox)
                Me._TextBox2 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Timer1 As Timer
            Get
                Return Me._Timer1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized)> _
            Set(ByVal WithEventsValue As Timer)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.Timer1_Tick)
                If (Not Me._Timer1 Is Nothing) Then
                    RemoveHandler Me._Timer1.Tick, handler
                End If
                Me._Timer1 = WithEventsValue
                If (Not Me._Timer1 Is Nothing) Then
                    AddHandler Me._Timer1.Tick, handler
                End If
            End Set
        End Property


        ' Fields
        <AccessedThroughProperty("Button1")> _
        Private _Button1 As Button
        <AccessedThroughProperty("Button2")> _
        Private _Button2 As Button
        <AccessedThroughProperty("Button3")> _
        Private _Button3 As Button
        <AccessedThroughProperty("Button4")> _
        Private _Button4 As Button
        <AccessedThroughProperty("CloseToolStripMenuItem")> _
        Private _CloseToolStripMenuItem As ToolStripMenuItem
        <AccessedThroughProperty("CreditsToolStripMenuItem")> _
        Private _CreditsToolStripMenuItem As ToolStripMenuItem
        <AccessedThroughProperty("Dlls")> _
        Private _Dlls As ListBox
        <AccessedThroughProperty("FilesToolStripMenuItem")> _
        Private _FilesToolStripMenuItem As ToolStripMenuItem
        <AccessedThroughProperty("Label1")> _
        Private _Label1 As Label
        <AccessedThroughProperty("Label2")> _
        Private _Label2 As Label
        <AccessedThroughProperty("Label3")> _
        Private _Label3 As Label
        <AccessedThroughProperty("MenuStrip1")> _
        Private _MenuStrip1 As MenuStrip
        <AccessedThroughProperty("OpenFileDialog1")> _
        Private _OpenFileDialog1 As OpenFileDialog
        <AccessedThroughProperty("OptionsToolStripMenuItem")> _
        Private _OptionsToolStripMenuItem As ToolStripMenuItem
        <AccessedThroughProperty("SettingsToolStripMenuItem")> _
        Private _SettingsToolStripMenuItem As ToolStripMenuItem
        <AccessedThroughProperty("TextBox1")> _
        Private _TextBox1 As TextBox
        <AccessedThroughProperty("TextBox2")> _
        Private _TextBox2 As TextBox
        <AccessedThroughProperty("Timer1")> _
        Private _Timer1 As Timer
        Private components As IContainer
        Private DLLFileName As String
        Private ExeName As String
        Public Const MEM_COMMIT As Integer = &H1000
        Public Const PAGE_READWRITE As Integer = 4
        Private pfnStartAddr As Integer
        Public Const PROCESS_CREATE_THREAD As Integer = 2
        Public Const PROCESS_VM_OPERATION As Integer = 8
        Public Const PROCESS_VM_READ As Integer = &H10
        Public Const PROCESS_VM_WRITE As Integer = &H20
        Private pszLibFileRemote As String
        Private TargetBufferSize As Integer
        Private TargetProcessHandle As Integer
        Public Const TH32CS_SNAPPROCESS As Integer = 2

        Private Sub Form1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub
    End Class
End Namespace
Thank And Rep Me
why does that look more complicated then it needs to be
Lmao My Friend Helped ME
Quote Originally Posted by Swiftdude View Post
why does that look more complicated then it needs to be
You got right...you only need 200-300 lines of code^^
Quote Originally Posted by FlaVour View Post
You got right...you only need 200-300 lines of code^^
Still seems like a lot.
Ur friends help you or u just leeched this
Sapass Fuk off Dont critisize and no my friend made it
way to complicated and i posted it in as a code to test it out and got about 100 errors
i counted my source i got 132 lines
nice
but it
is very common
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us