Python program to analyze Blockland memory dumps (MDMP) including TraceBuddy traces

Queuenard 3eb63587e9 Initial commit 3 months ago
README.md 3eb63587e9 Initial commit 3 months ago
dump-examine.py 3eb63587e9 Initial commit 3 months ago

README.md

This Python program can analyze Blockland memory dumps (MDMP) and is also able to print TraceBuddy traces in that same memory dump. Memory dumps (on Windows) are created by using Task Manager and right-clicking on the relevant process and clicking "Create memory dump file".

Much of the memory layout is known or derived from other projects, particularly libBLstructs, so many of the same techniques and layouts will appear here as they do there.

Make sure to use a recent version of TraceBuddy (>= 2.1.0, November 2023) or use --help-offsets to work with memory dumps with older versions of TraceBuddy. TraceBuddy now prints the location of its trace_lines std::list in console.log; read the console.log for the offset if the default 0x100034 does not work.

Classes for which positions are printed are defined in dump-examine.py near the top: classes_interest = ['fxDTSBrick', 'AIPlayer', 'Player', 'WheeledVehicle', 'FlyingVehicle', 'HoverVehicle']

Dump every object in game and print TraceBuddy lines: python3 dump-examine.py dumps/Blockland.DMP --analyze-objects --print-tracebuddy

Example output:

Reading pointer at 0x68280034
trace_lines std::list starts at 0x08be5ed8
Located first element

Leaving [NewDuplicator_Server_Final]serverCmdplantBrick() - return 22319
Entering [NewDuplicator_Server]serverCmdshiftBrick("15628", "0", "0", "3")
        Entering ServerCmdShiftBrick("15628", "0", "0", "3")
                Entering shift("15635", "0", "-0", "0.6")
                Leaving shift() - return 
        Leaving ServerCmdShiftBrick() - return 
Leaving [NewDuplicator_Server]serverCmdshiftBrick() - return 
Entering [NewDuplicator_Server_Final]serverCmdplantBrick("15628")

...

Leaving GameConnection::onDrop() - return 

Found 12501 lines of data for trace_lines in TraceBuddy
Object 0x01446000
        id: 22753
     class: fxDTSBrick
       pos: 276.0 105.5 310.5

Object 0x01446400
        id: 22754
     class: fxDTSBrick
       pos: 276.0 105.5 311.1000061035156

Object 0x01446800
        id: 22755
     class: fxDTSBrick
       pos: 276.0 105.5 311.70001220703125

--help-offsets output for reference:

Note: TraceBuddy versions 2.1.0 and above print the direct address near top of console.log so you can use --tbd
TraceBuddy.dll version 2.1.0
    md5sum: 990c6bc179524f2ba88c50bcd662fb62
    released: November 6, 2023
    offset: 0x100034

TraceBuddy.dll version 2.0.0
    md5sum: ed71583537dc6077f97500e897aa0ed9
    released: October 28, 2023
    offset: 0x100034

TraceBuddy.dll (Buddy's private version)
    md5sum: 2b41150e2a549d2053ad5db432f3b79f
    offset: 0xFB034

TraceBuddy.dll version 1.0.1
    md5sum: 03885bed372f753795b77e9b40da930d
    released: March 6, 2022
    offset: 0xC400C

TraceBuddy.dll version 1.0.0 did not use std::list.