This tool allows to dump memory to help in analyzing unknown data types. It provides an interface with CET.
- Cyberpunk 2077 v2.13
- RED4ext v1.25.1+
- Redscript 0.5.27+
- Cyber Engine Tweaks 1.33.0+
- Red Hot Tools 1.1.4+
- Install requirements:
- RED4ext v1.25.1+
- Cyber Engine Tweaks 1.33.0+
- Extract the latest archive into the Cyberpunk 2077 directory.
- track an
ISerializable
or a raw address as a target. - dump memory of target with the
Capture
button (aka a frame). - navigate between frames.
- view memory of a frame as bytes in hexadecimal form.
- hide known bytes in view memory, when already bound by RTTI properties.
- select an offset in memory and a data type to check the content (support common types of RED4engine).
- list known RTTI properties, hover/select a property to scroll to it in view memory.
- player to navigate through frames every 200 ms.
- record frames at custom rate, with start/stop button or hot key.
You'll need to configure CET to use a monospace font. You can import one of
your choice or pick from existing fonts. For example with
NotoSansMono-Regular.ttf
.
In bin/x64/plugins/cyber_engine_tweaks/
, change config.json
with:
{
// ...
"fonts": {
// ...
"path": "C:/Program Files (x86)/Steam/steamapps/common/Cyberpunk 2077/bin/x64/plugins/cyber_engine_tweaks/fonts/NotoSansMono-Regular.ttf"
// ...
}
// ...
}
Note
fonts.path
must be an absolute path to be loaded by CET.
This tool introduce MemoryDump
with two core functions:
TrackSerializable(object: ref<ISerializable>) -> ref<MemoryTarget>;
TrackAddress(name: String, type: CName, address: Uint64, opt size: Uint32) -> ref<MemoryTarget>;
It will return a MemoryTarget
which allows to dump memory in a "frame".
Note
Internally, only a weak reference is hold. When reference is disposed, a message will tell. You won't be able to dump new frames.
This tool requires a MemoryTarget
to print it in CET's overlay. You have two
possibilities to provide a target:
You can use CET's console to write commands and manually add a target. You will need to import the tool's API using:
RedMemoryDump = GetMod("RedMemoryDump")
You can then use MemoryDump
to track and add a target:
player = Game.GetPlayer()
target = MemoryDump.TrackSerializable(player)
RedMemoryDump.AddTarget(target)
-- It should be visible in section TARGETS
You can define your custom behavior in RedMemoryDump/AddCustomTarget.lua where the plugin is installed. You can react to common CET events and return a target you want to track.
You must define AddTarget
which will be triggered when you click on the
button Add target
in CET overlay, for example:
-- See file itself for more.
-- ...
AddTarget = function(context)
local player = Game.GetPlayer()
return MemoryDump.TrackSerializable(player)
end
-- ...
Tip
This is the recommended solution, DRY.
Contributions are welcome, feel free to fill an issue or a PR.
- Install requirements:
- CMake v3.27+
- Visual Studio Community 2022+
- red-cli v0.3.0+
- Configure project with:
cmake -G "Visual Studio 17 2022" -A x64 -S . -B build
- Build in debug mode:
cmake --build build --target RedMemoryDump --config Debug
- Install in your game directory:
red-cli install
- Run game.
- Open CET, you should see a "RedMemoryDump" window.
- Build in release mode:
cmake --build build --target RedMemoryDump --config Release
- Bundle release:
red-cli pack