Cyberpunk 2077 is a single player open world RPG where you play a merc in a futuristic city full of advanced tech, gangs, and powerful mega corps. Like most single player games it is extremely easy to develop your own cheats. In this blog we will go over how to create an infinite money cheat.
The first thing you need to do is find the money address in memory. If you can locate where in memory the game is storing the amount of money your player has then you can change it to any value you want. To do this you first need to run cheatengine and attach it to the game as shown in th image below:
Finding the money address is really easy. All you have to do is search for it. You can do this by searching for the amount of money you currently have. For example I only have 100 so I would scan the games memory for the value 100. You will probably get alot of results back. To narrow it down further you need to buy or sell something to change the value of money you have. Then you can rescan for the new value. You do this over and over until there is only one address left.
After you play the game's introduction level you will be able to purchase things from the gun store. Like I said before my player only has 100.
Now within cheatengine you need to scan for this value. You can assume that most games are going to store the money as an integer, specifically a 4 byte integer. Sometimes they dont but most of the time games store it that way.
After typing in 100 and clicking “first scan” Cheat Engine will scan the games memory for that value. Any address holding that value will be returned back to you. As shown in the image below there are lots of addresses 86,201 to be exact. To get the money value you will need to narrow it down a little more.
To narrow the list down, go to the shop and buy something. Then you can run another scan searching for the new value.
After buying the sniper ammo my player money value is set to 98. Go back to Cheat Engine and search for the new value.
As you can see from the image above there is only one address left. Changing this address should change the amount of money your player has within the game.
First you need to double click the address to add it to the cheats table. After that you can double click on the “value” column to open up a window that will allow you to modify this value. As shown in the image above I changed it to 1000 which should change the amount of money I have within the game.
As you can see in the image above I now have 1000 instead of 100. All we had to do is find where in memory the game was storing the players money value and change it.
There is an issue , if you exit the game and restart it the address the game uses to store your money value changes. If you want to find a permanent address to use even after you close the game you need to trace back the pointers until you find one that's linked to the games base address.
Tracing back pointers can be a tedious process. With large things things can get complicated very quickly. You might have something like this:
You could manually trace each one back but I typically just let Cheat Engine do all the heavy lifting for me. To do this you can do a pointer scan.
First you need to load up the game and find the money address and add it to the cheat table. Next generate a pointer map and do a pointer scan for the money value. This will generate a bunch of possible pointers for your money address. Most will be false positives. So you will need to shutdown the game and do the same process one more time or two if needed. Finally you can compare the pointer scans to see which addresses overlap. If you are lucky you will find a few you can use. This will allow you to use the same address to change the money value even if you restart the game.
First generate a pointer map by right clicking the health address in the cheat table . Then give the pointermap and name and wait for it to finish as shown in the image below.
After that is done you need to do a pointer scan for your address. However, you need one more thing, you need the final offset to your money address. I said earlier the game might look like inventory -> money . You need the offset to money. To do this within cheat engine right click and press what accesses this address.
Then spend some money and see what game game is accessing the money address. You should see a few things appear as shown in the image below.
As you can see it is using rcx+78 to get to the money address. So we can assume our offset is 78. Now that we have that we can continue with the pointer scan. Right click the address again and do a pointer scan for this address.
You will want to select the previously saved pointermap. Also make sure to select “pointers must end with specific offsets” and put in the value we found earlier.
Once the scan ends you will see a lot of possible addresses we can use . You only want ones that start with “Cyberpunk2077.exe” as we can always determine the base address of that.
Since there are so many options you will want to generate another pointermap scan and do another pointer scan. Then you can narrow down the results by finding addresses that work for both scans .
After running the final scan we are left with 36 possible addresses we can use. You will want to use these addresses and offsets for the future. Even if the game has to relied these addresses should always point to the money address.
Now if you were to share this money address with other people or your friends it will work on their game as well. You can also use this address to make your own trainer in C++. That way you don't have to use Cheat Engine all the time.Thats normally how custom cheats are made.
We could use cheat engine for everything but we are more advanced than that. The next step is to create our own cheat AKA trainer. Once we have the correct address and offsets doing this is easy. We just have to attach our programto the games process and write to the address we found earlier.
#include <windows.h>
#include <tlhelp32.h>
#include <psapi.h>
#include <iostream>
#include <vector>
#include <string>
// Helper to get process ID by name
DWORD GetProcessIdByName(const std::wstring& processName) {
DWORD pid = 0;
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32W entry = { sizeof(PROCESSENTRY32W) };
if (Process32FirstW(snapshot, &entry)) {
do {
if (_wcsicmp(entry.szExeFile, processName.c_str()) == 0) {
pid = entry.th32ProcessID;
break;
}
} while (Process32NextW(snapshot, &entry));
}
CloseHandle(snapshot);
return pid;
}
// Helper to get module base address
uintptr_t GetModuleBaseAddress(DWORD pid, const std::wstring& moduleName) {
HANDLE hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
MODULEENTRY32W me32 = { sizeof(MODULEENTRY32W) };
uintptr_t baseAddress = 0;
if (Module32FirstW(hModuleSnap, &me32)) {
do {
if (_wcsicmp(me32.szModule, moduleName.c_str()) == 0) {
baseAddress = (uintptr_t)me32.modBaseAddr;
break;
}
} while (Module32NextW(hModuleSnap, &me32));
}
CloseHandle(hModuleSnap);
return baseAddress;
}
int main() {
std::wstring processName = L"Cyberpunk2077.exe";
DWORD pid = GetProcessIdByName(processName);
if (pid == 0) {
std::cerr << "Process not found.\n";
return 1;
}
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if (!hProcess) {
std::cerr << "Failed to open process.\n";
return 1;
}
uintptr_t baseAddress = GetModuleBaseAddress(pid, processName);
uintptr_t address = baseAddress + 0x04848668;
// Offsets from XML
std::vector<uintptr_t> offsets = { 0x1B0, 0x128, 0x0, 0x0, 0x120, 0x8, 0x78 };
// Resolve pointer chain
for (size_t i = 0; i < offsets.size(); ++i) {
ReadProcessMemory(hProcess, (LPCVOID)address, &address, sizeof(address), nullptr);
address += offsets[i];
}
int money = 0;
if (!ReadProcessMemory(hProcess, (LPCVOID)address, &money, sizeof(money), nullptr)) {
std::cerr << "Failed to read memory.\n";
CloseHandle(hProcess);
return 1;
}
std::cout << "Current money: " << money << "\n";
std::cout << "Enter new money value: ";
std::cin >> money;
if (!WriteProcessMemory(hProcess, (LPVOID)address, &money, sizeof(money), nullptr)) {
std::cerr << "Failed to write memory.\n";
CloseHandle(hProcess);
return 1;
}
std::cout << "Money updated successfully!\n";
CloseHandle(hProcess);
return 0;
}
I wont worry about explaining the code to much as its fairly simple. I encourage you to read it though so you know whats going on. If you ever want to make your own custom cheats it typically starts off like this.
As you can see from the image above, running the program will read the games memory to find the value of our money. Next it will ask for a new value which writes to the money address. Note we are not using cheat engine for this we do all of this with our own custom c++ program
As you can see we were able to write to the games memory changing our players money to 2,000.
Game hacking seems more complicated than it is. As shown in this blog we were able to hack a popular game cyberpunk 2077 giving us unlimited money. We can use a cheat engine to find the money address by scanning the games memory. However, if we restart the game that address changes. To handle that we do pointer scanning which locates an address associated with the base address and a series of pointers. Even if the game closes we can use this address and offsets to refind the money address. Finally , taking this a little more advanced we coded our own external trainer in C++. This program can read and write to the money address without relying on cheat engine.