[Help] Multi-Inject Problem

Posts 1–15 of 23 · Page 1 of 2
[Help] Multi-Inject Problem
Okay, I'm trying to update my CA multi-tool.
I got some feedback to improve my injector, so I changed Ugleh's code a bit to mine.
What I want to do is make my program inject multiple dll files. Right now it injects the last DLL file selected.
Here's my code:
Code:
Public Class Form4

    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.Hide()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If CheckBox1.Checked = True Then
            If IO.File.Exists(OpenFileDialog1.FileName) Then
                On Error Resume Next
                Dim TargetProcess As Process() = Process.GetProcessesByName(TextBox1.Text)
                If TargetProcess.Length = 0 Then
                Else
                    Timer1.Stop()
                    Label3.Text = "Injected"
                    Call Inject()
                End If
            End If
        Else
            'do something else
        End If
    End Sub

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

    End Sub


    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            CheckBox2.Checked = False
            Button2.Enabled = False
            Timer1.Interval = 50
            Timer1.Start()
        End If
    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked = True Then
            CheckBox1.Checked = False
            Button2.Enabled = True
        End If
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        If ListBox1.Text = "" Then
            Label3.Text = "Waiting for DLL files"
        Else
            Label3.ForeColor = Color.Red '
            Label3.Text = "Waiting for " + TextBox1.Text + ".exe"
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        On Error Resume Next
        ListBox1.Items.Clear()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        On Error Resume Next
        OpenFileDialog1.Filter = "DLL (*.dll) |*.dll|(*.*) |*.*"
        OpenFileDialog1.ShowDialog()
        OpenFileDialog1.Title = "skiiiz_dll_injector"
        Dim FileName As String
        FileName = OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.LastIndexOf("\"))
        Dim DllFileName As String = FileName.Replace("\", "")
        ListBox1.Items.Add(DllFileName)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Interval = 50
        Timer1.Start()
        Label3.Text = "Injected"
        Call Inject()

    End Sub
End Class
Obviously, why else would I have said I changed it.
:/ read
Ok i know how to fix it but what good would it be if i just told you the code? Ill give you a hint.
Code:
HINT: pszLibFileRemote = OpenFileDialog1.FileName
That is the code that needs to be changed. CHANGE IT, NAO
Quote Originally Posted by Bombsaway707 View Post
Ok i know how to fix it but what good would it be if i just told you the code? Ill give you a hint.
Code:
HINT: pszLibFileRemote = OpenFileDialog1.FileName
That is the code that needs to be changed. CHANGE IT, NAO
lolol
I knew that, I just don't know what to change it to. I tried OpenFileDialog1.FileNames(DllFileName). It still doesn't work.
Cmon can't you just tell me ><
Quote Originally Posted by skiiiz View Post
lolol
I knew that, I just don't know what to change it to. I tried OpenFileDialog1.FileNames(DllFileName). It still doesn't work.
Cmon can't you just tell me ><
what would you be learning if i just told you??
Simple, you can't find out an answer when you know your wrong.
At least give me a bigger hint.
Quote Originally Posted by skiiiz View Post
Simple, you can't find out an answer when you know your wrong.
At least give me a bigger hint.
Ok, you have to do something with the listbox items count. BTW the select all DLLs code is only 2 lines xD
(if you havent figured it out by tomorrow ill give you a bigger hint)
aww.
I was planning on releasing my CA tool 2day
Well cya next week, got science exam on monday - gotta study.
bombs did the multiselect thing work
Quote Originally Posted by hopefordope View Post
bombs did the multiselect thing work
Hmm which 1 r u talking about? There was like 10 "multi select" things posted but i had to code my own to get the damn thing to actually multinject
Cmon bomb, I'll put u in credits if you gimme the code ><
Quote Originally Posted by skiiiz View Post
Cmon bomb, I'll put u in credits if you gimme the code ><
Lol im going to give you the code but i want you to learn from it, not just C&P
bro ty for manual injector code
i would like he code for multi inject too
credits to whoever shows me how
Posts 1–15 of 23 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us