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 › [Discussion]Injection Code

[Discussion]Injection Code

Posts 1–13 of 13 · Page 1 of 1
Invidus
Invidus
[Discussion]Injection Code
Hmm.
I recently discovered this injector code which samueldo/ryan showed me, and its pretty awesome.

Its unlimited dll injection, uses a module and simply uses Inject(Process, DLLPath) when you want to inject.

Thats only for injection, you still gotta do your timer crap.

But pretty cool

Should i release this?
Or should i not?
I'm just worried about leechers spamming the sh** with new injectors with this code.
/discuss
#1 · 16y ago
Blubb1337
Blubb1337
You can build that Inject(process, dllpath) easily, with every injection code...

But go ahead, you shouldn't make a topic asking, release it.
#2 · edited 16y ago · 16y ago
Jason
Jason
Quote Originally Posted by Blubb1337 View Post
You can build that Inject(process, dllpath) easily, with every injection code...

But go ahead, you shouldn't make a topic about asking, just go ahead and release it.
Lol I was going to say that, add two (ByVal yadda yadda) to any injection code and you can call it with

Inject("Process", "Path) simple as .
#3 · 16y ago
Invidus
Invidus
Just because you nerds think its simple..
Those tryhards don't lol =P

Just because you nerds think its simple..
Those tryhards don't lol =P

Oh and i'll let you be the judge.

[php]Imports System.Runtime.InteropServices
Imports System.Text

Module ModInject

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
Public Function inject(ByVal ProcessID As Long, ByVal DLLPath As String) As Boolean
On Error GoTo exiterror
Dim DProc As Integer
Dim DAdd As Integer
Dim DWrote As UInteger
Dim DAll As Integer
Dim DThe As Integer
Dim DMHD As Integer
DProc = OpenProcess(&H1F0FFF, 1, ProcessID)
DAdd = VirtualAllocEx(DProc, 0, DLLPath.Length, &H1000, &H4)
If (DAdd > 0) Then
Dim DByte() As Byte
DByte = StrChar(DLLPath)
WriteProcessMemory(DProc, DAdd, DByte, DLLPath.Length, DWrote)
DMHD = GetModuleHandle("kernel32.dll")
DAll = GetProcAddress(DMHD, "LoadLibraryA")
DThe = CreateRemoteThread(DProc, 0, 0, DAll, DAdd, 0, 0)
If (DThe > 0) Then
WaitForSingleObject(DThe, &HFFFF)
CloseHandle(DThe)
Return True
Else
GoTo exiterror
End If
Else
GoTo exiterror
End If
inject = True
Exit Function
exiterror:
inject = False
End Function
Private Function StrChar(ByRef strString As String) As Byte()
Dim bytTemp() As Byte
Dim i As Short
ReDim bytTemp(0)
For i = 1 To Len(strString)
If bytTemp(UBound(bytTemp)) <> 0 Then ReDim Preserve bytTemp(UBound(bytTemp) + 1)
bytTemp(UBound(bytTemp)) = Asc(Mid(strString, i, 1))
Next i
ReDim Preserve bytTemp(UBound(bytTemp) + 1)
bytTemp(UBound(bytTemp)) = 0
StrChar = bytTemp
End Function
End Module
[/php]
#4 · 16y ago
Jason
Jason
Quote Originally Posted by ilikewaterha View Post
Just because you nerds think its simple..
Those tryhards don't lol =P


Just because you nerds think its simple..
Those tryhards don't lol =P
Why do you always call us nerds whenever you wander back into this section? It's hardly rocket science. OMG I CAN HAZ PARAMETERS FOR MAI SUBZ? NO FUXIN WAY!

#5 · 16y ago
Invidus
Invidus
Lol because you're nerds =P
Nerds = Smart people
You = Nerd at VB = Good at VB
-facepalm-

And wander back?
Its not like i cave anywhere else?
Unlike you who entirely caves in this section xD
#6 · edited 16y ago · 16y ago
Jason
Jason
Quote Originally Posted by ilikewaterha View Post
Lol because you're nerds =P
Nerds = Smart people
You = Nerd at VB = Good at VB
-facepalm-

And wander back?
Its not like i cave anywhere else?
Unlike you who entirely caves in this section xD
By wander back in I mean you disappear for weeks then randomly pop back in.

Nerd = Derogatory term for smart people = insult.

Also, I visit pretty much every section, but I contribute most here.
#7 · 16y ago
Invidus
Invidus
Alright, lets sort this out.
1. Me disappearing, just had to sort out my life, do some stuff, so i didn't have much time for MPGH.
2. Didn't mean it to be offensive, i'll call you smartass from now on ^^.
3. Meh, caver xD. You pretty much most on VB , so yeah ..

End of story. - back on topic-
#8 · 16y ago
Blubb1337
Blubb1337
Why processid, why not name? Go edit it and make it accept the name instead of the id :P
#9 · 16y ago
Invidus
Invidus
Err :P
Give me a bit =P
#10 · 16y ago
Jason
Jason
Blubb you're a lazy mofo.

I'll do the groundwork.

Whack this into the module.

[php]
Private Function GetPID(ByVal ProcName as String)
if ProcName.Contains(".exe") then
ProcName = ProcName.Replace(".exe", "")
End if

dim PID as integer = 0

For Each p As Process in Process.GetProcesses(My.Computer.Name)
If p.ProcessName = ProcName then
PID = p.ID
End If

Return PID

End Function
[/php]

Then modify your inject function like so:

[php]
Public Function inject(ByVal ProcName As Long, ByVal DLLPath As String) As Boolean

Dim ProcessID As Integer = GetPID(ProcName)

If ProcessID = 0 then
GoTo exiterror
End If

On Error GoTo exiterror
Dim DProc As Integer
Dim DAdd As Integer
Dim DWrote As UInteger
Dim DAll As Integer
Dim DThe As Integer
Dim DMHD As Integer
DProc = OpenProcess(&H1F0FFF, 1, ProcessID)
DAdd = VirtualAllocEx(DProc, 0, DLLPath.Length, &H1000, &H4)
If (DAdd > 0) Then
Dim DByte() As Byte
DByte = StrChar(DLLPath)
WriteProcessMemory(DProc, DAdd, DByte, DLLPath.Length, DWrote)
DMHD = GetModuleHandle("kernel32.dll")
DAll = GetProcAddress(DMHD, "LoadLibraryA")
DThe = CreateRemoteThread(DProc, 0, 0, DAll, DAdd, 0, 0)
If (DThe > 0) Then
WaitForSingleObject(DThe, &HFFFF)
CloseHandle(DThe)
Return True
Else
GoTo exiterror
End If
Else
GoTo exiterror
End If
inject = True
Exit Function
exiterror:
inject = False
[/php]

#11 · 16y ago
Blubb1337
Blubb1337
Why 2 functions, put both together
#12 · 16y ago
Jason
Jason
Quote Originally Posted by Blubb1337 View Post
Why 2 functions, put both together
Meh I like function, the inject one was already there and I like having a re-usable function for a later date, keeps things tidy.
#13 · 16y ago
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

  • need help with injecting code/using itBy 0xx-kyle-xx0 in Combat Arms Help
    1Last post 8y ago
  • DLL Injection - Coding the DLL C++By PoZHx in C++/C Programming
    0Last post 17y ago
  • Auto Inject Code NeededBy hakmaker in CrossFire Help
    4Last post 15y ago
  • How to inject codes into combat arms?By ballshit1 in Combat Arms Coding Help & Discussion
    6Last post 15y ago
  • I need manual inject code and auto inject code and close after injection codeBy [CFGH] in CrossFire Help
    2Last post 15y ago

Tags for this Thread

None