Modding Wiki
  • 🏠Home
  • 🫂How to contribute
  • Playing with Mods
    • Discovering Mods
    • Installing Mods
      • On Game Clients
      • For Multiplayer
      • On Dedicated Servers
      • No Console Support
    • Troubleshooting
    • Reporting Bugs
    • Uninstalling Mods
  • Creating Mods
    • Getting Started Modding
      • Setting Up the Modding SDK
      • Testing the Example Mods
      • Viewing Console Logs
    • Modding Limitations
    • Inspecting Other Mods' Code
    • Modding Tools
      • Scripting IDE
      • Unity Explorer
      • Asset Ripper
      • NG Tools Missing Script Recovery
      • DnSpy
      • Attaching a Debugger
    • Common Concepts
      • Unique Names and IDs
    • Modding Libraries
      • CoreLib
    • Modding Examples
      • Items
        • Weapons and Tools
        • Armor
        • Food
      • Obtaining items
        • Adding Crafting Recipe
        • Adding your items to crafters
        • Adding items to Enemy loot
      • Placeables
        • Tiles
      • NPCs and Enemies
      • UI and Interactions
      • Client-Server communications
    • Inspecting Base Game Content
      • Importing Ripped Assets to your Editor
      • Inspecting Assets In-Game
      • Inspecting Game Code
    • Updating your Modding SDK
    • Releasing Mods
      • Create a mod.io Page
      • Mod Files Upload
  • Concepts
    • Important Folder Paths
    • Technologies and Tools
    • Elevated Access
  • Archive
    • General Reference
    • Outdated Unity Setup Guide
    • Outdated IL2CPP Guides
      • Getting started with modding
      • How to view game source code
      • How to setup your Unity project
      • How to install Core Keeper mono version
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Creating Mods
  2. Modding Tools

Attaching a Debugger

PreviousDnSpyNextCommon Concepts

Last updated 1 month ago

Was this helpful?

The tutorial is referenced from

  1. Download the correct version of UnityEditor from Unity Hub (You can right-click CoreKeeper.exe -> Properties to get the unity editor version number. Usually it is the same as the required version of the ModSDK).

  2. Locate the unityPlayer folder (Example: C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_player_development_mono).

  3. Backup Game Files

  4. Copy and overrite UnityPlayer.dll, WinPixEventRuntime.dll, WindowsPlayer.exe to game folder (Example: D:\Steam\steamapps\common\Core Keeper) and rename WindowsPlayer.exe to CoreKeeper.exe (overrite).

  5. Copy and overrite Managed folder (Example: C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_player_development_mono\Data\Managed) to [GameFolder]\CoreKeeper_Data (Example: D:\Steam\steamapps\common\Core Keeper\CoreKeeper_Data)

  6. Launch game by CoreKeeper.exe. (Not steam, Because I'm not sure if this will trigger steam's integrity checking mechanism.)

  7. Wait for the game to finish loading, then you can attach any debugger (Dnspy [In this way there is no need to patch Mono, because we have already converted the game from release to debug, and this is the solution without the patched mono from 2022.x version.], JetBrains Rider, Visual Studio), you can't use start and attach, because the first process that starts will automatically crash and close, and the second process is what we need for the game itself.

https://github.com/dnSpyEx/dnSpy/wiki/Debugging-Unity-Games