[Visual Basic]Code SDK

Posts 1–15 of 67 · Page 1 of 5
[Visual Basic]Code SDK
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

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.

  1. Injector Module Last Updated - 4/28/2010
  2. APIkit Module Last Updated - 4/29/2010
  3. KeyBoard Hook Last Updated - 4/29/2010
  4. Mouse Hook Last Updated - 4/29/2010
  5. Send Keys API Last Updated - 4/29/2010
[/LEFT][/CENTER]


Attached : MPGH_VB_SDK.RAR
Virus Scan: --Click Here--


Quote Originally Posted by Added to each document as Agreement/Disclaimer
'Copyright (c) 2010
'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.
Updated Injector Source:

[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.
MPGH_VB_SDK.rarattachment deleted · 289 downloads before removal
Everything I can say is.
GOOD JOB and
Very nice~

This might be of help to me sometime, even though I have no idea what it's for/how to use it

/Thanked
Good job, awaiting more
HAHA nice official mpgh releases you should make a MPGH coding language that would be AWSOME
Sig Hilarious
and yes, working on a-lot more.

But keep in mind, this is really an attempt to get the vb coders here not just free source, but a chance to actually contribute something.

My goal is to have one of the most complete vb.net packages for game hacking/modifications.

Cross hairs that actually work, no flicker (so Direct X with hook into application)
VB constructed Class Library's (dll)
etc. etc.

So any ideas, please PM me, and contributions, please PM me, everyone try and find bugs, PM me or fix them, I am not going to take sole credit for this, this is really for everyone in the vb section who want's to contribute at all, same goes for any section really.

Q&A = Color assorted

Quote Originally Posted by NextGen1 View Post
Sig Hilarious



My goal is to have one of the most complete vb.net packages for game hacking/modifications.


Cross hairs that actually work, no flicker (so Direct X with hook into application)
VB constructed Class Library's (dll)
etc. etc.


Thanks

Idk who there is to beat ur already a "VB GOD"

O MY GOODNESS I BARELY UNDERSTAND WHAT YOUR SAYING BUT IT SOUNDS COOL LOL :P
I am almost done with a few other additions

:'D
I don't get the injector part.

It's in module form meaning that module has to first be injected, then it could inject another module? What?
Quote Originally Posted by Void View Post
I don't get the injector part.

It's in module form meaning that module has to first be injected, then it could inject another module? What?
No

Class Module in VB.net = equivalent to .Dll
Module in vb.net = Global Declarations and Functions inside the application

similar to VS6 and Global Variables or "world" Classes

So , By Creating a Injector module, all the developer has to do is add the module to their project

in the namespace

[php]
Imports ApplicationName.Inject
[/php]

[php]
//Equivalent to
#inherits inject.h
[/php]
Or whatever it would be in C++
All they have to do after that is determine what event will trigger the inject code.

then add one line of code

[php]
InjectDll("ProcessName", "path/DllName")
[/php]

This module can be used as a console application or a WinForm Application, in either case, the code is complete enough that the user can build a Injector without having to write much of any code at all.

It's the Ultimate Leechers Dream Come true, they don't even need to copy and paste anymore

The purpose isn't only however to create a easier method to inject, but also to give the developer the ability to innovate
Good Job !! Keep it up.
You my sir are a mad kient

Good job man
Thanks, Update, added the API Kit.

NextGen, you're a god >.<
Fantastic, spiffing, awesome, alarming, astonishing, awe-inspiring, awful, beautiful, breathtaking, daunting, dreadful, exalted, fearful, fearsome, formidable, frantic, frightening, grand, hairy*, horrible, horrifying, imposing, impressive, intimidating, magnificent, majestic, mean, mind-blowing*, moving, nervous, overwhelming, real gone, shocking, something else, striking, stunning, stupefying, terrible, terrifying, wonderful, wondrous, zero cool.

I think that describes it!
But i'd say this is for those who need a kick start on something new, and if i were to make an injector, i'd use the good old code because it's more fun to me, personally.

BUT GREAT JOB! Rep + 1 and Thanked.
Thanks Water , and All

Updated : Added Low_Level_Keyboard Hook module, With Full KeyBoard Constant List integrated.

Updated API Kit , it now has 564 lines of code.
Posts 1–15 of 67 · Page 1 of 5

Post a Reply

Similar Threads

Tags for this Thread

Need help?