Wait what, you are just using the source from Kareem?
Ectasy:
Code:
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.")
Dim hProcess As Integer = OpenProcess(&H1F0FFF, 1, pID)
If hProcess = 0 Then Return False
Dim dllBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(dllLocation)
Dim allocAddress As Integer = VirtualAllocEx(hProcess, 0, dllBytes.Length, &H1000, &H4)
If allocAddress = Nothing Then Return False
Dim kernelMod As Integer = GetModuleHandle("kernel32.dll")
Dim loadLibAddr = GetProcAddress(kernelMod, "LoadLibraryA")
If kernelMod = 0 OrElse loadLibAddr = 0 Then Return False
WriteProcessMemory(hProcess, allocAddress, dllBytes, dllBytes.Length, 0)
Dim libThread As Integer = CreateRemoteThread(hProcess, 0, 0, loadLibAddr, allocAddress, 0, 0)
If libThread = 0 Then
Return False
Else
WaitForSingleObject(libThread, 5000)
CloseHandle(libThread)
End If
CloseHandle(hProcess)
Label3.Text = "Successfully Inject By Kareem111."
If CheckBox1.Checked = True Then
System.Diagnostics.Process.Start("http://www.mpgh.net/forum/members/1299789-kareem111.html")
System.Diagnostics.Process.Start("http://www.mpgh.net/forum/members/1299789-kareem111.html")
Me.Close()
End If
Label3.ForeColor = Color.Green
Return True
End Function
Your injector:
Code:
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 = Form1.OpenProcess(&H1F0FFF, 1, pID)
If (hProcess = 0) Then
Return False
End If
Dim bytes As Byte() = Encoding.ASCII.GetBytes(dllLocation)
Dim lpBaseAddress As Integer = Form1.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 = Form1.GetModuleHandle(lpModuleName)
lpModuleName = "LoadLibraryA"
Dim procAddress As Integer = Form1.GetProcAddress(moduleHandle, lpModuleName)
If ((moduleHandle = 0) OrElse (procAddress = 0)) Then
Return False
End If
Form1.WriteProcessMemory(hProcess, lpBaseAddress, bytes, bytes.Length, 0)
Dim hHandle As Integer = Form1.CreateRemoteThread(hProcess, 0, 0, procAddress, lpBaseAddress, 0, 0)
If (hHandle = 0) Then
Return False
End If
Form1.WaitForSingleObject(hHandle, &H1388)
Form1.CloseHandle(hHandle)
Form1.CloseHandle(hProcess)
Me.Label3.Text = "DLL injected successfully."
If Me.CheckBox1.Checked Then
Me.Close()
End If
Me.Label3.ForeColor = Color.Green
Return True
End Function
Ectasy-Ject, so it is leeched?