DotNetDataCollectorEx is an extension/replacement to Cheat Engine's DotNetDataCollector, designed to work with .NET Framework 4.5+ and .NET Core 3+ / .NET 5+. It provides some additional features and in some cases more information. It also supports .NET 8+ which Cheat Engines's DotNetDataCollector does not.
DotNetDataCollectorEx uses ClrMD to collect information whereas Cheat Engine's DotNetDataCollector uses the .NET Unmanaged API
- Support for .NET Framework 4.5+ and .NET Core 3+ / .NET 5+.
- Provides, in some cases, more detailed memory analysis and additional functions compared to the legacy DotNetDataCollector.
- Works in both Replacement Mode and Extension Mode.
- Can be used dynamically via Lua to replace the legacy DotNetDataCollector.
There are two installation methods for DotNetDataCollectorEx:
- Locate your Cheat Engine installation folder.
- Rename the existing DotNetDataCollector32.exe and DotNetDataCollector64.exe to LegacyDotNetDataCollector32.exe LegacyDotNetDataCollector64.exe respectively.
- DotNetDataCollectorEx will automatically run
LegacyDotNetDataCollector.exe
for older .NET versions or Versions for which it can't find the DAC.
- Copy
DotNetDataCollectorEx32.exe
andDotNetDataCollectorEx64.exe
into Cheat Engine's installation folder and rename them toDotNetDataCollector32.exe
andDotNetDataCollector64.exe
respectively. - (OPTIONAL) Copy
DotNetDataCollectorEx.lua
into theautorun
folder. - Restart Cheat Engine.
Now, Cheat Engine will use DotNetDataCollectorEx, but will fall back to the legacy collector for older .NET versions.
- Keep the existing DotNetDataCollector.exe's in place.
- Copy
DotNetDataCollectorEx32.exe
andDotNetDataCollectorEx64.exe
into one of the folders defined in the lua script inside theprocesslocations
table.- Default Locations are:
-
- Cheat Engine installation folder
autorun
folderautorun\dlls
folder
- These can be changed inside the lua Script.
- Copy
DotNetDataCollectorEx.lua
intoCheat Engine\autorun\
. - Restart Cheat Engine.
In this mode:
- DotNetDataCollectorEx runs alongside the legacy DotNetDataCollector.
- You can dynamically replace the legacy collector later using a Lua function. For more info refer to this section
-
ReplaceLegacyDataCollector(restore)
-
A method of the object returned by
getDotNetDataCollectorEx()
. -
Replaces the legacy DotNetDataCollector with DotNetDataCollectorEx at runtime.
-
Use this function to switch to the new collector for .NET 8+ applications.
-
If you want to restore the legacy DotNetDataCollector you can call this function with
restore
beingtrue
local collectorEx = getDotNetDataCollectorEx() -- Get the new collector object
collectorEx.ReplaceLegacyDataCollector() -- Replace the old collector with the new one for .NET 8+
if (true) -- Optional reinitialize the DotNetSymbolHandler so the Disassembler shows the Names of Methods
createThread(function () -- Do it async so it doesn't block the main thread freezing Cheat Engine
reinitializeDotNetSymbolhandler()
end)
end
For maximum flexibility, it is recommended to use DotNetDataCollectorEx in Extension Mode. This mode provides the following benefits:
-
Legacy DotNetDataCollector:
- Works for .NET Framework versions older than 4.5.
- Can be used alongside DotNetDataCollectorEx in Extension Mode for .NET Framework 4.5+ applications.
-
DotNetDataCollectorEx:
- Provides more functions and detailed information compared to the legacy version.
- Supports .NET Framework 4.5+ and is the only version that supports .NET 8+.
If you want to debug .NET 8+ applications, it is recommended to call ReplaceLegacyDataCollector
to replace the legacy collector, as the legacy version does not support .NET 8+. This is important because other Cheat Engine functionality that relies on DotNetDataCollector will only work with .NET 8+ if you use the new version. These include but are not limited to:
- The
.net Info
Window - Cheat Engine's Symbol Handler
- Cheat Engine's Dissect data/structures
dotnetinterface.lua
used for example for Jitting methods.
-
Legacy DotNetDataCollector:
- Works for .NET Framework versions older than 4.5.
- Does not support .NET 8+.
-
DotNetDataCollectorEx:
- Supports .NET Framework 4.5+ and is the only version that supports .NET 8+.
- Provides, in some cases, more detailed memory analysis and additional features compared to the legacy version.
- Certain operations may incur slightly higher performance overhead compared to the legacy collector.
- Parameter Names returned by
getMethodParameters
are not the actual name of the parameter but the name of the type. This is because ClrMD does not expose those. - DotNetDataCollectorEx seems to miss some types(classes) that Cheat Engine's DotNetDataCollector finds. This is as far as I understand because ClrMD is only able to find constructed types. Though in my testing it found most types and all that where actually useful to me.
DotNetDataCollectorEx provides additional Lua functions that can be used inside Cheat Engine.
For a full list of available functions and their descriptions, refer to the Lua API Reference.
To compile DotNetDataCollectorEx from source, you will need:
- .NET 8 SDK installed on your system
- Visual Studio 2022 (or any other preferred build environment)
-
Clone the repository:
git clone https://github.com/Bloodyboneye/DotNetDataCollectorEx cd DotNetDataCollectorEx
-
Open the solution (
DotNetDataCollectorEx.sln
) in Visual Studio 2022. -
Select the desired build configuration:
- Release | x64 for
win-x64
- Debug | x64 for
win-x64-debug
- Release | x86 for
win-x86
- Debug | x86 for
win-x86-debug
- Release | x64 for
-
Publish the project:
- Open Solution Explorer, right-click the DotNetDataCollectorEx project, and select Publish.
- Choose the desired publish profile (
win-x64
,win-x86
, etc.). - Click Publish.
-
Find the compiled executable in the respective output directory (see the table below)
-
Clone the repository:
git clone https://github.com/Bloodyboneye/DotNetDataCollectorEx cd DotNetDataCollectorEx
-
Restore dependencies:
dotnet restore
-
Build and publish using the desired profile:
- Win-x64 (Release):
dotnet publish -c Release -r win-x64 --self-contained false -o bin/publish/
- Win-x64 (Debug):
dotnet publish -c Debug -r win-x64 --self-contained false -o bin/publish/debug/
- Win-x64 (Self-Contained):
dotnet publish -c Release -r win-x64 --self-contained true -o bin/publish/self-contained/
- Win-x86 (Release):
dotnet publish -c Release -r win-x86 --self-contained false -o bin/publish/
- Win-x86 (Debug):
dotnet publish -c Debug -r win-x86 --self-contained false -o bin/publish/debug/
- Win-x86 (Self-Contained):
dotnet publish -c Release -r win-x86 --self-contained true -o bin/publish/self-contained/
- Win-x64 (Release):
Publish Profile | Target Platform | Build Type | Output Directory |
---|---|---|---|
win-x64 |
x64 | Release | bin/publish/ |
win-x64-debug |
x64 | Debug | bin/publish/debug/ |
win-x64-selfcontained |
x64 | Release | bin/publish/self-contained/ |
win-x86 |
x86 | Release | bin/publish/ |
win-x86-debug |
x86 | Debug | bin/publish/debug/ |
win-x86-selfcontained |
x86 | Release | bin/publish/self-contained/ |
After publishing, the compiled executables will be named:
DotNetDataCollectorEx64.exe
for x64 buildsDotNetDataCollectorEx32.exe
for x86 builds
This project is licensed under the MIT License. See LICENSE for details.