Visual Basic / MPGH SDK
What is VB/MPGH SDK?
It will be a complete set of tools to make VB.net Application Development specifically for Game/Memory Manipulation , Including DirectX and Windows API.
SDK Includes (to include)
Injector as Vb Module (Not Class Module) - Completed and Attached.
APIKIT as VB Module (Not Class Module) - Completed and Attached.
DirectX CrossHair - 90% Complete
Low Level KeyBoard Hooks (With Complete Keyboard)- 90%
SendKey Alternative - WinApi - 80%
Mouse API With Application Hook - 25%
--Submit additional ideas Via PM
--Contribute to the API but submitting code via PM
Documentation
Injector -
Simply download the injector module, add it as an existing item to your project and that is it, you have a fully functional injector, and to make it work you need 2 lines of code, that is it :D
To use the injector Simply Add the following to your imports
(in the namespace, above public class Form Name)
[highlight=vbnet]
'Application Name is the name of your application.
Imports ApplicationName****ject
[/highlight]
Once that is added , Add the following code under whatever event you would like to trigger it.
[highlight=vbnet]
InjectDLL("ProccessID","DllPath+name+Extension")
[/highlight]
Example, Let us say you want to inject NotePad with a dll called BlueText.dll and it is located in the C Drive, the code would be
[highlight=vbnet]
InjectDll("untitled-Notepad","C:/BlueText.dll")
[/highlight]
Keeping in mind that Notepads running ProcessID is usually "NameOfFile-Notepad"
API Kit
What is the API Kit?
The API Kit is a Module comprised of over 500 lines of API coding pre-done for you
How do I use it?
Simply , Download It, Extract the Zip, add the Module to your project as an existing item
Then Add the following to your imports
(in the namespace, above public class Form Name)
[highlight=vbnet]
'Application Name is the name of your application.
Imports ApplicationName.APIkit
[/highlight]
Once you have added that line of code you will have immediate access to API Functions Like.
- FindWindow
- GetAsyncKeyState
- GetWindow
- ActivateKeyboardLayout
- Showwindows
- PopUp window
- SetWindowPosistion
That is just to name a few, again there is over 536 lines of code, and this is only going to increase and separate into different API Modules to keep things clean, this is just part of the Beta Release.
Revisions - Increased API and Constants, Now 536 Lines of Code.
Global KeyBoard Hook.
What is a Global Keyboard Hook?
A hook in general is some function you create as part of a dll or integrated into your application which is used to monitor what's going on during a specific (or general) event. For example when a user presses a key on the keyboard a Keyboard Hook will process the information, in which case you can use your dll or module / application to handle that information
Specifically, a Global Hook is used to monitor Every thread in the system the application is running on.
How to use the Low Level KeyBoard Hook. (Global)
Simply, Add the API to your application as a existing item
In the name space above
[highlight=vbnet]
'FormName is litterly the name of your form
' Example, Form1, Form2, Form3 etc.
Public Class FormName
[/highlight]
[highlight=vbnet]
'Application Name is the name of your application.
Imports ApplicationName.Keyboardhook
[/highlight]
Once you have imported the Hook, Simply add this code to whichever event you want to trigger it (IE: Form_Load , Button_Click, Etc)
[highlight=vbnet]
HookKeyboard()
[/highlight]
That simple, One line and your "Hooked" , The Keyboard Hook will automatically disconnect on form close
You can manually do it programatically with
[highlight=vbnet]
UnhookKeyboard()
[/highlight]
You can check the status of the Hook with
[highlight=vbnet]
CheckHooked()
[/highlight]
Info: I added this to the module as well as a reminder but Because of visual basic settings and the fact that
VB will attempt to hook the keyboard. To Debug, Build and run .exe from project/debug folder or Modify Settings, Project ---> Application Name Properties ---> Debug ---> Uncheck the checkbox "Enable the Visual Studio hosting process”
API alternative to Send Keys
A-lot of applications (especially Direct X applications) Block sendkeys or have patched send keys to avoid spamming, which means that you would have to actually send keystrokes through your keyboard, well with virtual keys coupled with the global keyboard Hook API, you should be able to send keys to an application without physically hitting the keyboard, this can be used for spammers and/or bots.
To use this, simply follow the above steps for keyboard hooking, which then download the SendKeyAPI Module below, add it to your project as an existing item
Then
[highlight=vbnet]
Imports ApplicationName.SendKeyApi
[/highlight]
Once you do that, you can call the functions from any form.
the code will look like this to press a key
[highlight=vbnet]
keybd_event(VK_F9, 0, 0, 0) ' This code (in format will press the Key and hold it down
' keybd_event(VK_F9, 0, KEYEVENTF_KEYUP, 0) ' This code will (in this format) bring the button back up.
[/highlight]
Again, You can use this for botting or spamming, it's a-little more work then sendkeys, but it should be globally functional.
Mouse Hook
With this code (just like the keyboard hook) You can hook and monitor the events of the mouse.
Simply, download the MouseHook Module in the sig .
then above Public Class FormName
add
[highlight=vbnet]
Imports ApplicationName.MouseHook
[/highlight]
This will then give you access to the Mouse Hook Module
Here is some example code
' Commented out in module for future reference
[highlight=vbnet]
If hHook.Equals(0) Then
hookproc = AddressOf MouseHookProc
hHook = MouseHook.SetWindowsHookEx(WH_MOUSE, _
hookproc, _
IntPtr.Zero, _
AppDomain.CurrentDomain.GetCurrentThreadId())
If hHook.Equals(0) Then
MsgBox("SetWindowsHookEx Failed")
Return
Else
Button1.Text = "UnHook Windows Hook"
End If
Else
Dim ret As Boolean = UnhookWindowsHookEx(hHook)
If ret.Equals(False) Then
MsgBox("UnhookWindowsHookEx Failed")
Return
Else
hHook = 0
Button1.Text = "Set Windows Hook"
Me.Text = "Mouse Hook"
End If
End If
[/highlight]
This code will allow you to follow the X,Y of the mouse coordinates and button clicks, and also allows you to handle the events triggered by specific keys and/or the specific location of the mouse .
_____NOTES____
---Again, If you would like to contribute , Feel free to email me your code or suggestions, This is a MPGH.net VB Project, Not just a NextGen1 Project, the more who contribute, the better this application will be. (do not post code in this thread)
have any bugs, feel free to place them in this forum , Email Me , Send it via MSN , or send it to me via Pm/VM.
[/LEFT][/CENTER]
- Injector Module Last Updated - 4/28/2010
- APIkit Module Last Updated - 4/29/2010
- KeyBoard Hook Last Updated - 4/29/2010
- Mouse Hook Last Updated - 4/29/2010
- Send Keys API Last Updated - 4/29/2010
Attached : MPGH_VB_SDK.RAR
Virus Scan: --Click Here--
Updated Injector Source:Quote:
Originally Posted by Added to each document as Agreement/Disclaimer
[highlight=vbnet]
'Copyright (c) 2010 Innovators World Wide
'Released 2010 For Explicit use by/for Mpgh.net and it's members
'Permission is hereby granted, free of charge, to any person obtaining a copy
'of this software and associated documentation files (the "Software"), to deal
'in the Software without restriction, including without limitation the rights
'to use, copy, modify, merge, publish, distribute, a application for Mpgh.net Only.
'and to permit persons to whom the Software is
'furnished to do so, subject to the following conditions:
'THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
'FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
'LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
'THE SOFTWARE.
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Diagnostics
Imports System.Threading
Imports System****ntime****teropServices
Public Class Inject
Friend Declare Auto Function SingleObj Lib "kernel32" (ByVal handle As IntPtr, ByVal milliseconds As Int32) As Int32
<DllImport("kernel32")> _
Public Shared Function RemoteThd(ByVal hProcess As IntPtr, ByVal lpThreadAttributes As IntPtr, ByVal dwStackSize As UInteger, ByVal lpStartAddress As UIntPtr, ByVal lpParameter As IntPtr, ByVal dwCreationFlags As UInteger, _
ByRef lpThreadId As IntPtr) As IntPtr
End Function
<DllImport("kernel32.dll")> _
Public Shared Function ProcessSt(ByVal dwDesiredAccess As UInt32, ByVal bInheritHandle As Int32, ByVal dwProcessId As Int32) As IntPtr
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)> _
Public Shared Function GetProcAddress(ByVal hModule As IntPtr, ByVal procName As String) As UIntPtr
End Function
<DllImport("kernel32.dll")> _
Public Shared Function HandleStp(ByVal hObject As IntPtr) As Int32
End Function
Private Declare Auto Function FreeExup Lib "kernel32.dll" (ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As UIntPtr, ByVal dwFreeType As UInteger) As Boolean
Private Declare Auto Function AllocExVT Lib "kernel32.dll" (ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As UInteger, ByVal flAllocationType As UInteger, ByVal flProtect As UInteger) As IntPtr
<DllImport("kernel32.dll")> _
Private Shared Function Wprocmem(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As String, ByVal nSize As UIntPtr, ByRef lpNumberOfBytesWritten As IntPtr) As Boolean
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Auto)> _
Public Shared Function GetHandle(ByVal lpModuleName As String) As IntPtr
End Function
Public Shared Function ProcessIdRet(ByVal proc As [String]) As Int32
Dim ProcLRet As Process()
ProcLRet = Process.GetProcessesByName(proc)
Return ProcLRet(0).Id
End Function
Public Shared Sub InjectDLL(ByVal hProcess As IntPtr, ByVal strDLLName As [String])
Dim bytesout As IntPtr
Dim LenWrite As Int32 = strDLLName.Length + 1
Dim AllocMem As IntPtr = DirectCast(AllocExVT(hProcess, DirectCast(Nothing, IntPtr), CUInt(LenWrite), &H1000, &H40), IntPtr)
Wprocmem(hProcess, AllocMem, strDLLName, DirectCast(LenWrite, Integer), bytesout)
Dim Injector As String = DirectCast(GetProcAddress(GetHandle("kernel32.dll" ), "LoadLibraryA"), UIntPtr)
If Injector Is Nothing Then
MessageBox.Show(" Injector Error! " & vbLf & " ")
Exit Sub
End If
Dim ThreadHd As String = DirectCast(RemoteThd(hProcess, DirectCast(Nothing, IntPtr), 0, Injector, AllocMem, 0, _
bytesout), IntPtr)
If ThreadHd Is Nothing Then
MessageBox.Show(" ThreadHd [ 1 ] Error! " & vbLf & " ")
Exit Sub
End If
Dim Result As Integer = SingleObj(ThreadHd, 10 * 1000)
If Result = 128L OrElse Result = 258L OrElse Result = &HFFFFFFFF Then
MessageBox.Show(" ThreadHd [ 2 ] Error! " & vbLf & " ")
If ThreadHd IsNot Nothing Then
HandleStp(ThreadHd)
End If
Exit Sub
End If
Thread.Sleep(1000)
FreeExup(hProcess, AllocMem, DirectCast(0, Integer), &H8000)
If ThreadHd IsNot Nothing Then
HandleStp(ThreadHd)
End If
Exit Sub
End Sub
Public Shared Sub InjectIt()
Dim DLLName As [String] = "kernal32.dll"
Dim ProcessName As [String] = "untitiled-notepad"
Dim ProcID As Int32 = ProcessIdRet(ProcessName)
If ProcID >= 0 Then
Dim hProcess As String = DirectCast(ProcessSt(&H1F0FFF, 1, ProcID), IntPtr)
If hProcess Is Nothing Then
MessageBox.Show("ProcessSt(): No Success")
Exit Sub
Else
InjectDLL(hProcess, DLLName)
End If
End If
End Sub
End Class
[/highlight]
Update Fixes:
~ InjectIt Issue
~ Conversion Issue.
This update is as source only and has not been uploaded in the .RAR file.
Simply copy the code and replace the code in the injector source with above.