ModdingGetting started

Analyzing Game Code

Learn how to handle obfuscation and inspect the game code using the Mac build

The Challenge: Obfuscation

Crab Game is compiled with Il2Cpp (C++ instead of C#) and obfuscated with Beebyte Obfuscator. This means:

  1. You can't easily decompile it like a normal Unity game.
  2. Type names, fields, and methods appear as random gibberish.

To mod effectively, you need two things: a way to reference code in your mod (CrabDevKit) and a way to read the code logic (Mac Build).


Part 1: Deobfuscating Your Project

To write code that references the game, you need to translate the gibberish names into readable ones. We use CrabDevKit for this.

1. Fix Type Names (Intermediary.cs)

Copy CrabDevKit's Intermediary.cs into your project. This file gives the obfuscated types global aliases.

// Instead of accessing "MonoBehaviour1PublicInamUnique", you can now use "PlayerManager"

2. Fix Fields & Methods (Extensions)

Refer to CrabDevKit's IntermediaryExtensions.cs. You can either:

  • Copy the specific extensions you need into your project.
  • Include CrabDevKit as a dependency.

Part 2: Inspecting Logic (The Mac Build)

While CrabDevKit helps you write code, it doesn't help you read the game's internal logic. For that, we use the Mac build of Crab Game, which uses Mono instead of Il2Cpp. This allows us to view the source code in tools like dnSpy.

Credits to @o7Moono7moono7Moon@o7moon From the Crab Game Modding Discord community for discovering this method.

How to Download

Open Steam Console

Paste this into your browser's URL bar and press Enter:

steam://nav/console

Download the Depot

In the Steam Console tab, paste this command:

download_depot 1782210 1782212 4682332062135883449

Locate the Files

Once the download completes, the console will show a path like: .../steamapps/content/app_1782210/depot_1782212

Navigate to that folder to find the Mac build.

Tips for Navigation in dnSpy

Even in the Mac build, names are obfuscated. However, you can now:

  • Rename types/methods in dnSpy as you figure them out.
  • Delete garbage methods generated by the obfuscator.
  • Cross-reference with Intermediary.cs to match the gibberish names to real names.

Alternative: You can download the oldest Mac version (depot_1782212, manifest 8991718405916212762) which is completely unobfuscated. However, the code is very outdated and many features will be missing.

On this page