Sauerbraten Hack (Video)
This hack is an example on how to use and what you can do with the Game Hacking Library GHTools
It's made to be understandable and easy to adapt to other games.
The hack makes use of JavaFx to overlay things like a menu over the Game.
I used this method because it's simple and can be used on any Game to display a lot of different things.
You can find some examples below.
For the Campaign i made a simple Godmod Toggle with the following features:
- Unlimited Ammo
- Take No Damage
- No Recoil
- Ultra Rapid Fire
- Deal Insane Damage
This is an examaple on how to do basic memory editing like reading and writing from or to memory.
But this also demonstrates how to change opcodes of the binary in memory at runtime.
Demonstrates how one could implement an Aimbot.
Demonstrates how one could implement an ESP hack using the GHTools
.
The calculations are specific to OpenGL!
The main point of this was to demonstrate how to draw the ESP Boxes to the JavaFX Overlay.
Since we are using JavaFX we can display all kinds of stuff to the screen.
To demonstrate this i used this opportunity to honor Rake.
The whole hack is object oriented and multi-threaded so one can only make use of the pieces one needs or activate different modes at the same Time.
In this example i made a seperate mode that activates the ESP and Aimbot at the same time.
If you just want to use this hack you can download a pre-compiled jar executable here.
Note: the new repo for the Tools can be found here.
GHTools
is a wrapper around JNA makes it easier to use and provides some new functionality for game hacking as well.
-
To use
GHTools
you can either download it from here and import in in your project. -
Or get the source for it here.
If you want to use the source you need to download and import these in your project first:
For the JavaFX Overlay make sure to use Java 1.8
or download the current version of JavaFX and import in in your project from here
All Classes can be found in the package com.guidedhacking
. In this Overview we will have a brief look at its classes and their most often used methods.
Is a pure Enum type with the following Options:
Unlike build in methods these will also work when the program is out of focus.
Methods:
returns true
if the key is pressed and false
otherwise.
simulate a full key press and release.
simulate a key press.
simulate a key release.
set the position of the cursor to the specified position.
returns an int array whit 2 elements. where the first element is the x-coordinate and the second value is the y-coordinate of the cursor.
Used to access the memory of another process.
Methods:
Open a handle to the process with this window name to be able to access its memory. Returns true
if it was successful and false
otherwise.
Used to set the architecture to the architecture of the game to use the correct pointer size.
calculates the runtime address from the static pointer provided.
Close the handle you have opened to the game.
Checks if the handle to the game is still open. Will return true
if the handle is still open and false
if its closed.
Used to read a single bit from memory. Return true
if its 1 or false
if its 0.
Returns the byte that can be found at the provided address in the memory.
Returns the short that can be found at the provided address in the memory.
Returns the char that can be found at the provided address in the memory.
Returns the int that can be found at the provided address in the memory.
Returns the long that can be found at the provided address in the memory.
Returns the float that can be found at the provided address in the memory.
Returns the double that can be found at the provided address in the memory.
Returns the String that can be found at the provided address in the memory.
Returns the byte[] that starts at the provided address with the provided length.
Write a single bit to memory (true
for 1 and false
for 0) to the specified position in the byte that can be found at the specified address.
Will return
true if successful and false
otherwise.
Write a single byte to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a short to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a single char to the specified address in memory.
Will return
true if successful and false
otherwise.
Write an int to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a long to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a float to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a double to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a String to the specified address in memory.
Will return
true if successful and false
otherwise.
Write a byte[] to memory starting at the provided address.
Will return
true if successful and false
otherwise.
this class also provides some methods for working with objects in memory. If you are interested in them check the source of this class here. Please note that these methods are not tested!
Used to hold information about the static pointer and the offsets of a value.
Constructor:
Methods:
Methods:
Sleep method with exception handeling.
Returns the process ID of the currently opened process.
Return true
if the game window is visible and false
otherwise.
Returns the height of the game window in pixels.
Returns the width of the game window in pixels.
Returns the x-position of the upper left corner of the game window on the sreeen.
Returns the y-position of the upper left corner of the game window on the sreeen.
Once you have downloaded and imported GHTools into your project you can get started coding your first hack for a game.
here is a very simple example on how to use GHTools
//import everything from the GHTools:
import com.guidedhacking.*;
public class Example {
//create a new pointer with the static address and offsets:
private static GHPointer healthPtr = new GHPointer(0x2DEAD,0x13);
public static void main(String[] args){
//try to open a handle to the game process:
if(GHMemory.openProcess("Game Window Title")) {
//select the architecture of the game:
GHMemory.setArchitecture(GHArchitecture.Win32);
//calculate the runtime address of the health value from the pointer:
long healthAddy = GHMemory.getObjectAddress(healthPtr);
//read the health value from the games memory:
int healthValue = GHMemory.readInt(healthAddy);
//increase the health value by 1:
healthValue++;
//write the new health value back to memory:
GHMemory.writeInt(healthValue,healthAddy);
}else{ //if creating a handle to the game failed
System.out.println("Can not open Game!");
}
}
}
for a more in depth example please have a look at the example hack i have provided.
- JNA - Java Native Access
- Rake - for running guidedhacking.com and his great tutorials. Without him this repo would probably not exist.