Skip to content

Simple tool to extract data from PDB files and serialize it to JSON for ingestion by other applications. Supports all versions of Unity.

License

Notifications You must be signed in to change notification settings

cstamford/PdbToJson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Simple tool to extract data from PDB files and serialize it to JSON for ingestion by other applications.

Usage

  • Paths are hardcoded (edit Program.cs).
  • Output is written to current working directory in the form {targetName}_{targetHashSha256}.json.
  • If you hit an access exception when trying to load a PDB, try running as an administrator.

Example (UnityPlayer.dll_16fb7780da080b5c5d8e4582b5981dc7dd5bb0afc0a85b6d04b2cfa8a0201030.json)

{
  "Target": {
    "UnityVersion": "2020.3.48f1",
    "UnityVariation": "win64_development_mono",
    "Dll": {
      "Name": "UnityPlayer.dll",
      "HashSha256": "16fb7780da080b5c5d8e4582b5981dc7dd5bb0afc0a85b6d04b2cfa8a0201030"
    },
    "Pdb": {
      "Name": "UnityPlayer_Win64_development_mono_x64.pdb",
      "HashSha256": "c87a49a5847fee26e185753e53c91c77f9df6fceb356a9f6e64ed078b1a2122f"
    }
  },
  "Data": {
    "Functions": [
      {
        "symIndexId": 1,
        "symTag": 5,
        "name": "SuiteUnitTestTestMacroskRegressionTestCategory::`dynamic initializer for 'adderMacroTestHelper2''",
        "locationType": 1,
        "addressSection": 1,
        "addressOffset": 703712,
        "relativeVirtualAddress": 707808,
        "virtualAddress": 707808,
        "length": 26,
        "lexicalParentId": 2,
        "typeId": 3,
        "undecoratedName": "static  SuiteUnitTestTestMacroskRegressionTestCategory::`dynamic initializer for 'adderMacroTestHelper2''()",
        "optimizedCodeDebugInfo": 1,
        "isStatic": 1
      },
      {
        "symIndexId": 4,
        "symTag": 5,
        "name": "SuiteHashSetkUnitTestCategory::`dynamic initializer for 'adderStringSet_EqualityOperator_ReturnsFalseForDifferentSets''",
        "locationType": 1,
        "addressSection": 1,
        "addressOffset": 324736,
        "relativeVirtualAddress": 328832,
        "virtualAddress": 328832,
        "length": 35,
        "lexicalParentId": 2,
        "typeId": 3,
        "undecoratedName": "static  SuiteHashSetkUnitTestCategory::`dynamic initializer for 'adderStringSet_EqualityOperator_ReturnsFalseForDifferentSets''()",
        "optimizedCodeDebugInfo": 1,
        "isStatic": 1
      },
      {
        "symIndexId": 5,
        "symTag": 5,
        "name": "Scripting::UnityEngine::PlayerLoop::PostLateUpdate::__ManagedRegistrationHelperFunction_UpdateLightProbeProxyVolumesProxy",
        "locationType": 1,
        "addressSection": 1,
        "addressOffset": 935296,
        "relativeVirtualAddress": 939392,
        "virtualAddress": 939392,
        "length": 42,
        "lexicalParentId": 2,
        "typeId": 3,
        "undecoratedName": "static  Scripting::UnityEngine::PlayerLoop::PostLateUpdate::__ManagedRegistrationHelperFunction_UpdateLightProbeProxyVolumesProxy()",
        "optimizedCodeDebugInfo": 1,
        "isStatic": 1
      }
    ]
  }
}

Example (stdout)

Local paths have been replaced with '...'.

Loading symbols for:
    2020.3.48f1 win64_development_mono UnityPlayer_Win64_development_mono_x64.pdb
    2020.3.48f1 win64_nondevelopment_mono UnityPlayer_Win64_mono_x64.pdb

[2020.3.48f1 win64_development_mono] Loaded 24170 functions
[2020.3.48f1 win64_nondevelopment_mono] Loaded 12388 functions

Saving to: C:\...\PdbToJson\bin\x64\Debug\net9.0

[2020.3.48f1 win64_development_mono] Saved to: C:\...\UnityPlayer.dll_16fb7780da080b5c5d8e4582b5981dc7dd5bb0afc0a85b6d04b2cfa8a0201030.json
[2020.3.48f1 win64_nondevelopment_mono] Saved to: C:\...\UnityPlayer.dll_62786941efd9b40eb6e1a27c96df8024bde9f8bdf979d826e6ec769534cd8e06.json

About

Simple tool to extract data from PDB files and serialize it to JSON for ingestion by other applications. Supports all versions of Unity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages