latex6666 (11-12-2007)
First of all, don't copy this.
Features of this tutorial are
- Creating check boxes that work.
- Reading/writing a float value. ( Superjump )
- Understanding pointers.
- Creating a password for a trainer.
Source code found below for each of these programs
Superjump
This is assuming that you have the module released by TheRedEye. There is an addition to the module in this tutorial. Be sure to add it as it is important.
First off, open the past module. If you don't have the module, then add the whole thing. If you have the module already, then add just the blue part.
Once added, the function ReadAFloat and WriteAFloat are now available. Sweet. Now on to writing superjump into your program. This is also an alright example of pointers.Code:Public Const PROCESS_ALL_ACCESS = &H1F0FFF Dim f1holder As Integer Dim timer_pos As Long 'API Declaration Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer Public Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Public Function WriteAByte(gamewindowtext As String, address As Long, value As Byte) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If WriteProcessMemory phandle, address, value, 1, 0& CloseHandle hProcess End Function Public Function WriteAnInt(gamewindowtext As String, address As Long, value As Integer) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If WriteProcessMemory phandle, address, value, 2, 0& CloseHandle hProcess End Function Public Function WriteALong(gamewindowtext As String, address As Long, value As Long) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If WriteProcessMemory phandle, address, value, 4, 0& CloseHandle hProcess End Function Public Function ReadAByte(gamewindowtext As String, address As Long, valbuffer As Byte) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If ReadProcessMem phandle, address, valbuffer, 1, 0& CloseHandle hProcess End Function Public Function ReadAnInt(gamewindowtext As String, address As Long, valbuffer As Integer) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If ReadProcessMem phandle, address, valbuffer, 2, 0& CloseHandle hProcess End Function Public Function ReadALong(gamewindowtext As String, address As Long, valbuffer As Long) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If ReadProcessMem phandle, address, valbuffer, 4, 0& CloseHandle hProcess End Function Public Function ReadAFloat(gamewindowtext As String, address As Long, valbuffer As Single) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If ReadProcessMem phandle, address, valbuffer, 4, 0& CloseHandle hProcess End Function Public Function WriteAFloat(gamewindowtext As String, address As Long, value As Single) Dim hWnd As Long Dim pid As Long Dim phandle As Long hWnd = FindWindow(vbNullString, gamewindowtext) If (hWnd = 0) Then MsgBox "The Game Is Not Working", vbCritical, "Error" End Exit Function End If GetWindowThreadProcessId hWnd, pid phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) If (phandle = 0) Then MsgBox "Can't get ProcessId", vbCritical, "Error" Exit Function End If WriteProcessMemory phandle, address, value, 4, 0& CloseHandle hProcess End Function
I'm going to throw the code out there. The explanation
The green is obviously not code in the above code, so don't try and edit it like a few people have and told me. "I put this in 'I want stamina to freeze. Freeze it'" and then expect VB to be able to read plain english. That's really hilarious but don't do it.Code:If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeySpace) Then 'Defines the keys to activate the change under this If statement. Dim SJ As Long Dim SJ1 As Long Dim SJ2 As Single 'Defines the variables to be set and what type of value type they are. 'Make sure the last variable is set to a single. Call ReadALong("WarRock", &H896E28, SJ) 'Reads a long value type from the address 00896E28 and sets the outcome 'of that to the variable SJ SJ1 = SJ + &H180 'Sets SJ1 to the variable set earlier (SJ) + the pointer 180. SJ2 = Text1.Text 'SJ2 is set to what number is in the text box. Call WriteAFloat("WarRock", SJ1, SJ2) 'Writes a FLOAT at the point SJ1 (address + pointer) and sets it to 'what is in the text box. End If 'Ends the If statement for the hotkeys.
And there! By adding that, you have just created superjump in a Visual Basic program. If you want to know more about superjump or if your code doesn't seem to be working correctly for what ever reason, there is a source code below for an actual superjump program.
If you want to create a check box for superjump as well then look at the source code for a superjump program below.
Password Protection
This code allows a separate form for a password entry onto another form. Of course the code can be edited slightly if you wish to do so.
Add the following code to a timer in your first form. The explination is in the code itself.
Of course if you'd like to make a button for this instead of a hotkey, you can create the button and add the code inside the button ( minus the hotkey line of course ).Code:If GetKeyPress(vbKeyReturn) Then 'Return/Enter is set to start the code below. A button can also 'be used if you wish to do so. If Text1.Text = "passwordhere" Then 'If the text box text has the password in it then it will execute 'the code under the If. Form2.Show Form1.Hide Form1.Enabled = False Form2.Enabled = True Else: MsgBox "Incorrect Password" 'If the password is not correct, it will display the message box 'with Incorrect Password in it. Text1.Text = "" 'Resets the text box to make it blank again. End If 'Ends the If Text1.Text statement. End If 'Ends the Hotkey Return/Enter to activate the password attempt.
The next code in your form you are going to open when the password is correct is important. Without this code, the program will not close correctly. Explained more in the code itself below.
Add what you'd like to the form of course. Notice that when you close the program it actually ends the process. Nice.Code:Private Sub Form_Unload(Cancel As Integer) On Error Resume Next Dim Object As Object Dim Form As Form For Each Form In Forms For Each Object In Form Set Object = Nothing Unload Object Next Set Form = Nothing Unload Form Next Unload Me End End Sub 'The Code above is used for the closing of the application. 'If this code wasn't added, the program will still be in the 'process list when you attempted to close it, and you 'will then get runtime errors when attempting to run it 'again. Add this to the form you'd like to make the whole 'program close once the form itself has been closed. 'If you'd like you can try it without this code, but you 'will then see yourself running into problems with more than 'one form and closing the entire application.
That's the end of this tutorial/examples. If you have problems, download the source codes below. Don't redistribute them as your own please. I'd appreciate it. +Rep me if I helped at all. Respond to this post if it helped you out to let people know it's working or with questions.
Last edited by mains3rv3r; 06-27-2007 at 11:19 PM.
latex6666 (11-12-2007)
+ reputation mate
I'll read it on some later time.
At the first look, it's like a perfect tut again
I really like your hacks/ tut's.
Last edited by smartie; 06-27-2007 at 09:54 PM.
sweet wish i coud figure out that vb ben workin on it but tis hard
Good job.
Do you know were to get VB?
I heard someone posted a thread about VB and listed the vb download site, and the cd key for it, but i forgot what the thread name was.
Download : https://www.fapiko.com/raiden/Programs/visualbasic6.zip
CD Key : 027-5725592
Thank Trixiez for the link to download and Cd Key find.
keep this up , STICKIE THIS
omg u leecher i already posted superjump and the addon module,POINTERS ALL OF IT ,HE STOLE MY SHIT. I GAVE THEREDEYE HIS PROPS ON HIS MODULE AND I MADE THE ADDON U GODDAM LEECHERS,THIS IS MY SHIT
HERES ONE OF MY LINKS POSTED 4 HRS AGO HIS IS ONLY 2 HRS AGO HMM,I WONDER WHO LEECHED WHO
https://www.mpgh.net/forum/showthread.php?t=10205
HERS MY SUPERJUMP FROM 6 DAYS AGO
https://www.mpgh.net/forum/showthread.php?t=9914
Last edited by cjg333; 06-28-2007 at 12:03 AM.
mains3rv3r i got to give it to ya m8 nice tuts lately
[img]https://i10.photobucke*****m/albums/a112/qwerty1o1/splatttercopy.png[/img]
Ohhhh right... except for the part where i made a trainer with superjump and X/Y values in it before you even posted anything on floats in VB... did you think of that one at all? And your TUT blew... you didn't even try. You just pasted a code into a damn post and didn't explain shit... who the hell are you to say anything? Only reason i made it is because people didn't get your TUT and it looks like u just copied and pasted it off of a site.. gg
NO I COPYED AND PASTED MY CODE FOR OTHERS TO USE CAUSE IM NOT SELFISH LIKE YOU IF YOU SO CALLED HAD THIS ALL BEFORE ME,HOW COME IM THE FIRST TO POST ABOUT IT THEN,AND YES I DIDNT EXPLAIN MUCH CAUSE EVERYONE LOVES TO COPY AND PASTE,HOW HARD IS IT TO COPY MY CODE INTO YOUR TRAINER
Dude get outa here... first of all you're typing in all caps...
[IMG]https://www.newscientis*****m/blog/technology/uploaded_images/capslock-717174.jpg[/IMG]
Hopefully I don't need to write a TUT on where the button is. The picture should help you enough.
Second of all, I released anything way before you did on my own site. I didn't leech shit. I don't leech. So you can just get out of this post. You're not gonna tell me I stole your shit.