Make a Drag a& Drop Injector

Pollis This Tutorial Useful ?
Yes I Like it, Good Job 90% · 9
Noo, it's USELESS10% · 1
10 votes · poll closed
Posts 1–15 of 19 · Page 1 of 2
Make a Drag a& Drop Injector
Soo, Someone asked me to make a tutorial about how I make these drag and drop Method :

So I decided to make a full tutorial for the whole injector.
If You're Gonna Use This Method Give Credits

So let's start :

start a new Project > windows form application

Then Add these items :

- 3 Labels
- 1 ListBox
- 1 Combobox
- 1 CheckBox
- 2 Timers
- 1 OpenFileDialog

Then Name Them :
- ListBox1 --> DLLs
- Label1 --> STS
- Combobox1 --> ProcName
- CheckBox1 --> CloseAJ

Then Organize them as u like :


Now Click F7 and C+P This Code Between "Public Class Form1" and "End Class"

Code:
Private result As Short
    Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
Dim Xpos As New Integer
Dim Ypos As New Integer
Dim Pos As Point
Dim dlls4inj As New Dictionary(Of String, String)
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
    Private 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
    Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer() As Byte, ByVal nSize As Integer, ByVal lpNumberOfBytesWritten As UInteger) As Boolean
    Private 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
    Private 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, ByVal lpThreadId As Integer) As Integer
    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer

    Private Function Inject(ByVal pID As Integer, ByVal dllLocation As String) As Boolean
        If IntPtr.Size = 8 Then Throw New ArgumentException("Please make sure this program is compiled as x86, not x64. Memory functions     don() 't work so well otherwise.")
    Dim hProcess As Integer = OpenProcess(&H1F0FFF, 1, pID)
    If hProcess = 0 Then Return False
    Dim dllBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(dllLocation)
        Dim allocAddress As Integer = VirtualAllocEx(hProcess, 0, dllBytes.Length, &H1000, &H4)
    If allocAddress = Nothing Then Return False
    Dim kernelMod As Integer = GetModuleHandle("kernel32.dll")
    Dim loadLibAddr = GetProcAddress(kernelMod, "LoadLibraryA")
    If kernelMod = 0 OrElse loadLibAddr = 0 Then Return False
        WriteProcessMemory(hProcess, allocAddress, dllBytes, dllBytes.Length, 0)
        Dim libThread As Integer = CreateRemoteThread(hProcess, 0, 0, loadLibAddr, allocAddress, 0, 0)
    If libThread = 0 Then
        Return False
    Else
        WaitForSingleObject(libThread, 5000)
        CloseHandle(libThread)
    End If
    CloseHandle(hProcess)

    If CloseAJ.Checked = True Then
        Me.Close()
   Else
            MsgBox("DLL Injected.", MsgBoxStyle.Information)
        End If

    Return True
End Function
The Double Click on The Form and C+P this COde :
Code:
Timer2.Interval = 1
        Timer2.Start()
        DLLs.Name = "DLLs"
        DLLs.AllowDrop = true
        ProcName.Text = "crossfire"
       STS.Text = "Waiting for Program to Start.."
        Timer1.Interval = 50
        Timer1.Start()
        CloseAJ.Checked = True
'//=========DLL Drop Code===============
        Try
            Dim Lil As String = My.Application.CommandLineArgs(0)
            If Lil.Contains(".Dll") Or Lil.Contains(".DLL") Or Lil.Contains(".dll") Then
                Dim r
                r = New IO.StreamReader(Lil)

                For Each i In My.Application.CommandLineArgs

                    Dim FileName As String
                    FileName = i.Substring(i.LastIndexOf("\"))
                    Dim DllFileName As String = FileName.Replace("\", "")
                    Me.DLLs.Items.Add(DllFileName)
                    dlls4inj.Add(DllFileName, i)
                Next
                r.Close()
            Else
                MsgBox("The File You Dropped in not a Dll", MsgBoxStyle.Critical)
                End
            End If
        Catch ex As Exception
        End Try
        If DLLs.Items.Count = 0 Then
            MsgBox("No DLL Dropped.", MsgBoxStyle.Critical)
            End
        Else
End If
Now One Click on The DLLs and Go to Properties and Click on this Icon
and Search for this Sub :
then double click on it and C+P this code in it :
Code:
 OpenFileDialog1.Filter = "DLL (*.dll) |*.dll|All Files (*.*) |*.*"
        OpenFileDialog1.ShowDialog()
Then Double Click on OpenFileDialog1 and C+P this Code in it :

Code:
dlls4inj.Clear()
        DLLs.Items.Clear()
Dim FileName As String
        FileName = OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.LastIndexOf("\"))
Dim DllFileName As String = FileName.Replace("\", "")
        Me.DLLs.Items.Add(DllFileName)
        dlls4inj.Add(DllFileName, OpenFileDialog1.FileName)
Then Double click on Timer1 and C+P this code in it :
Code:
 If DLLs.Items.Count > 0 Then
            Dim TargetProcess As Process() = Process.GetProcessesByName(ProcName.Text)
            If TargetProcess.Length = 0 Then
                STS.Text = ("Waiting for " + ProcName.Text + ".exe")
            Else
Dim ProcID As Integer = Process.GetProcessesByName(ProcName.Text)(0).Id
                Timer1.Stop()
                Timer2.Stop()
                For Each inj As KeyValuePair(Of String, String) In dlls4inj
                    Inject(ProcID, inj.Value)
If CloseAJ.Checked = True Then
                        If STS.Text = "Dll Injected." Then
                            End
                     
                             End If

                    End If
                Next
            End If
        End If
Then Double Click on Timer2 and C+P this code :
Code:
 If ProcName.Text = "" Then
            If DLLs.Items.Count = 0 Then
                STS.Text = "Waiting For DLL"
                Timer1.Stop()
            End If
        Else
            Dim TargetProcess As Process() = Process.GetProcessesByName(ProcName.Text)
            If TargetProcess.Length = 0 Then
               
                    If DLLs.Items.Count = 0 Then
                        STS.Text = "Waiting For DLL"
                        Timer1.Stop()
                    Else
                        STS.Text = ("Waiting for " + ProcName.Text + ".exe")
                    End If

                End If
End If
     Timer1.Start()
Then Go to The end of The Code(to the last 2 lines) and C+P this Code Between "End Sub" and "End Class" :
Code:
Private Sub DLLs_DragEnter(ByVal sender As Object, ByVal e As  _
 System.Windows.Forms.DragEventArgs) Handles DLLs.DragEnter
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.All

        End If
    End Sub

    Private Sub DLLs_DragDrop(ByVal sender As Object, ByVal e As  _
    System.Windows.Forms.DragEventArgs) Handles DLLs.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim MyFiles() As String
            Dim i As Integer

            ' Assign the files to an array.
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            ' Loop through the array and add the files to the list.
            For i = 0 To MyFiles.Length - 1

                dlls4inj.Clear()
                DLLs.Items.Clear()
                Dim FileName As String
                FileName = MyFiles(i).Substring(MyFiles(i).LastIndexOf("\"))
                Dim DllFileName As String = FileName.Replace("\", "")
                Me.DLLs.Items.Add(DllFileName)
                dlls4inj.Add(DllFileName, MyFiles(i))
            Next

        End If
    End Sub
Now Run The Project.

If everything is working You'll Get a Msgbox That says "No DLL Dropped." and The Debug will stop
this means that it's working fine, so go to it's directory Drag a Dll on the App icon and enjoy the easy injection

INJECTOR FUNCTIONS :

- Drag and Drop on Icon
- Drag and Drop On ListBox(Dll Name) to Change The Dll
- Double Click on
ListBox(Dll Name) to Browse a Different Dll
- Auto Inject
 
More About Drag & drop

So..
Here I'm Gonna explain what does the 2 methods of drag and drop that I use make :

1st Method is Dropping on the Icon :
Code:
  Try
            Dim Lil As String = My.Application.CommandLineArgs(0) ' CommandLineArgs is equivalent to Dropped items that ran the app.
            If Lil.Contains(".Dll") Or Lil.Contains(".DLL") Or Lil.Contains(".dll") Then ' This is to make sure That the dropped item is a Dll
                Dim r
                r = New IO.StreamReader(Lil) ' this Dim is for reading the Directory of The item ran the app

                For Each i In My.Application.CommandLineArgs
                      ' here is where I add the dll to my Listbox
                    Dim FileName As String
                    FileName = i.Substring(i.LastIndexOf("\"))
                    Dim DllFileName As String = FileName.Replace("\", "")
                    Me.DLLs.Items.Add(DllFileName)
                    dlls4inj.Add(DllFileName, i)
                Next
                r.Close()
            Else
                MsgBox("The File You Dropped in not a Dll", MsgBoxStyle.Critical)
                End
            End If
        Catch ex As Exception
        End Try
        If DLLs.Items.Count = 0 Then
            MsgBox("No DLL Dropped.", MsgBoxStyle.Critical)
            End
        Else
End If
This code uses the Method Of CommandLineArgs which is the best method dragging and dropping on the app icon
The Code above is edited with comments to explain the drag and drop.

The 2nd Method is Dragging and Dropping onto the Listbox, or any item in Vb.net that have the property of "AllowDrop"
Code:
Private Sub DLLs_DragEnter(ByVal sender As Object, ByVal e As  _
 System.Windows.Forms.DragEventArgs) Handles DLLs.DragEnter ' It Handles Once The Dragged Item Enters The Field of Listbox1 but still not dropped
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.All ' If it's Dropped do this action.

        End If
    End Sub
Code:
Private Sub DLLs_DragDrop(ByVal sender As Object, ByVal e As  _
    System.Windows.Forms.DragEventArgs) Handles DLLs.DragDrop ' Handles The Dropping Part.
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim MyFiles() As String
            Dim i As Integer

            ' Assign the files to an array.
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            ' Loop through the array and add the files to the list.
            For i = 0 To MyFiles.Length - 1

                dlls4inj.Clear()
                DLLs.Items.Clear()
                Dim FileName As String
                FileName = MyFiles(i).Substring(MyFiles(i).LastIndexOf("\"))
                Dim DllFileName As String = FileName.Replace("\", "")
                Me.DLLs.Items.Add(DllFileName)
                dlls4inj.Add(DllFileName, MyFiles(i))
            Next

        End If
    End Sub


Thank Youu.
Comment If There is any Problem
The Project is in an Attachmnet

Virus Scan :
Jotti
VirusTotal
@Hannibal @BACKD00R @iSmexy Please Approve
DragNDropInjector_mpgh.net.zip151 KB · 74 downloads 4/47 malicious
Good job, I will try this next time.
Quote Originally Posted by Euphemistic View Post
Good job, I will try this next time.
thank youu, My Pleasure
Quote Originally Posted by lucasheer715 View Post
nice job bro
thank Youu
Can you please explain the code instead of just putting C+P
Quote Originally Posted by Vincent Dominguez View Post
Can you please explain the code instead of just putting C+P
I've Explained The New Codes(drag and drop) But other codes should be known as they are the normal Injector's codes

Quote Originally Posted by remzkee0903 View Post
Interesting..
Than You
Not bad ^^
Quote Originally Posted by sabatbatu View Post
Thank you Bro
You're Welcome

Quote Originally Posted by mamo007 View Post
Not bad ^^
Thank Youu ^^

Quote Originally Posted by sobasoba13 View Post
Good Job
Thank You Soba
Thanks. nice Tutorial
My code
Code:
Dim AlleParameter() As String = Environment.GetCommandLineArgs()
'AlleParameter(0): Directory file runs from
'AlleParameter(1): Parameter passed to application; Path from dropped file
If AlleParameter.Length > 1 Then 'Check if parameters were given
  For i As Integer = 1 To AlleParameter.Length 'For each parameter except the first (0)
    Try
      Dim tmp As String = Path.GetFileName(AlleParameter(i)) 'GetFileName()
      lstDLLs.Items.Add(tmp) 'Add to listbox
      DllBox.Add(tmp, AlleParameter(i)) 'Add to filelist
    Catch ex As Exception    
    End Try
  Next
End If
wow nice tutorial .

will juz make an experiment lols
Approved, but I don't have VB on my PC to full check it. Mention me if have something wrong !
Posts 1–15 of 19 · Page 1 of 2

Post a Reply

Similar Threads

Talk with us