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.")
End If
Dim hProcess As Integer = OpenProcess(&H1F0FFF, 1, pID)
If (hProcess = 0) Then
Return False
End If
Dim bytes As Byte() = Encoding.ASCII.GetBytes(dllLocation)
Dim lpBaseAddress As Integer = VirtualAllocEx(hProcess, 0, bytes.Length, &H1000, 4)
If (lpBaseAddress = 0) Then
Return False
End If
Dim lpModuleName As String = "kernel32.dll"
Dim moduleHandle As Integer = GetModuleHandle(lpModuleName)
lpModuleName = "LoadLibraryA"
Dim procAddress As Integer = GetProcAddress(moduleHandle, lpModuleName)
If ((moduleHandle = 0) OrElse (procAddress = 0)) Then
Return False
End If
WriteProcessMemory(hProcess, lpBaseAddress, bytes, bytes.Length, 0)
Dim hHandle As Integer = CreateRemoteThread(hProcess, 0, 0, procAddress, lpBaseAddress, 0, 0)
If (hHandle = 0) Then
Return False
End If
WaitForSingleObject(hHandle, &H1388)
CloseHandle(hHandle)
CloseHandle(hProcess)
Label3.Text = "Successfully Injected"
If CheckBox1.Checked Then
Me.Close
End If
Label3.ForeColor = Color.Green
Return True
End Function
This source has been not made by me, i just found it.
If you like this thread please, press "Thanks"!
Even if I did, what's the problem? It's not against the rules...
I just want help some little coders, they shouldn't copy and paste the source, but study it and understand what it does...
And stay sure it's not an private injection source..
u can make a injector, but with that codes, anyone can make your personal injector. make injector is so easy. try make one for yourself.