https://github.com/felikcat/learning-game-hacking
Step by step guide on reverse engineering / hacking video games
https://github.com/felikcat/learning-game-hacking
assembly c-programming game-development game-hacking hacking reverse-engineering reversing reversing-challenges
Last synced: 12 months ago
JSON representation
Step by step guide on reverse engineering / hacking video games
- Host: GitHub
- URL: https://github.com/felikcat/learning-game-hacking
- Owner: felikcat
- Created: 2024-12-18T21:23:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-20T08:27:49.000Z (over 1 year ago)
- Last Synced: 2024-12-20T09:27:40.522Z (over 1 year ago)
- Topics: assembly, c-programming, game-development, game-hacking, hacking, reverse-engineering, reversing, reversing-challenges
- Language: Assembly
- Homepage:
- Size: 1.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
:imagesdir: images
== What to know before-hand
. You will deviate from the goal of game hacking at first, in order to thoroughly learn C. Failure to do this will result in your game hacking attempts being painful at best.
. If you've got attention problems or ADD or ADHD, use a Pomodoro timer to accomodate. My recommendation is using https://github.com/Splode/pomotroid. For stress management, a Pomodoro timer will also be helpful if you extend the long breaks for yourself.
- Don't be afraid to increase the focus time if it's too short, but do it sparingly. For ADHD, shorter focus times such as 20 minutes with 1 to 2 minute short breaks might work better.
. Spending money does not equate to better quality learning material. All the material provided here is of high quality, with no catches.
. This is specific to the Windows operating system. Linux does not make a good environment to learning game hacking, and is only for those that are already well versed in game hacking.
. Do not ever use AI to ask questions or solve your problems. It will be wrong, and you will also develop an over-reliance on it for problem solving; usage of AI will also make programming not as fun, and your imposter syndrome will be through the roof because it's true.
. It is normal to copy other people's code while learning, do not feel bad. However, be sure to document / comment on each part you didn't understand before, so that you can remember and learn from it.
. If you take major shortcuts, such as neglecting to make your own menu in favor of using ImGui, that is robbing yourself of valuable learning experiences and bloating / lowering the quality of your game hack. Do it from scratch, and if you can -- to make it easier on yourself, use the game engine's own functions such what is contained within the `IMatSystemSurface -> vgui -> ISurface` class in the Source Engine to draw your menu.
== Let's jump straight into it
. Install Visual Studio and avoid making CMake projects: https://visualstudio.microsoft.com/
- Also install the following VS extensions:
** https://marketplace.visualstudio.com/items?itemName=caphyon.ClangPowerTools
** https://marketplace.visualstudio.com/items?itemName=MikeWard-AnnArbor.VSColorOutput
. Learn the C programming language as it's vital. Please do not learn C++ at this stage. Follow along and write the programs in the book to fully understand their concepts:
- https://inria.hal.science/hal-02383654v2/file/modernC.pdf
- If you pivoted into writing your own small programs from knowledge provided by that book, which is recommended, I would reference the book and this website: https://www.cbyexample.com/
. x64 Intel assembly knowledge is highly recommended. Optionally, do all of the challenges in order:
- https://pwn.college/welcome/welcome/
- https://pwn.college/computing-101/assembly-crash-course/
- https://pwn.college/computing-101/memory/
== Assembly help
Command to compile assembly code: `nasm -f elf64 asm.S -o asm.o && ld asm.o -o asm_executable`
NASM-based assembly file example: https://github.com/felikcat/game-hacking-academy/blob/master/nasm_example.S
image:x86_opcode_structure_and_instruction_overview.png[]
Explanations for the most used registers; start with https://treeniks.github.io/x86-64-simplified/system-v-abi.html first then proceed to read the other pages.
Reference names and descriptions for a lot of registers: http://ref.x86asm.net/geek64.html
== Learning game hacking
. Optionally, your C knowledge can further be advanced by learning computer science staples:
- https://openstax.org/books/introduction-computer-science/pages/2-introduction
. Tools to install for game hacking:
- https://github.com/ReClassNET/ReClass.NET; be sure to compile this yourself, otherwise you'll miss out on 4 years of improvements.
- https://www.cheatengine.org/; press "Skip All" in its installer to avoid installing any of the advertisements.
- https://x64dbg.com/
- https://www.systeminformer.com/; for its injector. To use it, right-click on the desired executable, click on `Properties`, `Modules`, then `Options` -> `Load module` to inject a DLL into that process.
- Find "IDA Pro 9.0.240925 RC1" from the official source.
. Now for the fundamentals of game hacking:
- https://gamehacking.academy/
. Learn the following C++ concepts to make future game hacking easier: https://www.learncpp.com
- Chapter 14 -> Introduction to Classes
- Chapter 15 -> More on Classes
- Chapter 25 -> Virtual Functions
. For x64 games, there is some quirks with patching / hooking you should know about for both Windows and Linux: https://wiki.alliedmods.net/Porting_to_x64#I.27m_having_an_issue.21
. If making an aimbot or ESP, read this book to fully understand the math behind them:
- https://www.gamemath.com/book/
. DMA cheat creation is completely TODO, for now, here's some background information:
- To start off with for understanding how DMA works: https://cheatsdb.org/topic/713-dma-type-of-undetectable-prohibited-software/
- Gigabyte motherboards are known to block DMA devices, sell or return it and get an ASRock or ASUS (these two have the highest quality BIOS for AMD CPUs) motherboard.