Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help] Injector [solved]

[Help] Injector [solved]

Posts 1–12 of 12 · Page 1 of 1
SK
Skinnlaw
[Help] Injector [solved]
UPDATED!!
Hey all,

How to make a injector that extracts the .dll that I had addded with "Add Exitsing File" and then inject into process ?

Thanks!!
#1 · edited 15y ago · 15y ago
aLcohoL_95
aLcohoL_95
i think u cant delete it until injectr will be closed
bcuz injector is using dll
and if u delete it u cant use dll /boh
#2 · 15y ago
Jason
Jason
Quote Originally Posted by aLcohoL_95 View Post
i think u cant delete it until injectr will be closed
bcuz injector is using dll
and if u delete it u cant use dll /boh
alcohol is right. The dll is still being used by the process, pretty sure you can't get rid of the dll.

Wes says, you can if you use manual mapping, but not if you use regular injection methods.
#3 · 15y ago
HA
Hawk_
If you're trying to make an injector THAT WORKS, VB6 is your best bet. VB2008 & 10 sort of suck for injection. That meaning that half of the time it doesn't work and doesn't work on the machine it's not compiled on if the machine it's compiled on is x64.

vb6 works.
#4 · 15y ago
SK
Skinnlaw
UPDATED, please help me or pm me a source...
#5 · 15y ago
Jason
Jason
Quote Originally Posted by Skinnlaw View Post
UPDATED, please help me or pm me a source...
Add it as a resource, not an existing item.
#6 · 15y ago
RE
Rene8848
is it not better to autorun the .dll (download + inject) like so many loaders
#7 · 15y ago
Jason
Jason
Quote Originally Posted by Rene8848 View Post
is it not better to autorun the .dll (download + inject) like so many loaders
Yes, but it means you need to learn how to manually map the DLL to the process rather than standard injection.
#8 · 15y ago
EN
encrypted94
Code:
Public Class Main
    'Injector Declarations
    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 = 4S
    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
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Dim SCurrentDll As String
    Dim SFileName
    Dim DoneInject As String



    Dim oloc As New Point(0, 0)
    Dim ocur As New Point(System.Windows.Forms.Cursor.Position)
    Dim curpos, appsize As New Point(0, 0)
    Private Sub sync()
        curpos = Cursor.Position
        appsize = Me.Size
    End Sub
    Private Sub refposition()
        oloc = Me.Location
        ocur = System.Windows.Forms.Cursor.Position

    End Sub


    Private Sub CheckAuto_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckAuto.CheckedChanged
        If CheckAuto.Checked = True Then
            If DoneInject = True Then
                btnManual.Text = "New Injection"
                Exit Sub
            End If
            btnManual.Enabled = False
            Timer1.Enabled = True
        Else
            Timer1.Enabled = False
            btnManual.Text = "Inject"
            btnManual.Enabled = True
            lblStatus.Text = "Waiting for Injection..."
        End If
    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        LVItems.Items.Clear()
    End Sub

    Private Sub btnRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRemove.Click
        For i As Integer = LVItems.SelectedIndices.Count - 1 To 0 Step -1

            LVItems.Items.RemoveAt(LVItems.SelectedIndices(i))

        Next
        btnRemove.Enabled = False
    End Sub

    Private Sub btnManual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnManual.Click
        If Not txtProcess.Tex*****ntains(".exe") Then
            txtProcess.Text = txtProcess.Text & ".exe"
        End If
        If btnManual.Text = "New Injection" Then
            DoneInject = False
            btnManual.Text = "Inject"
            btnManual.Enabled = False
            Exit Sub
        End If
        SFileName = Microsoft.VisualBasic.Left(txtProcess.Text, txtProcess.Text.Length + -4)
        Dim TargerProcess As Process() = Process.GetProcessesByName(SFileName)
        If LVItems.Items.Count < 1 Then
            lblStatus.Text = "No DLL File to inject"
            btnManual.Enabled = False
            Exit Sub
        End If
        If IsNumeric(txtDelay.Text) Then
            System.Threading.Thread.Sleep(txtDelay.Text * 1000)
        End If

        If TargerProcess.Length = 0 Then
            lblStatus.Text = "Cant find " & SFileName & ".exe!"
        Else
            For i = 0 To (LVItems.Items.Count + -1)
                SCurrentDll = LVItems.Items(i)
                Call Inject()
                lblStatus.Text = "Sucessfully Injected DLL!"
                Timer1.Enabled = False
                DoneInject = True
            Next i
            If CheckClose.Checked = True Then
                System.Threading.Thread.Sleep(1000)
                Close()
            End If

        End If
        btnManual.Enabled = False
    End Sub

    Private Sub wait(ByVal interval As Integer)
        Dim sw As New Stopwatch
        sw.Start()
        Do While sw.ElapsedMilliseconds < interval
            ' Allows UI to remain responsive
            Application.DoEvents()
        Loop
        sw.Stop()
    End Sub

    Private Sub Inject()
        On Error GoTo 1
        Timer1.Stop()
        'Inject Dll
        Dim TargetProcess As Process() = Process.GetProcessesByName(SFileName)
        TargetProcessHandle = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, TargetProcess(0).Id)
        pszLibFileRemote = SCurrentDll
        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

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Not txtProcess.Tex*****ntains(".exe") Then
            txtProcess.Text = txtProcess.Text & ".exe"
        End If
        SFileName = Microsoft.VisualBasic.Left(txtProcess.Text, txtProcess.Text.Length + -4)
        Dim TargerProcess As Process() = Process.GetProcessesByName(SFileName)
        If LVItems.Items.Count < 1 Then
            lblStatus.Text = "Waiting for DLL File"
            btnManual.Enabled = False
            Exit Sub
        End If
        If TargerProcess.Length = 0 Then
            lblStatus.Text = "Waiting for " & SFileName & ".exe"
            Exit Sub
        End If
        If IsNumeric(txtDelay.Text) Then
            System.Threading.Thread.Sleep(txtDelay.Text * 1000)
        End If

        If TargerProcess.Length = 0 Then
            lblStatus.Text = "Waiting for " & SFileName & ".exe"
        Else
            For i = 0 To (LVItems.Items.Count + -1)
                SCurrentDll = LVItems.Items(i)
                Call Inject()
                lblStatus.Text = "Sucessfully Injected DLL!"
                Timer1.Enabled = False
                DoneInject = True
            Next i
            If CheckClose.Checked = True Then
                System.Threading.Thread.Sleep(1000)
                Close()
            End If

        End If


    End Sub


    Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
        Dim fdlg As OpenFileDialog = New OpenFileDialog()
        fdlg.Title = "Pick a dll to addzor"
        fdlg.Filter = "Dynamic Link Library (*.dll*)|*.dll*"
        fdlg.FilterIndex = 2
        fdlg.RestoreDirectory = True
        If fdlg.ShowDialog() = DialogResult.OK Then
            If Not LVItems.Items.Contains(fdlg.SafeFileName) Then
                LItems.Items.Add(fdlg.FileName)
                LVItems.Items.Add(fdlg.SafeFileName)
                btnClear.Enabled = True
            Else
                MsgBox("DLL is already on the list!")
            End If
        End If
    End Sub
   

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Dim FILE_NAME As String = System.AppDomain.CurrentDomain.BaseDirectory & "VietNamz_Injector.ini"
        If System.IO.File.Exists(FILE_NAME) = True Then
            Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
            objWriter.WriteLine("[General]")
            objWriter.WriteLine("Process: " & (txtProcess.Text))
            objWriter.WriteLine("Delay: " & (txtDelay.Text))
            objWriter.WriteLine("AutoInject: " & (CheckAuto.Checked))
            objWriter.WriteLine("AutoClose: " & (CheckClose.Checked))
            objWriter.WriteLine("[DLL]")
            For i = 0 To LVItems.Items.Count + -1
                objWriter.WriteLine("CName" & i & ": " & LVItems.Items(i))
                objWriter.WriteLine("CPath" & i & ": " & LItems.Items(i))
            Next i
            objWriter.Close()
        Else
            MsgBox("Could not save settings! (File Not Found)", MsgBoxStyle.Critical, "Save Settings Error")
        End If
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim FILE_NAME As String = System.AppDomain.CurrentDomain.BaseDirectory & "VietNamz_Injector.ini"
        Dim Temp As String
        Dim i, b As Integer
        'Load setttings
        If System.IO.File.Exists(FILE_NAME) = True Then
            Dim objReader As New System.IO.StreamReader(FILE_NAME)
            Temp = (objReader.ReadLine)
            Temp = (objReader.ReadLine)
            On Error Resume Next
            txtProcess.Text = (Microsoft.VisualBasic.Right(Temp, Temp.Length + -9))
            Temp = (objReader.ReadLine)
            txtDelay.Text = (Microsoft.VisualBasic.Right(Temp, Temp.Length + -7))
            Temp = (objReader.ReadLine)
            CheckAuto.Checked = (Microsoft.VisualBasic.Right(Temp, Temp.Length + -12))
            Temp = (objReader.ReadLine)
            CheckClose.Checked = (Microsoft.VisualBasic.Right(Temp, Temp.Length + -11))
            Temp = (objReader.ReadLine)
            On Error Resume Next
            For i = 1 To 100
                'Viewed
                Temp = objReader.ReadLine()
                Temp = (Microsoft.VisualBasic.Right(Temp, Temp.Length + -8))
                LVItems.Items.Add(Temp)
                'Paths
                Temp = objReader.ReadLine
                Temp = (Microsoft.VisualBasic.Right(Temp, Temp.Length + -8))
                LItems.Items.Add(Temp)
                If Temp = "" Then i = 100
            Next
            objReader.Close()
        Else
            On Error Resume Next
            Dim oFile As System.IO.File
            Dim oWrite As System.IO.StreamWriter
            oWrite = oFile.CreateText(System.AppDomain.CurrentDomain.BaseDirectory & "VietNamz_Injector.ini")
            oWrite.Close()
        End If
        Me.Opacity = 0.0
        DoneInject = False

        

    End Sub

    Private Sub tmrKey_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKey.Tick
        If GetAsyncKeyState(Keys.Delete) And btnManual.Enabled = True Then
            btnManual.PerformClick()
        End If
    End Sub

    Private Sub tmrCheck_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrCheck.Tick
        If Not LVItems.SelectedIndex = -1 Then
            btnRemove.Enabled = True
        Else
            btnRemove.Enabled = False
        End If
        If LVItems.Items.Count < 1 Then
            lblStatus.Text = "Waiting for DLL File"
            btnManual.Enabled = False
            btnClear.Enabled = False
        Else
            If CheckAuto.Checked = False Then
                btnManual.Enabled = True
                btnClear.Enabled = True
                If lblStatus.Text = "Waiting for DLL File" Then
                    lblStatus.Text = "Waiting for Injection..."
                End If
            ElseIf DoneInject = False Then
                Timer1.Enabled = True
                lblStatus.Text = "Waiting for " & SFileName & ".exe"
            End If
        End If
        If lblStatus.Text = "Sucessfully Injected DLL!" Then
            btnManual.Text = "New Injection"
            btnManual.Enabled = True
        End If
        If btnManual.Text = "New Injection" Then
            lblStatus.Text = "Sucessfully Injected DLL!"
        End If
    End Sub

    Private Sub txtDelay_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDelay.TextChanged

    End Sub

    Private Sub CheckClose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckClose.CheckedChanged

    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
        System.Diagnostics.Process.Start("http://www.***********.com/index.php?/user/72956-vietnamz/")
    End Sub

    Private Sub tmrHover_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrHover.Tick
    End Sub

    Private Sub Label4_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label4.MouseEnter
        Label4.ForeColor = Color.LimeGreen
    End Sub

    Private Sub Label4_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label4.MouseLeave
        Label4.ForeColor = Color.Lime
    End Sub

    Private Sub tmrIntro_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrIntro.Tick
        Me.Opacity = Me.Opacity + 0.01
        If (Me.Opacity = 1) Then
            tmrIntro.Stop()
            tmrIntro.Dispose()
        End If
    End Sub

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub

    Private Sub lblStatus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblStatus.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        End
    End Sub

    Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs)

    End Sub

    


    Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
        RszTmr.Start()
        refposition()
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MoveTmr.Tick
        Me.Size = appsize - curpos + Cursor.Position
        refposition()

    End Sub

    Private Sub RszTmr_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RszTmr.Tick
        

        Me.Location = oloc - ocur + System.Windows.Forms.Cursor.Position
        refposition()


    End Sub

    Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
        RszTmr.Stop()
        refposition()

    End Sub

    Private Sub Panel2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseDown
        MoveTmr.Start()

    End Sub

    Private Sub Panel2_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseUp
        MoveTmr.Stop()

    End Sub

    Private Sub Panel1_Paint_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint

    End Sub
End Class
#9 · 15y ago
Hassan
Hassan
Quote Originally Posted by encrypted94 View Post
Long Long Code Leeched Successfully...
Wow, great first post.
#10 · 15y ago
SK
Skinnlaw
Thanks Enc, worked fine
#11 · 15y ago
CptnDutch
CptnDutch
Good job on that one, but what's the point of using a hwid system.. your injector isn't that advanced like winject or mpghinject, ...

And still all your code was leeched from a vb.net tut forum..

It's time to write your own code by now

Good luck
#12 · 15y ago
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Tags for this Thread

None