Hey there reading this, obviously if you didn't notice, This is a tutorial, A really simple one telling you how to make your own dll injector, I'll be instructing you and telling you what to use in the form (e.x. : buttons/textboxes/etc.) and will provide my injector's source code (Solution) down in the downloads
What you should be able to do after this TUT
- Make your own dll injector, that injects multiple dll files at once
- Use the 'OpenFileDialog' tool
What you'll need in this TUT
First
step 2
I guess that's it, These are the codes, I don't know if that's useful or not, but if there's a problem with the tutorial or someone don't like it, please tell me why, I will be really glade ^^
Solution (Source code) Is available for anyone who can't do a step correctly to view and check out, don't forget the credit and to press thanks if I helped ^^, I just realized I am a bad, bad tutor lol well sorry xD
- [Only registered and activated users can see links. Click Here To Register...]
First
Open Visual Basic
Make a 'Windows Application Form'
[Only registered and activated users can see links. Click Here To Register...]
Put your Injector's name where it says "<name_here>" and directory where it says <location> (Just click the browse button, It's usually set to "C:\Users\Warlock\Documents\Visual Studio 2012\Projects")
__________________________
This is how the form should look like
[Only registered and activated users can see links. Click Here To Register...]
Now you can edit the form's properties from the properties tab or just code it, I'll do it with code and give you the code as well
This is the properties panel, obviously, Text = Form's title
[Only registered and activated users can see links. Click Here To Register...]
Make a 'Windows Application Form'
[Only registered and activated users can see links. Click Here To Register...]
Put your Injector's name where it says "<name_here>" and directory where it says <location> (Just click the browse button, It's usually set to "C:\Users\Warlock\Documents\Visual Studio 2012\Projects")
__________________________
This is how the form should look like
[Only registered and activated users can see links. Click Here To Register...]
Now you can edit the form's properties from the properties tab or just code it, I'll do it with code and give you the code as well
This is the properties panel, obviously, Text = Form's title
[Only registered and activated users can see links. Click Here To Register...]
code:
______________________________
Now add every single button, textbox, listbox, radiobox, checkbox, label I will mention
___________________________
RadioBox1
RadioBox2
CheckBox1
Button1
Button2
Button3
Button4
Button5
Button6
ListBox1
TextBox1
Label1
Label2
Label3
GroupBox1
OpenFileDialog1
Timer1
_________________________
Everything should look like this
[Only registered and activated users can see links. Click Here To Register...]
Now you're done placing everything, now naming them
Clear button's name > Button1
Browse button > Button4
Clear Selected button > Button5
Clear Dlls button > Button6
Inject button > Button2
Close button > Button3
___________________________
Status label > Label3
Empty Label next to status > Label2
___________________________
GroupBox > GroupBox1
Automatic radiobox > RadioButton1
Manual radiobox > RadioButton2
Close after injection button > CheckBox1
___________________________
TextBox > TextBox1
Open Dialog > OpenDialog1
Timer > Timer1
___________________________
Now after you're finished positioning everything and naming it
step 1 is finished.
PHP Code:
Me.Text = "Title here"
FormBorderStyle = Windows.F;orms.FormBorderStyle.FixedToolWindow
MaximizeBox = False
MinimizeBox = False
ShowIcon = False
Now add every single button, textbox, listbox, radiobox, checkbox, label I will mention
___________________________
RadioBox1
RadioBox2
CheckBox1
Button1
Button2
Button3
Button4
Button5
Button6
ListBox1
TextBox1
Label1
Label2
Label3
GroupBox1
OpenFileDialog1
Timer1
_________________________
Everything should look like this
[Only registered and activated users can see links. Click Here To Register...]
Now you're done placing everything, now naming them
Clear button's name > Button1
Browse button > Button4
Clear Selected button > Button5
Clear Dlls button > Button6
Inject button > Button2
Close button > Button3
___________________________
Status label > Label3
Empty Label next to status > Label2
___________________________
GroupBox > GroupBox1
Automatic radiobox > RadioButton1
Manual radiobox > RadioButton2
Close after injection button > CheckBox1
___________________________
TextBox > TextBox1
Open Dialog > OpenDialog1
Timer > Timer1
___________________________
Now after you're finished positioning everything and naming it
step 1 is finished.
step 2
Now, let's code I guess, we'll start with adding this huge code at the start of the form, double click on the form it self and paste the code before any other code, check the next spoiler for codes, here's the code I mean
The code I mean to put on top of everything but under
Clear button code :
Browse button code :
Clear selected :
Clear DLLs button :
Automatic radiobutton :
Manual radiobutton :
Inject button :
Close button :
Timer1 code :
PHP Code:
Public Class Form1
PHP Code:
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)
Dim DLLFileName As String
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
Dim ExeName As String = IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath)
Private Sub Inject()
On Error GoTo 1 ' If error occurs, app will close without any error messages
Timer1.Stop()
Dim TargetProcess As Process() = Process.GetProcessesByName(TextBox1.Text)
TargetProcessHandle = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, TargetProcess(0).Id)
pszLibFileRemote = OpenFileDialog1.FileName
pfnStartAddr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
TargetBufferSize = 1 + Len(pszLibFileRemote)
Dim Rtn As Integer
Dim LoadLibParamAdr As Integer
LoadLibParamAdr = VirtualAllocEx(TargetProcessHandle, 0, TargetBufferSize, MEM_COMMIT, PAGE_READWRITE)
Rtn = WriteProcessMemory(TargetProcessHandle, LoadLibParamAdr, pszLibFileRemote, TargetBufferSize, 0)
CreateRemoteThread(TargetProcessHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, 0)
CloseHandle(TargetProcessHandle)
1: Me.Show()
End Sub
Clear button code :
PHP Code:
TextBox1.Clear()
Browse button code :
PHP Code:
OpenFileDialog1.Filter = "DLL|*.dll"
OpenFileDialog1.ShowDialog()
Dim FileName As String
FileName = OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.LastIndexOf("\"))
Dim DllFileName As String = FileName.Replace("\", "")
Me.ListBox1.Items.Add(DllFileName)
Clear selected :
PHP Code:
For i As Integer = (ListBox1.SelectedItems.Count - 1) To 0 Step -1
ListBox1.Items.Remove(ListBox1.SelectedItems(i))
Next
Clear DLLs button :
PHP Code:
ListBox1.Items.Clear()
Automatic radiobutton :
PHP Code:
Timer1.Start()
CheckBox1.Checked = True
Manual radiobutton :
PHP Code:
Timer1.Stop()
CheckBox1.Checked = True
Inject button :
PHP Code:
If IO.File.Exists(OpenFileDialog1.FileName) Then
End If
Dim TargetProcess As Process() = Process.GetProcessesByName(TextBox1.Text)
If TargetProcess.Length = 0 Then
Label2.Text = ("Waiting For : " + TextBox1.Text + ".exe" + "....")
Else
Timer1.Stop()
Label2.ForeColor = Color.Green
Label2.Text = "Injection Successful!"
Call Inject()
If CheckBox1.Checked = True Then
Me.Close()
Else
End If
End If
Close button :
PHP Code:
Close()
Timer1 code :
PHP Code:
If IO.File.Exists(OpenFileDialog1.FileName) Then
Dim TargetProcess As Process() = Process.GetProcessesByName(TextBox1.Text)
If TargetProcess.Length = 0 Then
Label2.ForeColor = Color.Red
Label2.Text = ("Waiting For : " + TextBox1.Text + ".exe" + "....")
Else
Timer1.Stop()
Label2.ForeColor = Color.Green
Label2.Text = "Injection Successful!"
Call Inject()
If CheckBox1.Checked = True Then
Me.Close()
End If
End If
End If
I guess that's it, These are the codes, I don't know if that's useful or not, but if there's a problem with the tutorial or someone don't like it, please tell me why, I will be really glade ^^
Solution (Source code) Is available for anyone who can't do a step correctly to view and check out, don't forget the credit and to press thanks if I helped ^^, I just realized I am a bad, bad tutor lol well sorry xD