aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md83
1 files changed, 83 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..04eb8a5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,83 @@
1# Introduction to game hacking using C & Linux API
2
3This project is part of a presentation I did about the bare and bones of game hacking on Linux.
4The goal is to introduce the viewers into two core Linux APIs, namely `procfs` and `ptrace`, through
5the development of a game trainer.
6
7## Disclaimer
8Everything discussed and showed in the presentation was done for educational purposes only.
9I do not encourage or promote the use of cheats or any other method that provide an unfair advantage.
10
11## Licence
12The project/presentation is licensed under GPLv2. See [LICENSE](https://git.orfeas.xyz/linux-game-trainer/tree/LICENSE) for more information.
13
14## Presentation outline
15* Introduction to basic concepts (binaries, processes, virtual memory)
16* Discussion on common cheating methods (internal, external & hardware level)
17* Focus on external cheats and their interaction model with the game's process
18* Introduction to Linux' `procfs` API
19* Introduction to Linux' `ptrace` API
20* Live demo
21
22## Demo
23During the demo I went through the steps of making a simple trainer using
24the concepts explained previously. I did this by going through every single commit
25which incrementally built the logic for the trainer. Finally I used the game
26[assaultcube](https://assault.cubers.net/download.html) to demonstrate the
27trainer's capability to scan, read and write another process' memory.
28
29## Download & Use
30
31### Clone the repo
32
33```bash
34git clone https://git.orfeas.xyz/linux-game-trainer
35```
36
37### Prerequisites
38In most (if not all Linux distros), `ptrace` won't be able attach to any process.
39To change this behavior you can run:
40
41```bash
42echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
43```
44
45Note that this setting is not persistent across reboots.
46
47### Running the trainer
48To run the trainer run:
49
50```bash
51make
52./run <tracee_pid>
53```
54
55Two terminal windows will popup. In case they don't, you can modify the `run.sh` script to
56run your favorite terminal emulator (default being `gnome-terminal`).
57
58The first terminal window is running the `scan.sh` found under the `scripts/` directory.
59The script expects a byte sequence which is then scanned through the tracee's memory. Upon
60finishing, the results are cross referenced with previous scans to only get the memory
61addresses that have appeared in all scans.
62
63The second terminal window is running the `read.sh` also found under the `scripts/` directory.
64The scripts reads out the data of the addresses of the most recent scan (post cross-referencing)
65at regular intervals (once per second).
66
67You can write to the remote process' memory by running:
68
69```bash
70./trainer <tracee_pid> <hex_value> <address ...>
71```
72
73## Screenshot
74![](./screenshots/assaultcubedemo_smol.png)
75
76## Related links
77* [man 2 ptrace](https://man7.org/linux/man-pages/man2/ptrace.2.html)
78* [man 5 proc](https://man7.org/linux/man-pages/man5/proc.5.html)
79
80## Image sources
81* [Pepe with monster](https://www.memeatlas.com/images/pepeThumbnails/pepe-boomer-monster-thumbsup-thumbnail.png)
82* [Pepe computer](https://i.ytimg.com/vi/_-dh_BnaxNo/maxresdefault.jpg)
83* [Pepe gamer](https://www.nicepng.com/png/full/0-8360_png-pepegamer-pepe-emoji-discord.png)