This tool allows to dump memory to help in analyzing unknown data types. It provides an interface with CET.
- Cyberpunk 2077 v2.12a
- RED4ext v1.24.3+
- Redscript 0.5.19+
- Cyber Engine Tweaks 1.32.2+
- Install requirements:
- RED4ext v1.24.3+
- Redscript 0.5.19+
- Cyber Engine Tweaks 1.32.2+
- Extract the latest archive into the Cyberpunk 2077 directory.
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 three core functions:
TrackScriptable(object: ref<IScriptable>) -> ref<MemoryTarget>;
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".
Important
It only keeps the internal pointer of the object. If reference to the object is lost, it will result in unexpected behaviors.
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:
RedMemoryModApi = GetMod("RedMemoryMod").api
You can then use MemoryDump
to track and add a target:
player = Game.GetPlayer()
target = MemoryDump.TrackScriptable(player)
RedMemoryModApi.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 AddCustomTarget
which will be triggered when you click on
the button Add custom target
in CET overlay, for example:
-- See file itself for more.
-- ...
AddCustomTarget = function(context)
local player = Game.GetPlayer()
return MemoryDump.TrackScriptable(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+
- Node JS v20.11+
- run
npm install --save-dev archiver
- run
- 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:
node install.mjs
- Run game.
- Open CET, show Game Log popup.
- Output should show tests result.
- Build in release mode:
cmake --build build --target RedMemoryDump --config Release
- Bundle release:
node bundle.mjs