Video Tutorial How to create a Visual Basic DLL Injector - vb injector

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Crazywink

Hacker
Meme Tier VIP
Dank Tier Donator
Jul 18, 2012
626
4,613
17
How to Create a DLL Injector in Visual Basic
NOTE: I am not experienced in VB. I am primarily a C++ and C# programmer, so some of the syntax is a bit of an adjustment for me.

This was requested by AustinCoder.


My injector I made was coded in C#. If you'd like to see a tutorial on that, leave a request in the comments. :)

I realize that there is already a VB DLL Injector in this section.
Mine uses a different method and has more advanced features as well as a video tutorial.

https://youtu.be/GOF3hwmbnNM

I had to record this video twice since the first time I recorded my mic was muted.. So I rushed through the video a bit cause I had my MMA training in 45 minutes. :p
I've included the chunk of code in an attachment. It's just the Declare Functions. I'll post it in code brackets here too.
C++:
Dim dlls 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


Thanks for watching guys, hopefully this helped. :)
My full source is also available for download. It is the exact source and design from the video.
 

Attachments

  • Like
Reactions: cracked000

programmer

Jr.Coder
Full Member
Nobleman
Jul 15, 2012
46
422
2
I can help but wait until I download vb .
Cause I delete it and I can't see my code if there isn't vb in my computer
 

Styx

Coder
Dank Tier Donator
Nobleman
Aug 14, 2012
117
648
3
is the inject button inactive by default and how u fix this? :confused:
You would be better just using the inject function itself and adding it to your own project, thats what I did
 
  • Like
Reactions: Sphinx

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
How many dudes did you beat up in the MMA training session? :D
 

Lina Yearn

Newbie
Nov 13, 2012
1
152
0
How to Create a DLL Injector in Visual Basic
NOTE: I am not experienced in VB. I am primarily a C++ and C# programmer, so some of the syntax is a bit of an adjustment for me.
I got many errors. My error like this:

'inject' is not a member of 'My_Injector.My.MySettings'.

So, how to fix it?
 

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
I got many errors. My error like this:

'inject' is not a member of 'My_Injector.My.MySettings'.

So, how to fix it?
Sounds like you need to create a setting called "inject".

 
Last edited:

cracked000

Newbie
Silenced
Nov 12, 2012
2
151
0
how to i add profile setting.ini on this?
like if i close this app, and didn't have the setting.ini files it will generate a default setting.ini?
but if he read the setting .ini, it will follow on a value..

sample of setting in .ini files

Edit:
C++:
[Program]
Name=calc.exe // process to be injected
Auto=1 // 0 = radio button unckeck | 1 = check automatic | 2 = check manual
Quit=1 // 1 check | 0 uncheck
[Injections]
Num=4 // total number of dll on the list box
1=C:\inject1.dll // dll 1 locations
2=D:\inject2.dll // dll 2 locations
3=E:\inject3.dll // dll 3 locations
4=F:\inject4.dll // dll 4 locations
 
Last edited:

morenitodr

Newbie
Mar 8, 2013
4
404
0
hey i did everything u said started the application but when i try to look of a dll and selected it i get error i dont know why
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
hey i did everything u said started the application but when i try to look of a dll and selected it i get error i dont know why
Need to know what the error is before anyone can help you. There can be a lot of things wrong and I could sit here all day stating various things that could be wrong.
 

morenitodr

Newbie
Mar 8, 2013
4
404
0
Need to know what the error is before anyone can help you. There can be a lot of things wrong and I could sit here all day stating various things that could be wrong.
ok look this
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at WindowsApplication1.Form1.OpenFileDialog1_FileOk(Object sender, CancelEventArgs e) in C:\Users\morenitoDR\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb:line 57
at System.Windows.Forms.FileDialog.OnFileOk(CancelEventArgs e)
at System.Windows.Forms.FileDialog.HandleVistaFileOk(IFileDialog dialog)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsApplication1
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/morenitoDR/Documents/Visual%20Studio%202010/Projects/WindowsApplication3/WindowsApplication3/bin/Release/WindowsApplication1.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 11.0.50709.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18036 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


fal erroo.PNG
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
Thanks. I will try this now. I'm new to visual basic. xD.
Good Luck! If you are wanting to really get into game hacking I wouldn't stay with it too long. I would suggest jumping over to C/C++, or at the very least C#.
 

Fox

Newbie
Full Member
Mar 27, 2013
8
172
0
Good Luck! If you are wanting to really get into game hacking I wouldn't stay with it too long. I would suggest jumping over to C/C++, or at the very least C#.
Yes, I want to get into game hacking but should I just jump to C++ instead of VB first?
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
Yes, I want to get into game hacking but should I just jump to C++ instead of VB first?
I would say yes, but it's a matter of opinion. Understanding another language first helps to understand the basics of programming, but you don't have to take another language first. I started with C and then went to C++. In my opinion I would say forget VB and just go into C or C++. You can spend more time learning the language you will ultimately use anyway. If you plan on doing any reverse engineering I would learn C. Once you get familiar with that move on to C++. Learning ASM is also extremely important if you want to get into reversing. You don't have to learn all of it, but focus more on the hacking portion of it. Like I said before everyone has their opinion and preference on programming languages and this is mine. Learning C++ can be a pain, but it's worth it. :)
 

PoV

Newbie
Mar 3, 2014
2
102
0
I'm getting like 8 errors all saying 'Keyword is not valid as an identifier' that "keyword" is Declare
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
I'm getting like 8 errors all saying 'Keyword is not valid as an identifier' that "keyword" is Declare
Post your code here or at least the code aroung the lines producing errors... We can't know it without that
 

PoV

Newbie
Mar 3, 2014
2
102
0
Post your code here or at least the code aroung the lines producing errors... We can't know it without that
here's the code that's giving the errors, it says the error is the word Declare

C#:
Dim dlls 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
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods