yukieiji / UnityExplorer

An in-game UI for exploring, debugging and modifying IL2CPP and Mono Unity games.
GNU General Public License v3.0
226 stars 16 forks source link

[Bug]: UI not showing up on Gatekeeper(BepInEx 6.0.0-be.697+) #26

Closed Robocraft999 closed 2 weeks ago

Robocraft999 commented 2 weeks ago

Are you on the latest version of UnityExplorer?

Will other mods work? (Not mods that change settings, but small mods that access game objects, etc.)

Which release are you using?

BepInEx Unity IL2CPP CoreCLR

Which game did this occur on?

Gatekeeper (Unity 2021.3.18f1) The game is not modded by anybody else. As I still have to figure out to write an api for it. But I coded a simple mod which could include game code and was loaded successfully. I just don't know yet how to use it.

Describe the issue.

I assume the window of UnityExplorer should appear on its on on startup. Nevertheless even upon pressing the toggle button (F7) nothing is howing up. I also changed the Keycode in the config with no success. I tried on BepInEx 6.0.0-be.697 IL2Cpp and BepInEx 6.0.0-be.725 IL2Cpp.

Relevant log output

LogOutput.log: 
[Message: Preloader] BepInEx 6.0.0-be.725 - Gatekeeper (13.05.2024 17:15:10)
[Message: Preloader] Built from commit e1974e26fd7702c66b54c0d6879c90b988cc4920
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2021.3.18f1
[Info   :   BepInEx] Runtime version: 6.0.7
[Info   :   BepInEx] Runtime information: .NET 6.0.7
[Info   : Preloader] 0 patcher plugins loaded
[Info   : Preloader] 0 assemblies discovered
[Message:AssemblyPatcher] Executing 0 patch(es)
[Message:   BepInEx] Chainloader initialized
[Warning:Il2CppInterop] Class::Init signatures have been exhausted, using a substitute!
[Info   :Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [UnityExplorer 4.12.2]
[Message:UnityExplorer] UnityExplorer 4.12.2 initializing...
[Message:UnityExplorer] [UniverseLib] UniverseLib 1.5.7 initializing...
[Info   :Il2CppInterop] Registered mono type UniverseLib.UniversalBehaviour in il2cpp domain
[Info   :Il2CppInterop] Registered mono type UniverseLib.Runtime.Il2Cpp.Il2CppManagedEnumerator in il2cpp domain
[Message:UnityExplorer] [UniverseLib] Loaded Unhollowed modules in 0,002 seconds.
[Message:UnityExplorer] [UniverseLib] Setup deobfuscation cache in 0,1 seconds.
[Message:UnityExplorer] [UniverseLib] Finished UniverseLib initial setup.
[Info   :Il2CppInterop] Registered mono type UnityExplorer.ExplorerBehaviour in il2cpp domain
[Message:UnityExplorer] Initialized UnityCrashPrevention for: Canvas.get_renderingDisplaySize
[Info   :   BepInEx] Loading [My first plugin 1.0.0]
[Info   :My first plugin] Plugin Test2 is loaded!
[Info   :My first plugin] Things: 
[Info   :My first plugin] Plugin Test2 is loaded!
[Message:   BepInEx] Chainloader startup complete

Unity log (player.log) contains no errors and nothing like UnityExplorer or UniverseLib appears
yukieiji commented 2 weeks ago

Are you seeing any errors in the BepInEx.log?

yukieiji commented 2 weeks ago

I'am able to confirm the work with BepInEx 6.0.0.be725 in AmongUs. So it seems to be a issue with the game.

Robocraft999 commented 2 weeks ago

Are you seeing any errors in the BepInEx.log?

where do I find this?

yukieiji commented 2 weeks ago

BepInEx/LogOutput.log

Robocraft999 commented 2 weeks ago

Ah this is already appended see above

yukieiji commented 2 weeks ago

I can't find any logs regarding completion of initialization of UniverseLib etc. or creation of UI, are they all attached?

Robocraft999 commented 2 weeks ago

I mean they are attached yes. I can repost them here but I don't think this helps:

LogOutput.log: 
[Message: Preloader] BepInEx 6.0.0-be.725 - Gatekeeper (13.05.2024 17:15:10)
[Message: Preloader] Built from commit e1974e26fd7702c66b54c0d6879c90b988cc4920
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2021.3.18f1
[Info   :   BepInEx] Runtime version: 6.0.7
[Info   :   BepInEx] Runtime information: .NET 6.0.7
[Info   : Preloader] 0 patcher plugins loaded
[Info   : Preloader] 0 assemblies discovered
[Message:AssemblyPatcher] Executing 0 patch(es)
[Message:   BepInEx] Chainloader initialized
[Warning:Il2CppInterop] Class::Init signatures have been exhausted, using a substitute!
[Info   :Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [UnityExplorer 4.12.2]
[Message:UnityExplorer] UnityExplorer 4.12.2 initializing...
[Message:UnityExplorer] [UniverseLib] UniverseLib 1.5.7 initializing...
[Info   :Il2CppInterop] Registered mono type UniverseLib.UniversalBehaviour in il2cpp domain
[Info   :Il2CppInterop] Registered mono type UniverseLib.Runtime.Il2Cpp.Il2CppManagedEnumerator in il2cpp domain
[Message:UnityExplorer] [UniverseLib] Loaded Unhollowed modules in 0,002 seconds.
[Message:UnityExplorer] [UniverseLib] Setup deobfuscation cache in 0,1 seconds.
[Message:UnityExplorer] [UniverseLib] Finished UniverseLib initial setup.
[Info   :Il2CppInterop] Registered mono type UnityExplorer.ExplorerBehaviour in il2cpp domain
[Message:UnityExplorer] Initialized UnityCrashPrevention for: Canvas.get_renderingDisplaySize
[Info   :   BepInEx] Loading [My first plugin 1.0.0]
[Info   :My first plugin] Plugin Test2 is loaded!
[Info   :My first plugin] Things: 
[Info   :My first plugin] Plugin Test2 is loaded!
[Message:   BepInEx] Chainloader startup complete

Unity log (player.log) contains no errors and nothing like UnityExplorer or UniverseLib appears
yukieiji commented 2 weeks ago

When UE is started in AmongUs, the log is as follows You will see that the log shows that the initialization is complete as indicated by[Message:UnityExplorer] UnityExplorer 4.12.1 (IL2CPP) initialized.. The fact that no such indication is shown indicates that some kind of initialization has failed.

[Message: Preloader] BepInEx 6.0.0-be.725 - Among Us (2023/10/25 2:20:03)
[Message: Preloader] Built from commit e1974e26fd7702c66b54c0d6879c90b988cc4920
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 32-bit (x86)
[Info   :   BepInEx] Running under Unity 2020.3.45f1
[Info   :   BepInEx] Runtime version: 6.0.7
[Info   :   BepInEx] Runtime information: .NET 6.0.7
[Info   : Preloader] 0 patcher plugins loaded
[Info   : Preloader] 0 assemblies discovered
[Message:AssemblyPatcher] Executing 0 patch(es)
[Message:   BepInEx] Chainloader initialized
[Info   :Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[Info   :   BepInEx] 1 plugin to load
[Info   :   BepInEx] Loading [UnityExplorer 4.12.1]
[Message:UnityExplorer] UnityExplorer 4.12.1 initializing...
[Message:UnityExplorer] [UniverseLib] UniverseLib 1.5.6 initializing...
[Info   :Il2CppInterop] Registered mono type UniverseLib.UniversalBehaviour in il2cpp domain

[Info   :Il2CppInterop] Registered mono type UniverseLib.Runtime.Il2Cpp.Il2CppManagedEnumerator in il2cpp domain
[Message:UnityExplorer] [UniverseLib] Loaded Unhollowed modules in 0.003 seconds.
[Message:UnityExplorer] [UniverseLib] Setup deobfuscation cache in 0.27100003 seconds.
[Message:UnityExplorer] [UniverseLib] Finished UniverseLib initial setup.
[Info   :Il2CppInterop] Registered mono type UnityExplorer.ExplorerBehaviour in il2cpp domain
[Message:UnityExplorer] Initialized UnityCrashPrevention for: Canvas.get_renderingDisplaySize
[Message:   BepInEx] Chainloader startup complete
[Message:UnityExplorer] [UniverseLib] Initialized Legacy Input support
[Message:UnityExplorer] [UniverseLib]    IL2CPP method has no corresponding pointer, aborting patch of UnityEngine.Cursor.lockState
[Message:UnityExplorer] [UniverseLib]    IL2CPP method has no corresponding pointer, aborting patch of UnityEngine.AssetBundle.UnloadAllAssetBundles
[Info   :Il2CppInterop] Registered mono type UniverseLib.AssetBundle in il2cpp domain
[Message:UnityExplorer] [UniverseLib] Loaded modern bundle for Unity 2020.3.45f1
[Message:UnityExplorer] [UniverseLib] UniverseLib 1.5.6 initialized.
[Message:UnityExplorer] Creating UI...
[Message:UnityExplorer] UnityExplorer 4.12.1 (IL2CPP) initialized.
yukieiji commented 2 weeks ago

I made some changes in v4.12.2 regarding the initialization process around the input, so maybe it will work in v4.12.1.

Robocraft999 commented 2 weeks ago

Unfortunatly it doesn't. Same output with same missing lines of output. I tried to run it with Among us as well but BepInEx doesn't even start there.

yukieiji commented 2 weeks ago

I'm not sure why it won't start with AmongUs, but is this game running anti-cheat or something? Or maybe that's what's preventing UE from launching.

Robocraft999 commented 2 weeks ago

Among us works now. With UnityExplorer and BepInEx 6.0.0-be.725 32bit Gatekeeper doesn't start BepInEx with BepInEx 32bit version. only 64 bit. With Among us its the other way around

yukieiji commented 2 weeks ago

I understand about the AmongUs. this game running anti-cheat or something? Or maybe that's what's preventing UE from launching.

Robocraft999 commented 2 weeks ago

nothing that I know about. It's a smaller Indie game. It's a bit like Risk of Rain. This kind of games usually don't have anti cheat and don't need one in my opinion

yukieiji commented 2 weeks ago

Hmm...,Tried the solution described here and it doesn't work?

Robocraft999 commented 2 weeks ago

Hmm...,Tried the solution described here and it doesn't work?

yep both don't work. I also noticed in the Among Us plugins folder there are some files and folders generated (Logs, Scripts and data.cfg) and in the Gatekeeper plugins folder is nothing except the two dlls. So where ever it fails it doesn't even get to the part of generating these

yukieiji commented 2 weeks ago

If the directory is not created, then this process has failed. The fact that this process in C# is failing suggests that there is some kind of block process running.

Robocraft999 commented 2 weeks ago

So after further investigation (I cloned the repo and added some debug printing) it seems that this start of the Coroutine is not working. The start of the Coroutine is done by the ILL2CppProvider it returns a Coroutine and Log($"Finished UniverseLib initial setup."); is also working but the Coroutine does not get executed. On Among Us it does (I added prints in the while loop which yields until the timer is up). And yeah the creation of the directories just gets skipped. It doesn't even throw an Exception it just doesn't do it. (Path is correct)

Robocraft999 commented 2 weeks ago

I also tried to use MelonLoader and found something out: When running UE with MelonLoader with debug enabled. There is this message: [ML Core] Received Quit Request! Shutting down.... I also noticed that when running Gatekeeper with BepInEx the console closes before the game is opening (even when setting PreventClose = true). Same with MelonLoader. When I was testing Among Us with BepInEx the console stayed open. Maybe the game forces a restart or something so that the process the modloader is running with gets shut down and a new one without is started. But I also have to say that I was not modifying the main installation folder but modifying them in seperate folders

Robocraft999 commented 2 weeks ago

But I also have to say that I was not modifying the main installation folder but modifying them in seperate folders

thats it. I put it in the main folder and started through steam and now it loads with MelonLoader and BepInEx