Vince Coding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Coding in VB.net

Go down

Coding in VB.net Empty Coding in VB.net

Post  Admin Sun Jun 05, 2011 11:22 am

Credits are appreciated, but are not mandatory

Hey there, due multiply request I decided to make this tutorial for making a trainer in VB
In this tutorial I will keep it to the basic (No complicated ASM hooks) and will explain how to setup your own trainer

Requirements:
Microsoft Visual Basic 2010 Express (2010 recommended)
Code:
http://www.microsoft.com/express/Downloads/#2010-Visual-Basic
.NET framework 4

Step 1 : Creating a project

Go File>New Project (or press ctrl+n) and select the "Windows Forms Application"
Put in a name you like or preffer (or just leave it "WindowsApplication1") and press OK

After you press OK the program will start loading, when its finished it will look like this
Coding in VB.net Vbtut1
(if you do not c the ToolBox window, press Ctrl+alt+x or go View>Other windows>toolbox)

You now created your own un-finished trainer, wich actually can be run already (F5 = testing/debugging)

Step 2 : Adding the necessary things
First of all its suggested to download: http://localhostr.com/file/2MO0e6A/WINAPI.vb file
And then add it by doing Project>Add existing item (or ctrl+d), and then select the WINAPI.vb you just downloaded
If you did it correctly you will see that the file is added like this
Coding in VB.net Vbtut2
Also, you can ignore the 12 Errors it gives, we will fix that later on


Step 3 : Hooking Maple
Now we need to set up a few things so we can use hacks in Maplestory
First off all we need to add a piece of code, you can reach the code page by double clicking on your form (@Form1.vb)
Something like this will appear:
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
Now you need to add this piece of code AFTER "Public Class Form1"
Code:
    Public Shared ProcessHandle As IntPtr = 0
    Public Shared hWnd As IntPtr = 0
    Public Shared ProcessID As UInt32 = 0
    Public Shared MapleStory As Process
Then go back to your Design of Form1 (you should be able to click on a tab, if not double click on Form1.vb on your solution explorer)
Now look in your toolbox for a "Timer", if you found it, then drag and drop it on your form
Under your form Timer1 will now apear, when its done loading, double click the Timer1
You will see a new piece of code has been added looking like this
Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    End Sub
In between of the "Private Sub Timer1_Tick" and "End Sub" you will need to add this
Code:
        Try
            Dim ProcessList As Process() = Process.GetProcesses
            Dim i As Integer = 0
            While i < ProcessList.Length
                If ProcessList(i).ProcessName.ToString = "MapleStory" Then
                    MapleStory = ProcessList(i)
                End If
                i = i + 1
            End While
            hWnd = MapleStory.MainWindowHandle
            ProcessID = MapleStory.Id
            ProcessHandle = WINAPI.OpenProcess(&H38, 1, ProcessID)
        Catch ex As Exception

        End Try
The Try Catch statement, will make sure our trainer wont crash if it cant find MapleStory anymore
Now we still need to start the timer, we want the timer to start when the Form1 opens
So after "Private Sub Form1_Load", we will add this
Code:
 Timer1.Interval = 1000
        Timer1.Start()
The interval of the timer is in Milli Seconds, wich mean 1000 stands for 1 second, this will make the timer check for MapleStory every second (you can change the interval to your likings)

If you did everything correctly, your code will now look like this
Coding in VB.net Vbtut3


Step 4 : Hacks! Finnaly Very Happy

Now we will start adding hacks, the simplest way of adding hacks would be using a checkbox, you can add them the same way as an Timer
Although there will be a small difference now, you can use you mouse to drag the checkbox to the position you preffer
After you added a checkbox, double click so a new piece of code will be generated called "Private Sub CheckBox1_CheckedChanged"
In this Sub we will add Super Tubi
The super tubi script looks like this
Code:
[Enable]
00A6606F:
db 90 90 90 90 90

[Disable]
00A6606F:
db 89 BE B8 20 00 00
DB actually means that CE needs to write bytes to a certain Address (00A6606F here)
So in VB we will do exactly the same
First we need to define the address, we do that with this piece of code
Code:
Dim Addy As IntPtr = &HA6606F
The &H infront of the address means the value is Hexadecimal, instead of a normal number
Now we need to know if we need to enable, or disable the hack, dependig on the checkbox, wich is actually quite simple
Code:
    If CheckBox1.Checked Then

            Else

            End If
After the "If" we will place the code to enable the hack, after the "Else" we will place the code to disable the hack
To figure out what we need to do to enable the hack, we will look back at the CE script, and see that we need to write 5 bytes all with the value 90 (In hexadecimal)
First we will define that, we use this way to do that
Code:
Dim buffer As Byte() = New Byte() {&H90, &H90, &H90, &H90, &H90}
Now we know what we need to write, we actually still need to write it to maple
We use the following function for that
Code:
WINAPI.WriteProcessMemory(Addy, buffer, buffer.Length)
Wich will write the byte (buffer) to the address (Addy)
The only thing thats left to do is adding the disable part, the only difference of the disable part are the bytes, instead of 5 times 90, we now need these bytes
Code:
{&H89, &HBE, &HB8, &H20, &H0, &H0}
You can simply use the enable part and replace the bytes with those
If you putted everything together like it should, it should now look like this
Coding in VB.net Vbtut4


Final Step: Saving and Building
Now we need to save our Trainer, we can do this by pressing Ctrl+shift+z (or File>Save All)
You will be asked were you want to save your trainer, Remember this! you will need it later on
After you saved it, you can go Debug>Build [Your project name here], this will make an ready to use .exe
It will get saved on the location you picked \bin\Release, try to find that map
After you found that map there will be a file called "WindowsApplication1.exe", this is your trainer ! :3
Its ready to use, you can now test it on MapleStory Very Happy (Dont forget to inject a bypass though)


I hoped this helped you guys out
Admin

Expect more to come! Very Happy


Admin
Admin

Posts : 6
Join date : 2011-06-05

https://vincecoding.board-directory.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum