Cheat Engine Tutorial
- How to Set Up Cheat Engine
- How to Attach Cheat Engine to a Game
- How to Set Up Hotkeys
- How to Find Values
- How to make a Script
- How to copy and paste elements from one Table to another
- How to assign hotkeys to the elements in the Table
- How to write and modify Code (code examples)
Advanced Guide:
To get started with Cheat Engine, first download and install the software. Visit the official Cheat Engine website and download the latest version. During installation, be sure to uncheck any unwanted additional components that may be offered. Once installed, open Cheat Engine and get ready to configure your settings.
Now, if the game crashes when trying to create a script, go to the "Debugging Options" tab and try switching from "Use Windows debugger" to "Use VEH Debugger" or vice versa, depending on which one causes the crash.
2) How to Attach Cheat Engine to a Game
To attach Cheat Engine to a game, follow these steps:
- Launch the game you want to attach Cheat Engine to.
- Open Cheat Engine.
- Click the computer icon at the top left to open the process selection window.
- Select your game's process from the list and click "Open" or double click on Games ID.
- Once attached, you can start using Cheat Engine to modify game values.
3) How to Set Up Hotkeys
To set up hotkeys in Cheat Engine, follow these steps:
- Open Cheat Engine.
- Go to the "Edit" menu and select "Settings".
- In the settings menu, go to the "Hotkeys" section.
- Here you can assign hotkeys to different actions. In the 'Hotkey' section, press the key you want to associate with the shortcut.
- Press Ok to save the settings.
4) How to Find Values
Cheat Engine has several ways to find a specific value you are looking for. Below, I list the three most commonly used methods.
4.1) Exact value Search
To conduct an exact value search, follow these steps (Scan Type: Exact Value):
- In "Value:", enter the value you want to search for in the search box (for example 1000$).
- Select the type of value you think the value you're searching for is. Usually, it's "4 Bytes" or "Float"; if it's none of these, select "All" from the dropdown menu.
- Click "First Scan" to find all instances of that value.
- After this, sell or buy something and enter the new value in the "Value:" section.
- Now click on "Next Scan" and repeat this process until you have narrowed down the number of Addresses/Values that Cheat Engine finds.
- Once you have found the value you think is correct, double-click on the chosen value in the "Found:" section.
- Now you can modify the value as you wish.
4.2) Increased/Decreased value Search
If you're unsure of the specific value, you can use the unknown initial value search. Here’s how:
- Start the game and attach Cheat Engine.
- In the 'Value Type' section, choose 'Float' or "Double" or "2 Bytes" to have a higher chance of finding the right value; if it's none of these, select "All" from the dropdown menu.
- Select "Unknown initial value" from the toolbar.
- Select "First Scan".
- After making changes in the game (such as changing scores or resources), select "Decreased value" then press "Next Scan" or "Increased value" then press "Next Scan" as needed.
- Repeat until you narrow down the results and identify the value.
4.3) Changed/Unchanged value Search (alternative search for Unknown Initial Value)
If you have difficulty finding a specific value, try using the Changed/Unchanged value method, you can use the unknown initial value search. Here’s how to search for a value that has changed or unchanged, follow these steps:
- Attach Cheat Engine to the game process.
- In the 'Value Type' section, choose 'All' to have a higher chance of finding the value you are looking for, but it will significantly slow down the search.
- Select "Unkown initial value" in the search box and then click "First Scan".
- Monitor the value that is changing (for example, health points or heat).
- Select "Changed value" (always select changed value for first) and click "Next Scan".
- Monitor the value that is NOT changing and select "Unchanged value" then click "Next Scan".
- Repeat the process to further refine your results.
5) How to make a Script
Method One (Direct Method):
Please note that this method does not work for all games, and even when it does, it is advisable to use it only if you are sure that the game will not receive further updates or for most games that are not emulated (in any case, I always recommend using the second method).
A) Find out what accesses this address
This type of search can read one of these structures (these are just examples):
mov eax,[rcx+00000470]
This structure only occurs if you do "Find out what accesses this address" and has the register (in this case, eax) placed in front of where our value is input. This means that the value previously found enters offset 470 (which is line/verse 1136 but written in hexadecimal) of the rcx register, and is then all placed into the eax register via the "mov" command.
or also:
mov [rcx+00000470],eax
In this structure, the value we found is placed into eax, which in turn is placed into the rcx register at offset 470.
What to do:
- Right-click on the found instruction, then click on "Find out what accesses this address."
- At this point, a screen will appear titled "The following opcodes accessed xxxxxxxxxxx," where the "x" will be replaced by a numerical value that represents the address to which Cheat Engine will try to read what accesses it.
- Depending on the type of cheat and the game, there may already be an "instruction" present at the top left under "Count", where you will see a count that increases over time. If there isn't, you may need to try performing an action/interaction; for example, if you're trying to modify the amount of ammunition, you will need to fire a shot to see what instruction is being read.
- Select the instruction you want to modify and click on "Show disassembler".
- Another screen will appear titled "Memory Viewer" where the modifiable instruction will be present.
- Without selecting other instructions on the "Memory Viewer" screen, click on "Tools" and then "Auto Assemble", or simply press Ctrl+A (which will directly open "Auto Assemble" without having to click on "Tools").
- At this point, another screen will appear titled "Auto Assemble". In this screen, click on "Template", then on "Cheat Table Framework Code", and finally click again on "Template" and then "Code Injection" (or just press Ctrl+Alt+T to then press Ctrl+I).
- A screen titled "Code inject template" will appear; just click "OK".
- Now the "Auto Assemble" screen will finally be populated, and we can start modifying the code to create our cheat, but it's advisable first to add it to the table. To do this, click on "File" and then "Assign to current cheat table".
Now we can finally modify our code, (click on "<script>" to open the Script)
B) Find out what writes to this address
This type of search can write only in this structure (these are just examples):
mov [rcx+00000470],eax
This type of instruction means that the value we previously found contained in eax is written to the rcx register at offset 470 through the command "mov".
What to do:
- Right-click on the found instruction, then click on "Find out what writes to this address".
- At this point, a screen will appear titled "The following opcodes write to xxxxxxxxxxx", where the "x" will be replaced by a numerical value that represents the address to which Cheat Engine will try to write what accesses it.
- Perform an action/interaction (like shoot, buy, sell, ecc...)
- Select the instruction you want to modify and click on "Show disassembler".
- Another screen will appear titled "Memory Viewer" where the modifiable instruction will be present.
- Without selecting other instructions on the "Memory Viewer" screen, click on "Tools" and then "Auto Assemble", or simply press Ctrl+A (which will directly open "Auto Assemble" without having to click on "Tools").
- At this point, another screen will appear titled "Auto Assemble." In this screen, click on "Template," then on "Cheat Table Framework Code," and finally click again on "Template" and then "Code Injection" (or just press Ctrl+Alt+T to then press Ctrl+I).
- A screen titled "Code inject template" will appear; just click "OK".
- Now the "Auto Assemble" screen will finally be populated, and we can start modifying the code to create our cheat, but it's advisable first to add it to the table. To do this, click on "File" and then "Assign to current cheat table".
Method Two (AoB Method):
This is my preferred method, which is mainly used when you know that the game will be updated or for emulated games where the AOB changes every time the game is restarted (this often happens in PS2 games where the "direct" method cannot be used).
As a preamble, from now on, I will always use the "Find out what accesses this address" method (if you don't know what that means, please read the guide above) to find the instruction and then create the script.
- Select the value you previously found, right-click, and select "Find out what accesses this address".
- At this point, a screen will appear titled "The following opcodes accessed xxxxxxxxxxx", where the "x" will be replaced by a numerical value representing the address that Cheat Engine will try to read what accesses it.
- Depending on the type of cheat and the game, there may already be an "instruction" present at the top left under "Count," where you will see a count that increases over time. If there isn't, you may need to try performing an action/interaction; for example, if you're trying to modify the amount of ammunition, you will need to fire a shot to see which instruction is being read.
- Select the instruction you want to modify and click on "Show disassembler".
- Another screen will appear titled "Memory Viewer", where the modifiable instruction will be present.
- Without selecting other instructions on the "Memory Viewer" screen, click on "Tools" and then "Auto Assemble", or simply press Ctrl+A (which will directly open "Auto Assemble" without needing to click on "Tools").
- At this point, another screen will appear titled "Auto Assemble", In this screen, click on "Template", then on "AOB Injection" (or press Ctrl+Shift+A and you don't need to click on "Template").
- A screen titled "Code inject template" will appear; just click "OK".
- Now another screen named "Code inject template" will pop up where you can name the script. I strongly recommend doing this, replacing INJECT with the name you want to give to the script, for example, InfiniteAmmo or InfiniteMoney or OHK, which means One Hit Kill (I suggest naming it related to the cheat you want to create). Now, click "OK".
- Now the "Auto Assemble" screen will finally be populated, and we can start modifying the code to create our cheat, but it's advisable first to add it to the table. To do this, click on "File" and then "Assign to current cheat table".
6) How to copy and paste elements from one Table to another
Useful if you want to merge two different tables (presumably from the same game, although some features may also be useful in other games, such as "Compact Mode" or "Auto Attach").
- Open both tables.
- Select an element in either of the two tables or multiple elements by holding down CTRL and then clicking on the desired elements with the left mouse button, or by holding down SHIFT to click on one element and then another one below (or above) it to select all those in between.
- Right-click and select "Copy".
- Click on the table to which you want to transfer the copied elements, right-click, and then select "Paste."
7) How to assign hotkeys to the elements in the Table
Useful for activating or deactivating a specific cheat without having to minimize the game screen. It can also be helpful for setting a specific value for a particular cheat.
- Select the element to which we want to assign a hotkey.
- After right-clicking on the selected element, click on "Set hotkeys" (or press Ctrl+H after selecting a specific element).
- Click on "Create hotkey".
- Click on the box that says "Type the keys you want to set the hotkey to" and press the key or key combination you want to set as the hotkey (if you make a mistake, just press "Clear" to empty the box).
- In the "Active sound" and "Deactivate sound" sections, you can set a beep to indicate whether the hotkey has been pressed (useful for knowing if the cheat has been enabled or disabled).
- Click on "Apply" and then "OK" to confirm everything.
- If you want to modify the hotkey, simply click on "Edit Hotkey" (or double-click on the previously assigned hotkey).
- If you want to delete the assigned hotkey, just select it and right-click on the hotkey, then select "Delete".
8) How to write and modify Code (code examples)
It primarily depends on what you want to accomplish. Below, I will provide examples of various types of code.
I will provide examples only for scripts created using the AoB method (which can be found earlier in this guide).
It is important to always indicate the correct type of value within the script, which is easily visible on the main Cheat Engine screen after the desired value has been found. There are several sections:
These examples are based on the value of ammunition, which is of type integer 4 Bytes to which I assign the value (int) 99.
↓↓↓
If an instruction with this structure is found:
mov eax,[rcx+00000470]
the code should be written like this:
[ENABLE]
aobscanmodule(Ammo,START.exe,8B 81 70 04 00 00 C3) // should be unique
alloc(newmem,$1000,Ammo)
label(code)
label(return)
newmem:
mov [rcx+00000470],(int)99
code:
mov eax,[rcx+00000470]
jmp return
Ammo:
jmp newmem
nop
return:
registersymbol(Ammo)
[DISABLE]
Ammo:
db 8B 81 70 04 00 00
unregistersymbol(Ammo)
dealloc(newmem)
Or like this:
[ENABLE]
aobscanmodule(Ammo,START.exe,8B 81 70 04 00 00 C3) // should be unique
alloc(newmem,$1000,Ammo)
label(code)
label(return)
newmem:
mov eax,(int)99
mov [rcx+00000470],eax
mov eax,[rcx+00000470]
code:
mov eax,[rcx+00000470]
jmp return
Ammo:
jmp newmem
nop
return:
registersymbol(Ammo)
[DISABLE]
Ammo:
db 8B 81 70 04 00 00
unregistersymbol(Ammo)
dealloc(newmem)
If a structure of this type is found (this type is usually write-type, meaning an action or interaction must occur to overwrite the value written in the script with the original one once the script is activated):
mov [rcx+00000470],eax
the code should be written like this:
[ENABLE]
aobscanmodule(Ammo,START.exe,89 81 70 04 00 00) // should be unique
alloc(newmem,$1000,Ammo)
label(code)
label(return)
newmem:
mov eax,(int)99
code:
mov [rcx+00000470],eax
jmp return
Ammo:
jmp newmem
nop
return:
registersymbol(Ammo)
[DISABLE]
Ammo:
db 89 81 70 04 00 00
unregistersymbol(Ammo)
dealloc(newmem)
Now I will provide an example of how to handle "movss," which is still a type of "mov." The value is a decimal value of type "Float" to which I will assign the numeric value (float) 9999.
↓↓↓
If a structure of this type is found:
movss xmm0,[rbx+00000528]
the code should be written like this:
[ENABLE]
aobscanmodule(Rope,START.exe,F3 0F 10 83 28 05 00 00 4C) // should be unique
alloc(newmem,$1000,Rope)
label(code)
label(return)
newmem:
mov [rbx+00000528],(float)9999
code:
movss xmm0,[rbx+00000528]
jmp return
Rope:
jmp newmem
nop 3
return:
registersymbol(Rope)
[DISABLE]
Rope:
db F3 0F 10 83 28 05 00 00
unregistersymbol(Rope)
dealloc(newmem)
Or it can also be written like this:
[ENABLE]
aobscanmodule(Rope,START.exe,F3 0F 10 83 28 05 00 00 4C) // should be unique
alloc(newmem,$1000,Rope)
label(code)
label(return)
label(InfRope)
newmem:
movss xmm0,[InfRope]
movss [rbx+00000528],xmm0
movss xmm0,[rbx+00000528]
code:
movss xmm0,[rbx+00000528]
jmp return
InfRope:
dd (float)9999
Rope:
jmp newmem
nop 3
return:
registersymbol(Rope)
[DISABLE]
Rope:
db F3 0F 10 83 28 05 00 00
unregistersymbol(Rope)
dealloc(newmem)
If the instruction is written with this structure:
movss [rcx+00000528],xmm1
the code should be written like this:
[ENABLE]
aobscanmodule(Rope,START.exe,F3 0F 11 89 28 05 00 00) // should be unique
alloc(newmem,$1000,Rope)
label(code)
label(return)
label(InfRp)
newmem:
movss xmm1,[InfRp]
code:
movss [rcx+00000528],xmm1
jmp return
InfRp:
dd (float)9999
Rope:
jmp newmem
nop 3
return:
registersymbol(Rope)
[DISABLE]
Rope:
db F3 0F 11 89 28 05 00 00
unregistersymbol(Rope)
dealloc(newmem)
1) How to Auto Attach Cheat Engine to a Game
To perform the auto attach, there are at least two methods; I will try to explain both.
A) Auto Attach Script
A) Auto Attach Script
With this method, we will create a script that, when activated, will automatically attach Cheat Engine to the game's process.
- Create a blank script. To do this, after opening Cheat Engine, you need to click on "Memory View," then "Tools," and then "Auto Assemble" (or simply press Ctrl+A). At this point, click on "Template" and then on "Cheat Table Framework Code" (or just press Ctrl+Alt+T). Now click on "File" (in the top left) and then on "Assign to current cheat table."
- Now that we have our cheat to compile, let's rename it as we prefer (I recommend something related, like "Auto Attach").
- Open the cheat by double-clicking on <script>, and at this point, you need to enter the code which is:
B) Auto Attach Check
local procName = ".exe"
, you need to enter the name of the game's process, for example, local procName = "Strike Team Hydra.exe"
.
2) How to find a specific value if you have a script
A) Find with Module
To find a value when you have already created a script previously, first you need to double-click on a
<script>
to access "Auto Assemble" (where you can modify the code).Look for the phrase // ORIGINAL CODE - INJECTION POINT: xxxxxx (the x's are replaced by the module) and copy the module, which could be something like GameName.exe+BA2A97.
Click on "Memory View", then right-click anywhere and choose "Go to address".
Paste the previously copied module and click "OK"; at this point, you will be transported directly to where that specific module is located.
Right-click on the first result (which is the injection point of the module; in fact, if you look to the left, you can see the module) and select "Find out what addresses this instruction accesses".
At this point, a screen will appear where you will find our value; just double-click on the value or right-click and then select "Copy selected addresses to addresslist".
B) Find with AoB
This method is a bit complex and requires a script created using the AoB method. Array of Byte (AoB) can change with the game update.
To find a value when you have already created a script previously, first you need to double-click on a
<script>
to access "Auto Assemble" (where you can modify the code).Copy the array found just below
[ENABLE]
(it may look something like 8B B0 08 0B 00 00 48 85 DB 74 2D).In the section where you perform scans in Cheat Engine, select "Array of Byte" where it says "Value Type"; at this point, you need to paste the previously copied array.
Below "Stop" in the scanning section, there is a checkbox labeled "Writable," which you need to double-click so it turns into a solid black square (which means it will scan all types of values, both writable and non-writable).
Now click on "First Scan" and wait for Cheat Engine to complete the scan.
Once the scan is complete, right-click on the result and select "Disassemble this memory region." Be careful; the injection point of the code may not correspond to the injection point of the array, so you need to select the correct injection point. Usually, just scrolling up with the middle mouse button is enough to select the correct injection point below.
Right-click on the first result (if it is the injection point of the AoB code) and select "Find out what addresses this instruction accesses."
At this point, a screen will appear where you will find our value; just double-click on the value or right-click and then select "Copy selected addresses to addresslist."
C) Find with simil Pointer
This method also works with non-AoB scripts.
First of all, I need to explain how to modify a script to create a Pointer.
First, you need to double-click on a <script> to access "Auto Assemble" (where you can modify the code).
Once in the script, above "newmem:", write label(YourNameHere) and registersymbol(YourNameHere). Remember to write everything attached without spaces for both label and registersymbol, and of course, they must have the same name.
In "newmem:" (it works fine in code as well), write mov [YourNameHere], register (instead of register, you need to write the same register that is written in the first line under "code:"—that is the one in square brackets).
Example:
If "code:" says
mov esi,[rax+00000B08]
then in "newmem:" you should write
mov [YourNameHere], rax
If in "code:" it says
mov [ebx+28], esi
then you should write
mov [YourNameHere], ebx
In the "code:" section, below "jmp return", you need to write YourNameHere: which is the name of your variable followed by a colon (you might also write dq 0 for 64-bit games and dd 0 for 32-bit games below this, but this is not necessary).
Finally, in the [DISABLE] section, you need to add an unregistersymbol written as unregistersymbol(YourNameHere) or modify the existing unregistersymbol to put a * in place of what is written there (the name of the script), so you should write unregistersymbol(*). Now, the script is complete; just click "OK" to confirm everything.
Click on "Add Address Manually," enter the name of your pointer, in this case, YourNameHere, and check the "Pointer" box. Where it says 0, place the correct offset that is written in "code:".
Example:
mov esi, [rax+00000B08]
instead of 0, you should put B08 (if there’s nothing written near the register, like mov esi,[rax], then you should leave it as 0). At this point, confirm everything by pressing "OK," and the pointer will be created.
aobscanmodule(Test,START.exe,8B B0 08 0B 00 00 48 85 DB 74 2D) // should be unique
alloc(newmem,$1000,Test)
label(code)
label(return)
label(seePointer)
registersymbol(seePointer)
newmem:
mov [seePointer],rax
code:
mov esi,[rax+00000B08]
jmp return
seePointer:
Test:
jmp newmem
nop
return:
registersymbol(Test)
[DISABLE]
Test:
db 8B B0 08 0B 00 00
unregistersymbol(*)
dealloc(newmem)
Now that we have our Pointer, we just need to activate the script, and we will be able to see the value we were looking for. You can also extract the value manually. To do this, you need to:
Compile the pointer by activating the script. Under the "Address" section, double-click on the pointer (on something like P->223F73F6838) and copy the address.
Click on "Add Address Manually" and paste the address, then press "OK."
3) How to Update an AoB Script
Example:
Array of the old script:
0F B6 74 0D 00 48 89 35 3A D0 7B C8
Array of the new script:
0F B6 74 0C 00 48 89 35 E0 E0 7B C8
Final Array (to use in the script to be updated):
0F B6 74 0? 00 48 89 35 ?? ?0 7B C8
Personally, I like to use two ??, so in this case, you would get:
0F B6 74 ?? 00 48 89 35 ?? ?? 7B C8
or
0F B6 74 xx 00 48 89 35 xx xx 7B C8
is the same.
Now you just need to replace the array with the correct one (the aobscan is located just below [ENABLE]).
Example:
aobscan(Test,0F B6 74 0D 00) // should be unique
should be replaced with
aobscan(Test,0F B6 74 ?? 00 48 89 35 ?? ?? 7B C8) // should be unique
Be careful, if there are + signs (one under 'code' and one in [DISABLE]) next to the script name, it means that the original script ignored the code before the point where the injection point is actually allocated in memory to make modifications, which is what is below // ---------- INJECTING HERE ----------. If you do not put anything above this point, you need to remove the + (for example, +08) and its value; otherwise, the game will crash. On the other hand, if you do include something that is before // ---------- INJECTING HERE ----------, then you need to add the plus, count the bytes, and write it in hexadecimal...
https://sourceforge.net/projects/aob-comparator-extarctor-force/
4) How to Compare
Finally, we have arrived at the most problematic section.
First of all, you need to get used to checking the content of the script you want to use to understand if that part of memory also contains “unwanted” values. To do this, you need to follow these steps:
Find the value if you haven't already. If you already have the script, follow the tutorial "How to find a specific value if you have a script", specifically points A and B (the tutorial is above).
Now you need to right-click and select "Find out what accesses this address". Once the new window opens, choose an injection point and click on "Show Disassembler". Once you are here, right-click on the first element and select "Find out what addresses this instruction accesses".
Here you can see if there are additional elements beyond what you previously found (such as enemy HP, enemy ammunition, opponent scores, etc...). Modifying the value with the script without a compare will also change the unwanted values.
A) How to compare using Dissect Data Structure
To compare the data using "Dissect Data Structure," after right-clicking on the injection point in the "Memory View," you need to select "Find out what addresses this instruction accesses.” Once the data appears, you need to identify which is the correct value (by reading its value or its address), the one you want to change while excluding the others.
Right-click on the chosen value and select "Open dissect data with selected addresses," then double-click on <New windows>. You can rename the dissect data if you wish, then click "OK" until the Dissect Data screen appears. Now hold down Ctrl and left-click to select the other values, then right-click on any value you want to exclude and select "Open dissect data with selected addresses." Choose "Structure Dissect:xxxxx" by double-clicking on it.
Once this is done, click on "File" and then select "Save Values.” Give the file a name (for example, a1, or test1, or dissect1, etc.) and click "Save."
At this point, you need to restart the game, reattach Cheat Engine to the game, find the desired value—the one you want to modify—and repeat the previous steps, saving a second file that will be compared with the first one. (The comparison can also be done manually by checking the differences between the first saved file and the dissected data opened after restarting the game, but I recommend using my tool, which I will post below.)
Once the static value has been found (preferably 4 bytes, 2 bytes, but float and double are also acceptable) that is the same for both files (both dissected data), write in the script where it says "newmem:"
cmp [register+offset], (value type)value
This means that the value of a certain type goes into the offset of a certain register (the offset to be inserted must be static, meaning it does not change when the game restarts) through the command cmp, while jne code means that the piece of code we do not want the script to execute will be executed if the value in the offset is the static and unique one; otherwise, it will execute what is written in "code:".
Real Example:
newmem:
{
The static value found is 1 in the offset 1FC in the register rcx (in this specific case, but it may vary in other scripts)
}
cmp [rcx+1FC], (int)1
jne code
mov r8d, (int)2000000
mov [rcx+00000508], r8d
jmp return
code:
mov [rcx+00000508], r8d
jmp return
Here I post a few links to learn how to do the compare without tools, for those who are a bit masochistic:
https://www.youtube.com/watch?v=oNMh7LYZ5yU
https://www.youtube.com/watch?v=H6eH6eSAL2w&list=PLkcoDCAtsJxLibqFRaL7AoH7uSyZbf0Eb
https://www.youtube.com/watch?v=-jBmeWXndKA
B) How to compare using Stacks:
Once we've found the value we want to modify and created a script for it, as usual, we need to check if other values besides the one we want to change are also being accessed at the injection point of the code.
I’ll skip the steps before the “Memory View” (they should already be known). In any case, once in “Memory View”, right-click on the correct injection point and select “Find out what addresses this instruction accesses”. Once you’ve identified the “unwanted” values, you can try to make the script ignore them.
To do this, follow these steps:
-
Once you're in the window called “Accessed addresses by.....”, right-click on the value you want to modify.
-
Click on “Show register states” and then left-click again on the “S” (if you hover over the “S” for a few seconds, a tooltip will appear showing “Stack view”).
-
Once the “Stack View” window opens, right-click on any address and select the option “(RSP)”.
-
After selecting the “(RSP)” option, select the very first element in the table and scroll to the bottom. Now hold down SHIFT and click on the last item in the list to highlight all elements in the table.
-
Now right-click on the last item and select “Copy Line”.
-
Paste everything you copied into a text file and save it with a name (for example: Player HP, Player Credits, Player Damage, etc.).
-
At this point, select the value that you don’t want to be affected by the script, and repeat everything from step 1 to step 6. Just make sure to rename the files with clear and memorable names (e.g., Enemy HP, Enemy Credits, Enemy Damage, etc.).
-
If there are other values, do the same process and restart the game.
-
You’ll need to find the value you're working on again and repeat steps 1 to 7.
At this point, you can either use my tool to compare them automatically, or follow the video I posted below to do it manually.
Here is my Tool:
https://sourceforge.net/projects/auto-comparator-stack-viewce/
Video to do manually:
https://www.youtube.com/watch?v=D_i38SqjKBI
C) How to compare using Registers
This is another method to extract the static value we’re interested in, so we can perform the compare and exclude the changes to the values we don’t care about.
Premise: Personally, I use this method very rarely because it works infrequently, but it’s still necessary to know about it (you never know...).
-
As usual, after pressing and selecting “Find out what addresses this instruction accesses” on the code injection point in the “Memory View,” the screen named “Accessed addresses by…..” will open, where there will be both the values you want to keep and those you want to exclude.
-
Now, right-click on the (one or more) values you want to modify and select "Show register states."
-
Once the “Registers” screen is open, right-click on any value and select "Copy all register values to clipboard."
-
Paste everything into a text file, preferably with a name related to the content of your cheat (for example, P Hp V1, Only Money 1, My Score A, etc...) and save it.
-
Close the register screen and repeat the process for all the values found in the “Accessed addresses by…..” screen, with the difference that for the values you want to exclude from the script’s modifications, it’s a good idea to give them an appropriate name (like Enemy Hp V1[V2, V3...], Other Currency 1, Others Score B, etc...) and save them in their respective text files.
-
Restart the game and repeat the process up to step 5.
-
If you have the tool, use it to compare, otherwise manually compare the values, being careful to keep the values that match the ones you want to modify, and ensure they’re different from the values you want to exclude.
https://sourceforge.net/projects/auto-compare-registers-ce/
Video to do manually:
https://www.youtube.com/watch?v=7I5nUbcuQyQ
5) How to let set values to User:
To do this, you need to pay close attention while writing the code if you want to avoid game crashes.
There are two different cases in terms of code structure:
Case 1:
mov [register+offset], register
or
movss [register+offset], register
(this could also be movsd
and others...)
Real example:
mov [rbp+00000B08], eax
or
movss [rbx+00000B98], xmm1
Case 2:
mov register, [register+offset]
or
movss register, [register+offset]
Real example:
mov eax, [rbp+00000B08]
or
movss xmm1, [rbx+00000B98]
Now we can start defining what to do.
First, let's create some variable labels and registersymbol
(the latter will be essential to allow the user to choose which value to set), and we can rename them however we want, but they must have the same name, and the name must be written all together (e.g., setMoney
, changeHp
, yourscore
, etc.).
Example:
Once the variables are defined, we can begin writing the code.
1) If the code has this structure:
mov [register+offset], register
Then, we should write the code like this:
2) If the code has this structure:
mov register, [register+offset]
Then, we should write the code like this:
But instead of:
You can also write:
a;
If it’s a 64-bit game, replace ecx
with rcx
.
b;
If it’s a 64-bit game, replace ebx and eax
with rbx
and rax
.
c;
You also need to be careful not to use the same registers that are in the code: otherwise, the game crashes.
Here is the Lua code to put in "Show cheat table Lua script" to ensure that the value set by the user is preserved.
6) How to activate a cheat with a separate script:
To do this, you need to define the variable above newmem
that will enable or disable the cheat, using alloc
and registersymbol
.
Example:
alloc(StartWhenActiveSecondScript,4) // Or you need to set 8 for 64-bit games
registersymbol(StartWhenActiveSecondScript)
StartWhenActiveSecondScript:
db 0 // This means the initial state of the second cheat is 0, i.e., disabled
newmem:
// In newmem we write the initialization of the second script
cmp [StartWhenActiveSecondScript],1 // When we enable the script, this is set to 1
jne code
// Write the modifications to the code here...
code:
// Here is the original code
Once the main code structure is set up, we can write the secondary code by clicking on "Memory View", then "Tools", then "Auto Assemble", and finally "Cheat Table Framework Code". Now, click on "File" and then select "Assign to current cheat table". Once we have added the script to our table, we can modify it by writing:
[ENABLE]
StartWhenActiveSecondScript:
db 1
[DISABLE]
StartWhenActiveSecondScript:
db 0
This will activate the changes to our main script when the secondary script is enabled.
To merge two different scripts into one, you need to modify them by replacing "code", "return", and "newmem" with other names, such as "codeB", "returnB", and "newmemB."
Copy the content from the modified script into the other script, making sure to copy and paste the pieces of code in the correct locations. For example:
To implement an Overlay in Cheat Engine, you need to insert a Lua script into an "empty" script. You can create an empty script by clicking on "Memory View," then "Tools," then "Auto Assemble," and finally "Cheat Table Framework Code." Now, click on "File" and then select "Assign to current cheat table." Once the script is added to our table, we can modify it by writing:
Once the code is inserted, you need to modify the part:
Just replace "YourPointerDescription" with the content of the pointer description that you want to display on the screen.
Of course, you also need to have created a pointer beforehand. To do that, simply follow the guide I wrote above, specifically in Section 2, see point C of the advanced tutorial.
Center Right:
Center Left:
Bottom Right:
Bottom Left:
You need to remember to set the screen to "Borderless" because it doesn't work in "Fullscreen."
Comments
Post a Comment