[Visual Basic]Multiple Injector

Posts 1–15 of 64 · Page 1 of 5
[Visual Basic]Multiple Injector
This is an OPEN SOURCE injector.

What it does:

- Multiple .dll injection
- Only inject selected .dll
- Clear listbox
- Remove selected item from listbox
- Timer checking for process
- Save listbox content
- Load listbox content
- Close after injection
- Checkbox/textbox settings save
- Only adds items to the listbox if they are not duplicated/do not contain "OpenFileDialog1"
- error handling
- commented code


What you should add:

- Multiple selection when selecting .dlls =D Can't be bothered to do that nao



"to select add" for sure is meant to be "to add".

Virus Scan

[php]Public Class Form1

'for reading/writing the listbox content
Dim sFile As String

'declare stuffz for the injection

Private TargetProcessHandle As Integer
Private pfnStartAddr As Integer
Private pszLibFileRemote As String
Private TargetBufferSize As Integer

Public Const PROCESS_VM_READ = &H10
Public Const TH32CS_SNAPPROCESS = &H2
Public Const MEM_COMMIT = 4096
Public Const PAGE_READWRITE = 4
Public Const PROCESS_CREATE_THREAD = (&H2)
Public Const PROCESS_VM_OPERATION = (&H8)
Public Const PROCESS_VM_WRITE = (&H20)

Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer As String, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Integer
Public Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Integer, ByVal lpAddress As Integer, ByVal dwSize As Integer, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As Integer
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer As String, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Integer, ByVal lpProcName As String) As Integer
Private Declare Function GetModuleHandle Lib "Kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Integer
Public Declare Function CreateRemoteThread Lib "kernel32" (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
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandleA" (ByVal hObject As Integer) As Integer


Private Sub inject()
Dim LoadLibParamAdr As Integer
Dim Rtn As Integer
Dim TargetProcess As Process() = Process.GetProcessesByName(txtprocess.Text)

On Error GoTo 1 ' If error occurs, app will go below to "1:"

TargetProcessHandle = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, TargetProcess(0).Id)

pfnStartAddr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")

'count each listbox item
For i = 0 To ListBox1.Items.Count - 1


If selected.Checked = True Then
pszLibFileRemote = ListBox1.SelectedItem
Else
pszLibFileRemote = ListBox1.Items.Item(i)
End If


TargetBufferSize = 1 + Len(pszLibFileRemote)


LoadLibParamAdr = VirtualAllocEx(TargetProcessHandle, 0, TargetBufferSize, MEM_COMMIT, PAGE_READWRITE)
Rtn = WriteProcessMemory(TargetProcessHandle, LoadLibParamAdr, pszLibFileRemote, TargetBufferSize, 0)
CreateRemoteThread(TargetProcessHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, 0)
Next i

CloseHandle(TargetProcessHandle)
1: labelx24.ForeColor = Color.Red
labelx24.Text = "Error occured" 'error
End Sub

Public Sub ListBox_Save(ByVal ListBox As ListBox, ByVal sFile As String)

' Save content
Dim oStream As IO.StreamWriter
Dim i As Short

'create a new streamwriter
oStream = New IO.StreamWriter(sFile)

'count each listbox item

For i = 0 To ListBox.Items.Count - 1
oStream.WriteLine(ListBox.Items(i))
Next
'close streamwriter
oStream.Close()
End Sub

Public Sub ListBox_Read(ByVal ListBox As ListBox, ByVal sFile As String)

' Save content
Dim oStream As IO.StreamReader
Dim sLine As String

' Clear listbox
ListBox.Items.Clear()

' Check if file exists
Dim oFile As New IO.FileInfo(sFile)

'if the list.dat exists then read it...
If oFile.Exists() = True Then
oStream = New IO.StreamReader(sFile)
' read file
Do
'read each line
sLine = oStream.ReadLine()
If IsNothing(sLine) Then Exit Do
'add items to the listbox
ListBox.Items.Add(sLine)
'loop until it's done
Loop
'close the stream
oStream.Close()
End If
End Sub

Private Sub savelb()
'save a list.dat with listbox content
sFile = Application.StartupPath & "\List.dat"
ListBox_Save(ListBox1, sFile)
End Sub

Private Sub loadlb()
'load a list.dat to fill in listbox content
sFile = Application.StartupPath & "\List.dat"
ListBox_Read(ListBox1, sFile)
End Sub

Public Function IsProcessOpen(ByVal name As String) As Boolean

'if isprocessopen("process") then...
'if not isprocessopen("process") then...


'get all current running processes
For Each clsProcess As Process In Process.GetProcesses

If clsProcess.ProcessName.Contains(name) Then


Return True

End If
Next
' Do nothing

Return False
End Function

Private Sub checkprocess_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

'check if process is running
If Not IsProcessOpen(txtprocess.Text) Then
labelx24.ForeColor = Color.Red
labelx24.Text = "Please start the process..."
Else
labelx24.ForeColor = Color.Green
labelx24.Text = "Process Found!"
End If
End Sub

Private Sub txtprocess_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtprocess.TextChanged
'save current process textbox text in settings
My.Settings.processs = txtprocess.Text

'save/reload settings
My.Settings.Save()
My.Settings.Reload()
End Sub

Private Sub inject_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdinject.Click

'declare a process
Try
Dim TargetProcess As Process() = Process.GetProcessesByName(txtprocess.Text)


'if txtprocess.text = ""
If TargetProcess.Length = 0 Then
MsgBox("Waiting for " & txtprocess.Text)
Else

'do injection
Call inject()


labelx24.Text = "Dll File Injected!"
Timer1.Stop()

End If
Catch
End Try

'save listbox content
savelb()

'set the process
My.Settings.processs = txtprocess.Text

'save settings
My.Settings.Save()
My.Settings.Reload()

'close if 'close checkbox' is checked
If closebox.Checked = True Then
Me.Close()
End If

End Sub

Private Sub selectdll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles dll.Click

'only .dlls files are selectable
opf.Title = "Select a .dll"
opf.Filter = "DLL (*.DLL)|*.Dll"
opf.Multiselect = True

'open the open file dialog
opf.ShowDialog()
'add the .dll to the listbox


For Each item As String In opf.FileNames
If Not ListBox1.Items.Contains(item) Then
If Not opf.FileName = "OpenFileDialog1" Then



ListBox1.Items.Add(item)


' dll.Text = System.IO.Path.GetFileName(opf.FileName)


End If
End If

Next item

'save listbox content
savelb()

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'load listbox content
loadlb()

'process textbox
txtprocess.Text = My.Settings.processs

'check/uncheck checkboxes
selected.Checked = My.Settings.selectedonly
closebox.Checked = My.Settings.close
End Sub

Private Sub clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdclear.Click
'clear listbox(obviously)
ListBox1.Items.Clear()

'save listbox content
savelb()
End Sub


Private Sub removeselected_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdrs.Click
'remove the selected item
Try
If ListBox1.SelectedIndex <> -1 Then
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
End If
Catch
End Try

'save listbox content
savelb()
End Sub

Private Sub selected_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selected.CheckedChanged
'save checkbox setting
My.Settings.selectedonly = selected.Checked

'save/reload settings
My.Settings.Save()
My.Settings.Reload()
End Sub

Private Sub closebox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closebox.CheckedChanged
'save checkbox setting
My.Settings.close = closebox.Checked

'save/reload settings
My.Settings.Save()
My.Settings.Reload()
End Sub
End Class
[/php]

Sorry I cannot upload any further virusscan, those sites are rarely working for me -.-


Enjoy.
Injector[OS]rar.rarattachment deleted · 429 downloads before removal
Omg, Not another 1 .
Quote Originally Posted by dylan40 View Post
Omg, Not another 1 .
Stop spamming if you dont like it stay out of the thread!

Blubb1337 good job bro!
Did you even read my post actually?

I'm sick of people posting injector questions, it's OPEN SOURCE. I bet you didn't read it at all. If I'd really RELEASE an injector it would be more awesome :O

The other open source injectors lying around aren't working.
Great job Blubb!! This is a great open source, since all the other ones aren't multiple injector!!!
Deserves an add to Tutorial thread as Open Source??

Great job! Leaves the user to customize GUI and great that you had a clean GUI to begin with!
Quote Originally Posted by Invidus View Post
Great job Blubb!! This is a great open source, since all the other ones aren't multiple injector!!!
Deserves an add to Tutorial thread as Open Source??

Great job! Leaves the user to customize GUI and great that you had a clean GUI to begin with!
Thanks lol. The other open source injector do not work tho, I've tried them =D
Quote Originally Posted by Blubb1337 View Post
This is an OPEN SOURCE injector.

What it does:

- Multiple .dll injection
- Only inject selected .dll
- Clear listbox
- Remove selected item from listbox
- Timer checking for process
- Save listbox content
- Load listbox content
- Close after injection
- Checkbox/textbox settings save
- Only adds items to the listbox if they are not duplicated/do not contain "OpenFileDialog1"
- error handling
- commented code


What you should add:

- Multiple selection when selecting .dlls =D Can't be bothered to do that nao



"to select add" for sure is meant to be "to add".

Virus Scan

Sorry I cannot upload any further virusscan, those sites are rarely working for me -.-

Enjoy.
You should join me in making an .DLL injector tut (that is good) so people stop asking questions about them .
and urs looks kinda nice.
Doing a tutorial based on this source isn't hard anymore is it

I've commented the code tho.
Quote Originally Posted by Blubb1337 View Post
Doing a tutorial based on this source isn't hard anymore is it

I've commented the code tho.
well i can't get to making the tut right now because ur stuff is still pending(im going to steal ur source if thats ok with u unless u want to help me and maybe lolland idk if he wants to help but then it wont be stealing) ,but if its easy i'll just add some dumb SH** that people FOR SOME REASON THINK MAKES THERE INJECTOR BETTER!
Lawl this is nice but i reckon more injectors won't be needed atm, because IP10 is going to destroy all of em.
Quote Originally Posted by Invidus View Post
Lawl this is nice but i reckon more injectors won't be needed atm, because IP10 is going to destroy all of em.
IP10???????
Quote Originally Posted by Blubb1337 View Post
IP10???????
I RECKON(sorry i had to do that) That its an injector he is making if its a beast that would be cool BUT WE DON'T NEED MORE INJECTORS WE NEED A BIG INJECTOR TUT FOR THE.(But if its good idc i just hate seeing the basic injectors saying theirs are better WHEN THEY ALL HAVE THE SAME BASE SOURCE)
Multiple dll SELECTION

Code:
Private Sub selectdll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles dll.Click

           'only .dlls files are selectable
        opf.Title = "Select a .dll"
        opf.Filter = "DLL (*.DLL)|*.Dll"
        opf.Multiselect = True

        'open the open file dialog
        opf.ShowDialog()
        'add the .dll to the listbox


        For Each item As String In opf.FileNames
            If Not ListBox1.Items.Contains(item) Then
                If Not opf.FileName = "OpenFileDialog1" Then



                    ListBox1.Items.Add(item)

                    'ListBox1.Items.Add(opf.FileName)
                    'dll.Text = System.IO.Path.GetFileName(opf.FileName)


                End If
            End If
        Next item

        'save listbox content
        savelb()
    End Sub
Multiselection is nais

Woops, sorry for double posting

Merge my posts pl0x ^.-
Source code added to first post. =D
IP10 = InjectPlz10
Samueldo's next release, in 2 days on his bday
Posts 1–15 of 64 · Page 1 of 5

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us