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
  • Guide Deprecated
  • To start
  • Libraries
  • BepInEx
  • CoreLib
  • Harmony
  • Tools
  • DnSpy
  • Cpp2Il
  • Ghidra
  • UnityExplorer

Was this helpful?

Edit on GitHub
Export as PDF
  1. Archive
  2. Outdated IL2CPP Guides

Getting started with modding

PreviousOutdated IL2CPP GuidesNextHow to view game source code

Last updated 8 months ago

Was this helpful?

Guide Deprecated

This guide was made for IL2CPP version of Core Keeper and no longer applies. Please refer to:

To start

To start modding this game follow these steps. This guide assumes you know C# language and familiar with it's tools.

  1. Install Visual Studio or Jet Brains Rider IDE. Both of these will work fine, however I personally would recommend Rider as its much better if you can get it.

  2. Follow to setup your basic .NET project

  3. Install DnSpy and

  4. Make sure to use in your mod. It will make adding custom content easier

  5. If you intent to make custom blocks, enemies, etc follow

Also below you can find the list of commonly used libraries and tools.

Libraries

BepInEx

BepInEx is a plugin framework for Unity and .NET framework games. We use BepInEx to load the mods into the game.

Be sure to select the IL2CPP code examples when you're creating your mod!

CoreLib

CoreLib is a modding library made specifically for Core Keeper. It provides a lot of features that make it easier creating your mods. This includes, but not limited to:

  • Custom items, blocks, enemies, NPC, etc.

  • Adding items using JSON

  • Easier access to Rewired input system, localization

  • Custom chat commands

Harmony

Harmony is a library for patching, replacing and decorating existing classes and methods in the game. The patching is done in runtime, which means you don't have to change the existing code! We use harmony to run our code before or after game methods. This allows us to modify game behavior.

It is recommended to read through the Introduction, basics, patching and annotations chapters. Also please note that transpilers are not apllicable with Il2Cpp

Tools

DnSpy

DnSpy is a tool that allows to read .NET assemblies code with ease. Unfortunately Core Keeper is made with the IL2CPP backend. This means we can't use DnSpy itself to view the source code. However it can be useful to view assemblies generated with Cpp2Il.

Important! If you look for a dnSpy tutorial, most will tell you to look for Assembly-CSharp.dll. This is NOT the case with Core Keeper and the relevant DLLs all begin with Pug (Pug.Core, Pug.Other and PugWorldGen)

Cpp2Il

Cpp2Il is a tool that attempts to reconstruct game assemblies, such that DnSpy would be able to read them. The tool is currently WIP and does not provide full and accurate output, however it is still useful.

Ghidra

UnityExplorer

UnityExplorer is a BepInEx plugin that lets you inspect game objects and classes at the runtime. The main use for this tool is to figure out how to change something or check if your code worked correctly. It also has a C# REPL console which allows to execute code right in the game.

Link:

Download the latest IL2CPP build here:

To use it in your mods just add the to your project references

Link:

Link:

Link:

Link:

Ghidra is a free and open source reverse engineering tool developed by the National Security Agency (NSA) of the United States. This tool allows us to read the GameAssembly.dll directly. This assembly contains compiled machine game code. To make it easier to find relevant code we can add Il2Cpp metadata. To do so we can use or

Link:

Link:

https://mod.io/g/corekeeper/r/core-keeper-mod-sdk-introduction
BepInEx staring guide
setup source viewing
CoreLib
Unity project setup guide
https://docs.bepinex.dev/master/articles/user_guide/installation/index.html
https://builds.bepinex.dev/projects/bepinex_be
NuGet
https://github.com/Jrprogrammer/CoreLib
https://harmony.pardeike.net/articles/intro.html
https://github.com/dnSpy/dnSpy
https://github.com/SamboyCoding/Cpp2IL
Il2CppInspector
Il2CppDumper
https://github.com/NationalSecurityAgency/ghidra/releases
https://github.com/sinai-dev/UnityExplorer