Warrock Hack+ Module
The Module
Open Visual Basic.
Select 'Standard EXE'
Now we need to add a module. This module has an API statement embedded into it which will attach it to a running process. We will name the running process later.
To add a module, right click on the top right window ( The window that has Form1 in it ). Hover over Add. Select Module. New module is already selected so click the 'Open' button to start a new module.
Paste this into the new module window :
Code:
Quote:
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
You just created a module that will now attach itself to a program.
Freezing Stamina
You will be creating two buttons and 1 timer. One button to freeze your stamina, and one button to unfreeze your stamina. 1 timer is required to to freeze the value itself. By turning a timer on, you can freeze it. And by turning the timer off, you can unfreeze it. Creating 2 buttons without a timer would be wrong because it doesn't actually freeze it like a timer does. A timer basically loops itself over and over when it's on for the interval it's set at. If you don't understand this, keep moving on. You'll learn more about it when you get into it.
Create the Timer : On the left side of the screen you should see a small clock. Hover over buttons to see what they are. Click Timer ( looks like a clock ). Click and drag to add one to the main form.
Double click the timer. A box will pop up. This is the code box. All code from the form will go into this code box. Different forms have different codes.
Insert this code:
Quote:
Call WriteALong("WarRock", &H008DBAFC, 1120403456)
This code Writes a 'Long' address. "Warrock" is the program name. &H7DB120 is the code. The real code is 007DB120 but you just add &H infront of it and it will remove the zeros. 1120403456 is the value when stamina is full. If you were to actually scan for the address of Stamina, you'd find out that the number above is what the value is at once Stamina is full.
Now it's time to add buttons.
First button : On the left side of the screen, find the 'CommandButton' button. Go to your form after clicking it and drag the size of the button. The button size can be changed later so it doesn't matter too much right now. Double click the button.
The code screen pops up again. Add the following into the button's code :
Quote:
Timer1.Interval = 1
This declares that when the button is clicked, Timer1 (the timer you created) will have an Interval of 1. An interval of 1000 is 1 second. An interval of 1 is less than a second obviously, but it's a button click so we don't need anything more then an interval of 1. So basically this button turns stamina on and it keeps it frozen ever millisecond. This is good because it won't let it decrease at all if it updates at that interval.
Button 2 : Double click this button. Add the following code to the button's code area :
Quote:
Timer1.Interval = 0
Press F5, tadaa!!!
I would really like a Thanks, because i worked hard on this.