2020-09-06 17:48:40 +10:00
# CppExplorer [![Version](https://img.shields.io/badge/MelonLoader-0.2.7.1-green.svg)](https://github.com/HerpDerpinstine/MelonLoader)
2020-08-22 01:02:04 +10:00
2020-08-20 18:53:56 +10:00
< p align = "center" >
2020-09-12 04:03:53 +10:00
< img align = "center" src = "icon.png" >
2020-08-20 18:53:56 +10:00
< / p >
2020-08-22 01:42:29 +10:00
< p align = "center" >
An in-game explorer and a suite of debugging tools for < a href = "https://docs.unity3d.com/Manual/IL2CPP.html" > IL2CPP< / a > Unity games, using < a href = "https://github.com/HerpDerpinstine/MelonLoader" > MelonLoader< / a > .< br > < br >
2020-08-10 19:28:10 +10:00
2020-08-22 01:42:29 +10:00
< a href = "../../releases/latest" >
< img src = "https://img.shields.io/github/release/sinai-dev/CppExplorer.svg" / >
< / a >
< img src = "https://img.shields.io/github/downloads/sinai-dev/CppExplorer/total.svg" / >
2020-09-12 02:35:41 +10:00
< / p >
< p align = "center" >
< a href = "https://github.com/sinai-dev/MonoExplorer" > Looking for a Mono version?< / a >
2020-08-22 01:42:29 +10:00
< / p >
2020-08-22 01:02:04 +10:00
2020-09-14 16:56:42 +10:00
- [Known issues ](#known-issues )
- [How to install ](#how-to-install )
- [How to use ](#how-to-use )
- [Mod Config ](#mod-config )
- [Features ](#features )
- [Mouse Control ](#mouse-control )
- [Building ](#building )
- [Credits ](#credits )
## Known issues
As of version 1.7+, CppExplorer has reached a fairly stable state for most Il2Cpp games.
* .NET 3.5 is not currently supported (Unity 5.6.1 and older), this might change in the future.
* Some methods may still fail with a `MissingMethodException` , please let me know if you experience this (with full MelonLoader log please).
* Reflection may fail with certain types, see [here ](https://github.com/knah/Il2CppAssemblyUnhollower#known-issues ) for more details.
2020-09-05 20:41:48 +10:00
* Scrolling with mouse wheel in the CppExplorer menu may not work on all games at the moment.
2020-08-07 22:24:42 +10:00
## How to install
2020-08-08 03:48:35 +10:00
Requires [MelonLoader ](https://github.com/HerpDerpinstine/MelonLoader ) to be installed for your game.
2020-08-07 22:24:42 +10:00
2020-09-12 02:30:34 +10:00
1. Download < b > CppExplorer.zip</ b > from [Releases ](https://github.com/sinai-dev/CppExplorer/releases ).
2020-08-08 05:16:55 +10:00
2. Unzip the file into the `Mods` folder in your game's installation directory, created by MelonLoader.
3. Make sure it's not in a sub-folder, `CppExplorer.dll` and `mcs.dll` should be directly in the `Mods\` folder.
2020-08-07 22:24:42 +10:00
## How to use
* Press F7 to show or hide the menu.
2020-09-10 20:47:13 +10:00
* Use the Scene Explorer or the Object Search to start Exploring, or the C# Console to test some code.
* See below for more specific details.
2020-08-07 22:24:42 +10:00
2020-09-10 20:35:41 +10:00
### Mod Config
2020-09-10 20:36:24 +10:00
There is a simple Mod Config for the CppExplorer, which is generated the first time you run it.
This config is generated to `Mods\CppExplorer\config.xml` . Edit the config while the game is closed if you wish to change it.
2020-09-10 20:35:41 +10:00
`Main_Menu_Toggle` (KeyCode)
* Sets the keybinding for the Main Menu toggle (show/hide all CppExplorer windows)
* See [this article ](https://docs.unity3d.com/ScriptReference/KeyCode.html ) for a full list of all accepted KeyCodes.
* Default: `F7`
`Default_Window_Size` (Vector2)
* Sets the default width and height for all CppExplorer windows when created.
* `x` is width, `y` is height.
* Default: `<x>550</x> <y>700</y>`
2020-09-10 20:47:13 +10:00
## Features
2020-09-21 17:48:13 +10:00
[![ ](overview.png )](https://raw.githubusercontent.com/sinai-dev/CppExplorer/master/overview.png)
2020-09-08 17:07:10 +10:00
2020-09-08 17:09:12 +10:00
< i > An overview of the different CppExplorer menus.< / i >
2020-08-30 16:49:44 +10:00
### Scene Explorer
2020-08-14 17:51:09 +10:00
2020-08-30 16:49:44 +10:00
* A simple menu which allows you to traverse the Transform heirarchy of the scene.
2020-08-30 16:51:03 +10:00
* Click on a GameObject to set it as the current path, or < b > Inspect</ b > it to send it to an Inspector Window.
2020-08-30 16:49:44 +10:00
### Inspectors
2020-08-30 16:51:03 +10:00
CppExplorer has two main inspector modes: < b > GameObject Inspector< / b > , and < b > Reflection Inspector< / b > .
2020-08-30 16:49:44 +10:00
2020-09-03 20:59:54 +10:00
< b > Tips:< / b >
* When in Tab View, GameObjects are denoted by a [G] prefix, and Reflection objects are denoted by a [R] prefix.
* Hold < b > Left Shift</ b > when you click the Inspect button to force Reflection mode for GameObjects and Transforms.
2020-08-30 16:49:44 +10:00
### 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
2020-08-14 17:51:09 +10:00
2020-08-30 16:49:44 +10:00
* 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.
2020-08-07 22:45:32 +10:00
2020-08-30 16:49:44 +10:00
### Object Search
2020-08-07 22:45:32 +10:00
2020-08-30 16:49:44 +10:00
* 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.
2020-08-07 22:45:32 +10:00
2020-09-18 18:03:17 +10:00
### C# console
2020-08-30 16:49:44 +10:00
2020-09-18 18:03:17 +10:00
* A simple C# console, allows you to execute a method body on the fly.
2020-08-30 16:49:44 +10:00
### 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.
2020-08-07 22:45:32 +10:00
2020-08-30 16:49:44 +10:00
* For VRChat, use [VRCExplorerMouseControl ](https://github.com/sinai-dev/VRCExplorerMouseControl )
* For Hellpoint, use [HPExplorerMouseControl ](https://github.com/sinai-dev/Hellpoint-Mods/tree/master/HPExplorerMouseControl/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.
2020-08-08 00:02:32 +10:00
2020-09-14 17:07:52 +10:00
For example:
```csharp
using Explorer;
using Harmony;
// ...
[HarmonyPatch(typeof(MyGame.MenuClass), nameof(MyGame.MenuClass.CursorUpdate)]
public class MenuClass_CursorUpdate
{
[HarmonyPrefix]
public static bool Prefix()
{
// prevent method running if menu open, let it run if not.
return !CppExplorer.ShowMenu;
}
}
```
2020-09-08 20:18:37 +10:00
## Building
2020-09-08 20:21:34 +10:00
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.
2020-09-08 20:18:37 +10:00
1. Install MelonLoader for your game.
2020-09-09 00:53:31 +10:00
2. Open the `src\CppExplorer.csproj` file in a text editor.
3. Scroll down until you see the `<ItemGroup>` containing the References.
4. Fix all of the paths in the `..\Steam\` directory for your game (use the full path if you need to).
5. Open the `src\CppExplorer.sln` project and build it.
6. The dll is built to the `Release\` folder in the root of the repository.
2020-09-08 20:18:37 +10:00
2020-08-08 00:02:32 +10:00
## Credits
Written by Sinai.
2020-08-09 21:50:55 +10:00
Thanks to:
* [ManlyMarco ](https://github.com/ManlyMarco ) for their [Runtime Unity Editor ](https://github.com/ManlyMarco/RuntimeUnityEditor ), which I used for the REPL Console and the "Find instances" snippet, and the UI style.
2020-09-09 00:53:31 +10:00
* [denikson ](https://github.com/denikson ) for [mcs-unity ](https://github.com/denikson/mcs-unity ). I commented out the `SkipVisibilityExt` constructor since it was causing an exception with the Hook it attempted.