* Parameters (in Methods or Properties) with default values will now show these default values in the Inspector, and if you don't provide any input then this default value will be used as the argument. * Removed an unnecessary update of cached members when you open a Reflection Inspector, should be a bit faster now. * When entering arguments, the name of the argument is now white instead of cyan to avoid confusion with the Type name. * A few clean ups
CppExplorer
An in-game explorer and a suite of debugging tools for IL2CPP Unity games, using MelonLoader.
Known issues
- CppExplorer may experience a
MissingMethodException
when trying to use certain UnityEngine methods. If you experience this, please open an issue and I will do my best to fix it. - Reflection may fail with certain types (eg.
Nullable<T>
, some Dictionary types, etc). Please see Il2CppAssemblyUnhollower for more details. - Scrolling with mouse wheel in the CppExplorer menu may not work on all games at the moment.
How to install
Requires MelonLoader to be installed for your game.
- Download CppExplorer.zip from Releases.
- Unzip the file into the
Mods
folder in your game's installation directory, created by MelonLoader. - Make sure it's not in a sub-folder,
CppExplorer.dll
andmcs.dll
should be directly in theMods\
folder.
How to use
- Press F7 to show or hide the menu.
- Simply browse through the scene, search for objects, etc, most of it is pretty self-explanatory.
Features
An overview of the different CppExplorer menus.
- Scene hierarchy explorer
- Search loaded assets with filters
- Traverse and manipulate GameObjects
- Generic Reflection inspector
- C# REPL Console
- Inspect-under-mouse
Scene Explorer
- A simple menu which allows you to traverse the Transform heirarchy of the scene.
- Click on a GameObject to set it as the current path, or Inspect it to send it to an Inspector Window.
Inspectors
CppExplorer has two main inspector modes: GameObject Inspector, and Reflection Inspector.
Tips:
- When in Tab View, GameObjects are denoted by a [G] prefix, and Reflection objects are denoted by a [R] prefix.
- Hold Left Shift when you click the Inspect button to force Reflection mode for GameObjects and Transforms.
GameObject Inspector
- Allows you to see the children and components on a GameObject.
- Can use some basic GameObject Controls such as translating and rotating the object, destroy it, clone it, etc.
Reflection Inspector
- The Reflection Inspector is used for all other supported objects.
- Allows you to inspect Properties, Fields and basic Methods, as well as set primitive values and evaluate primitive methods.
- Can search and filter members for the ones you are interested in.
Object Search
- You can search for an
UnityEngine.Object
with the Object Search feature. - Filter by name, type, etc.
- For GameObjects and Transforms you can filter which scene they are found in too.
C# REPL console
- A simple C# REPL console, allows you to execute a method body on the fly.
Inspect-under-mouse
- Press Shift+RMB (Right Mouse Button) while the CppExplorer menu is open to begin Inspect-Under-Mouse.
- Hover over your desired object, if you see the name appear then you can click on it to inspect it.
- Only objects with Colliders are supported.
Mouse Control
CppExplorer can force the mouse to be visible and unlocked when the menu is open, if you have enabled "Force Unlock Mouse" (Left-Alt toggle). However, you may also want to prevent the mouse clicking-through onto the game behind CppExplorer, this is possible but it requires specific patches for that game.
- For VRChat, use VRCExplorerMouseControl
- For Hellpoint, use HPExplorerMouseControl
- You can create your own plugin using one of the two plugins above as an example. Usually only a few simple Harmony patches are needed to fix the problem.
Building
If you'd like to build this yourself, everything you need (other than MelonLoader) is included with this repository, there is no need for recursive cloning etc.
- Install MelonLoader for your game.
- Open the
src\CppExplorer.csproj
file in a text editor. - Scroll down until you see the
<ItemGroup>
containing the References. - Fix all of the paths in the
..\Steam\
directory for your game (use the full path if you need to). - Open the
src\CppExplorer.sln
project and build it. - The dll is built to the
Release\
folder in the root of the repository.
Credits
Written by Sinai.
Thanks to:
- ManlyMarco for their Runtime Unity Editor, which I used for the REPL Console and the "Find instances" snippet, and the UI style.
- denikson for mcs-unity. I commented out the
SkipVisibilityExt
constructor since it was causing an exception with the Hook it attempted.