diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 83 |
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 | |||
| 3 | This project is part of a presentation I did about the bare and bones of game hacking on Linux. | ||
| 4 | The goal is to introduce the viewers into two core Linux APIs, namely `procfs` and `ptrace`, through | ||
| 5 | the development of a game trainer. | ||
| 6 | |||
| 7 | ## Disclaimer | ||
| 8 | Everything discussed and showed in the presentation was done for educational purposes only. | ||
| 9 | I do not encourage or promote the use of cheats or any other method that provide an unfair advantage. | ||
| 10 | |||
| 11 | ## Licence | ||
| 12 | The 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 | ||
| 23 | During the demo I went through the steps of making a simple trainer using | ||
| 24 | the concepts explained previously. I did this by going through every single commit | ||
| 25 | which incrementally built the logic for the trainer. Finally I used the game | ||
| 26 | [assaultcube](https://assault.cubers.net/download.html) to demonstrate the | ||
| 27 | trainer's capability to scan, read and write another process' memory. | ||
| 28 | |||
| 29 | ## Download & Use | ||
| 30 | |||
| 31 | ### Clone the repo | ||
| 32 | |||
| 33 | ```bash | ||
| 34 | git clone https://git.orfeas.xyz/linux-game-trainer | ||
| 35 | ``` | ||
| 36 | |||
| 37 | ### Prerequisites | ||
| 38 | In most (if not all Linux distros), `ptrace` won't be able attach to any process. | ||
| 39 | To change this behavior you can run: | ||
| 40 | |||
| 41 | ```bash | ||
| 42 | echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | ||
| 43 | ``` | ||
| 44 | |||
| 45 | Note that this setting is not persistent across reboots. | ||
| 46 | |||
| 47 | ### Running the trainer | ||
| 48 | To run the trainer run: | ||
| 49 | |||
| 50 | ```bash | ||
| 51 | make | ||
| 52 | ./run <tracee_pid> | ||
| 53 | ``` | ||
| 54 | |||
| 55 | Two terminal windows will popup. In case they don't, you can modify the `run.sh` script to | ||
| 56 | run your favorite terminal emulator (default being `gnome-terminal`). | ||
| 57 | |||
| 58 | The first terminal window is running the `scan.sh` found under the `scripts/` directory. | ||
| 59 | The script expects a byte sequence which is then scanned through the tracee's memory. Upon | ||
| 60 | finishing, the results are cross referenced with previous scans to only get the memory | ||
| 61 | addresses that have appeared in all scans. | ||
| 62 | |||
| 63 | The second terminal window is running the `read.sh` also found under the `scripts/` directory. | ||
| 64 | The scripts reads out the data of the addresses of the most recent scan (post cross-referencing) | ||
| 65 | at regular intervals (once per second). | ||
| 66 | |||
| 67 | You can write to the remote process' memory by running: | ||
| 68 | |||
| 69 | ```bash | ||
| 70 | ./trainer <tracee_pid> <hex_value> <address ...> | ||
| 71 | ``` | ||
| 72 | |||
| 73 | ## Screenshot | ||
| 74 |  | ||
| 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) | ||
