Podcast
Questions and Answers
Which of the following is required to use the ReadProcessMemory function?
Which of the following is required to use the ReadProcessMemory function?
- iostream
- stdlib.h
- stdio.h
- Windows.h (correct)
The size of the data to read for the registers is 8 bytes.
The size of the data to read for the registers is 8 bytes.
False (B)
What data type is suggested for storing the values returned by ReadProcessMemory?
What data type is suggested for storing the values returned by ReadProcessMemory?
DWORD
The main function in C++ starts with (blank) and ends with return 0;
The main function in C++ starts with (blank) and ends with return 0;
Match the following components with their descriptions:
Match the following components with their descriptions:
What does the increase_money
function do in the Player class?
What does the increase_money
function do in the Player class?
The mov
command is used to remove resources from RAM.
The mov
command is used to remove resources from RAM.
What type of model do multiplayer games use to allow players to interact?
What type of model do multiplayer games use to allow players to interact?
In a typical game, resources like images and sounds are loaded from the hard drive into ______.
In a typical game, resources like images and sounds are loaded from the hard drive into ______.
Match the programming components with their descriptions:
Match the programming components with their descriptions:
How does the server receive updates about a player's actions?
How does the server receive updates about a player's actions?
The Player class encapsulates player data and game mechanics.
The Player class encapsulates player data and game mechanics.
What is typically done with game data during the setup phase?
What is typically done with game data during the setup phase?
What is the purpose of a code cave in hacking?
What is the purpose of a code cave in hacking?
Reversing combines previous methods to retrieve the address we care about.
Reversing combines previous methods to retrieve the address we care about.
What register is referenced when determining the gold memory address in the example provided?
What register is referenced when determining the gold memory address in the example provided?
What is the purpose of modifying Wesnoth's code in this chapter?
What is the purpose of modifying Wesnoth's code in this chapter?
The instruction responsible for decreasing gold during recruitment is 'sub dword ptr ds:[edx+4], ecx'. This means that _____ contains the cost of the unit just recruited.
The instruction responsible for decreasing gold during recruitment is 'sub dword ptr ds:[edx+4], ecx'. This means that _____ contains the cost of the unit just recruited.
Match the following terms with their descriptions:
Match the following terms with their descriptions:
Dynamic Memory Allocation (DMA) refers to the process where the gold address remains the same throughout the game.
Dynamic Memory Allocation (DMA) refers to the process where the gold address remains the same throughout the game.
Which method requires finding an instruction that modifies a specific value?
Which method requires finding an instruction that modifies a specific value?
What value will be used as the gold address in this chapter?
What value will be used as the gold address in this chapter?
The debugger that will be used in this chapter is called __________.
The debugger that will be used in this chapter is called __________.
The final method of dealing with DMA is considered the least versatile.
The final method of dealing with DMA is considered the least versatile.
What is the base target for the methods discussed in this chapter?
What is the base target for the methods discussed in this chapter?
Match the components of the debugger with their descriptions:
Match the components of the debugger with their descriptions:
What must be done to locate the game code that decreases gold?
What must be done to locate the game code that decreases gold?
X64dbg provides a Symbols tab that allows switching to the game's code and memory space.
X64dbg provides a Symbols tab that allows switching to the game's code and memory space.
The path to the x64dbg executable is __________.
The path to the x64dbg executable is __________.
What is the purpose of a code cave?
What is the purpose of a code cave?
A code cave can only be used to replace original instructions with a single new instruction.
A code cave can only be used to replace original instructions with a single new instruction.
What is the original code instruction for displaying terrain description?
What is the original code instruction for displaying terrain description?
A code cave is typically used in sections of the game's memory that are ______.
A code cave is typically used in sections of the game's memory that are ______.
After implementing a code cave, how can you return to the original code?
After implementing a code cave, how can you return to the original code?
Match the following memory addresses with their functions:
Match the following memory addresses with their functions:
By redirecting the original code, we can invoke both the debug menu and the terrain description functionality.
By redirecting the original code, we can invoke both the debug menu and the terrain description functionality.
What is the first step in implementing a code cave according to the content?
What is the first step in implementing a code cave according to the content?
What does DMA stand for in the context of memory allocation in Wesnoth?
What does DMA stand for in the context of memory allocation in Wesnoth?
The player’s gold address remains constant between games.
The player’s gold address remains constant between games.
What is the purpose of the Player class in Wesnoth?
What is the purpose of the Player class in Wesnoth?
The command to create a new Game object in the code is 'player.game = new ______('Human', 100, 1);'
The command to create a new Game object in the code is 'player.game = new ______('Human', 100, 1);'
Match the following variables with their types and uses in the Player class:
Match the following variables with their types and uses in the Player class:
To find the player's gold address, what should you do first?
To find the player's gold address, what should you do first?
In order to easily find the gold address, you need to ensure that the first player is set to a Computer opponent.
In order to easily find the gold address, you need to ensure that the first player is set to a Computer opponent.
What is the final step in the process of finding the gold address?
What is the final step in the process of finding the gold address?
Flashcards
Code Cave Redirection
Code Cave Redirection
A technique used to modify the behavior of a program by redirecting the execution flow to a different location in memory.
Code Cave
Code Cave
A section of memory in a program that is reserved for storing additional instructions.
Code Cave - Recreate Original Instruction
Code Cave - Recreate Original Instruction
The original instructions in a program are copied to a code cave, preserving the original functionality.
Code Cave - Redirect Original Code
Code Cave - Redirect Original Code
Signup and view all the flashcards
Code Cave - Returning to Original Code
Code Cave - Returning to Original Code
Signup and view all the flashcards
Code Cave - Functionality
Code Cave - Functionality
Signup and view all the flashcards
Code Cave - Replacing Instruction
Code Cave - Replacing Instruction
Signup and view all the flashcards
Code Cave - Benefits
Code Cave - Benefits
Signup and view all the flashcards
Dynamic Memory Allocation (DMA)
Dynamic Memory Allocation (DMA)
Signup and view all the flashcards
Attaching a Debugger
Attaching a Debugger
Signup and view all the flashcards
Breakpoint
Breakpoint
Signup and view all the flashcards
NOP (No Operation) Instruction
NOP (No Operation) Instruction
Signup and view all the flashcards
Hexadecimal (Hex)
Hexadecimal (Hex)
Signup and view all the flashcards
Code Section
Code Section
Signup and view all the flashcards
Dump Section
Dump Section
Signup and view all the flashcards
Debugger
Debugger
Signup and view all the flashcards
What is a class in game programming?
What is a class in game programming?
Signup and view all the flashcards
What is a Player class?
What is a Player class?
Signup and view all the flashcards
What is a Player list (array)?
What is a Player list (array)?
Signup and view all the flashcards
How are game resources loaded?
How are game resources loaded?
Signup and view all the flashcards
What is the mov
command's role in games?
What is the mov
command's role in games?
Signup and view all the flashcards
How are class locations used for data access?
How are class locations used for data access?
Signup and view all the flashcards
What is a client-server model in games?
What is a client-server model in games?
Signup and view all the flashcards
What role do clients play in multiplayer games?
What role do clients play in multiplayer games?
Signup and view all the flashcards
Code Cave DMA Defeat
Code Cave DMA Defeat
Signup and view all the flashcards
Reversing DMA
Reversing DMA
Signup and view all the flashcards
Reversing for Address Retrieval
Reversing for Address Retrieval
Signup and view all the flashcards
Base Pointer in DMA
Base Pointer in DMA
Signup and view all the flashcards
Gold Address in a Game
Gold Address in a Game
Signup and view all the flashcards
Player Class in a Game
Player Class in a Game
Signup and view all the flashcards
What is DMA?
What is DMA?
Signup and view all the flashcards
Wesnoth 1.14.9
Wesnoth 1.14.9
Signup and view all the flashcards
ReadProcessMemory()
ReadProcessMemory()
Signup and view all the flashcards
DWORD
DWORD
Signup and view all the flashcards
Base Address
Base Address
Signup and view all the flashcards
bytes_read
bytes_read
Signup and view all the flashcards
Buffer
Buffer
Signup and view all the flashcards
Dynamic vs Static Values in Games
Dynamic vs Static Values in Games
Signup and view all the flashcards
Gold Address Discovery
Gold Address Discovery
Signup and view all the flashcards
Player Class Address
Player Class Address
Signup and view all the flashcards
Dynamic Value
Dynamic Value
Signup and view all the flashcards
Static Value
Static Value
Signup and view all the flashcards
Offsetting to Dynamic Gold Address
Offsetting to Dynamic Gold Address
Signup and view all the flashcards
Income
Income
Signup and view all the flashcards
Study Notes
Game Hacking Academy - Study Notes
- This book is a beginner's guide to game hacking techniques.
- It was created in 2021 and contains material from 2019-2021.
- The book is distributed freely , but donations are welcome to support future works.
- Contact information for the author is provided (email and Twitter).
- External resources are listed, such as software (VirtualBox, Cheat Engine, x64dbg) and games (Wesnoth, Wyrmsun, Urban Terror, Assault Cube).
- The table of contents provides a detailed outline of the book's structure and topics, including computer fundamentals, game fundamentals, hacking fundamentals, debugging, reversing, programming, and more specific techniques for game hacks.
1.1 Computer Fundamentals
- A typical computer has many connected components: hard drive, RAM, video card, motherboard, and CPU.
- Hard drives store files (such as photos, executables, and other system files).
- RAM (Random Access Memory) is for quickly accessed data coming from the hard-drive.
- Video cards handle displaying graphical elements.
- Motherboards connect components and let them communicate.
- The CPU (Central Processing Unit) is the "brain" of the computer and handles instruction execution.
1.1.2 CPU Registers
- CPU's have small storage areas for data (called registers), used for speeding up instructions like adding two numbers.
- Registers are used for storing and modifying data within the CPU
1.1.3 Instructions
- Computer programs are a series of instructions.
- Instructions vary based on the architecture but typically involve operations like adding, subtracting, comparing numbers, and moving data in memory.
1.1.4 Programs and Operations
- Programs are collections of instructions used to process input and produce output.
- Programs can be structured into functions.
- A function, like a program, receives an input and produces an output.
1.1.5 Binary, Decimal, and Hexadecimal
- CPUs use binary (base-2) numbers to represent data, using 0 and 1.
- Decimal (base-10) is the system we use for everyday arithmetic, with digits 0-9.
- Hexadecimal (base-16) uses digits 0-9 and A-F to represent binary values more concisely.
1.1.6 Programming Languages
- Programming languages convert human-readable code into instructions a CPU can execute.
- Assembly language is closer to the CPU's instructions than other higher-level languages (like C, C++, Java).
- Higher-level languages like C++, Java, and Python make programming easier and more structured.
1.1.7 Operating Systems
- Operating systems (OS) are responsible for managing how a computer interacts with hardware and software.
- They are essential for handling tasks like running programs, managing hardware devices, and providing a user interface.
- Examples of OS's are Windows, Linux, and MacOS.
1.1.8 Applications
- Applications are programs that perform specific tasks for users.
- Operating systems manage applications to make use of their functionality and handle user requests.
- Different systems use various formats, like .exe for Windows programs.Â
1.1.9 Games
- Games are a type of application with complex logic for game play and interactions
- This includes handling graphics, sound, input (keys, mouse), and the rules of the game.
- Games use external libraries for common tasks in a game like graphics.
1.2 Game Fundamentals
- Games have various parts: graphics, sound, input, physics, and game logic.
- Games frequently use external libraries such as DirectX or OpenGL for graphics
- Game logic describes how the game plays, including actions of characters, object interactions, and other behaviors within the game.
1.2.2 Game Structure
- Game structure consists of functions (like Setup or Main Loop).
- Setup code executes once at the start of a game.
- Main Loop runs constantly till the game ends and handles interactions, input, updates to the screen and more.
1.2.3 Data and Classes
- Game data, like player scores, positions, or inventory is stored in variables.
- Arrays (or lists) are often used for multiple players or related things.Â
- Classes group the variables together with functions to process or modify that data.
1.3 Hacking Fundamentals
- Hacking involves modifying game memory to change in-game valuesÂ
- Steps to modify the game memory include identifying what to change, finding the related memory location, locate-ing it in the game, modifying the memory
- Different methods to achieve hacks (like modifying variables, specific sections of code, and files in memory.)Â
- Different hacks will require different approaches
1.4 Setting Up a Lab VM
- Virtual Machines (VMs) are software that simulate a physical computer and run different OSes.
- VMs are useful for isolating hacking activities from personal machines to protect personal data and to make sure there are no interferences during the hacking activity.
- VirtualBox is a free, open-source VM type.
- Windows 10 is a popular choice for a VM operating system.
- Using a VM will ensure that no changes will affect the host machine but only the virtual machine.
1.5 Memory Hack (Target specific)
- The target game is "The Battle for Wesnoth."
- The goal is to change the amount of gold a player has.
- The player's gold is stored in a variable in memory.
- The steps to change the gold include identifying the variable storing the player's gold value, finding its memory location in the game, and then changing the variable's value through a scanner or debugger.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.