Skip to content

Conversation

Tobi-Mob
Copy link

  • Create doorstop.log file
  • Print managed UnhandledException instead of silently crashing.

I had the problem that the game silently crashed if I invoked it with Doorstop.
These changes here may help the next poor soul with stripped System.IO.File.WriteAllText(string,string) from mscorlib.
The console output of run.sh looked like this:

Found UnityPlayer, hooking into it instead
Set current directory to /home/tobi/.steam/debian-installation/steamapps/common/Skul
Found path: /home/tobi/.steam/debian-installation/steamapps/common/Skul/Skul.x86_64
Loading in SingleInstance mode

Process finished with exit code 1.

Problem 1: Seems like unity hijacks stdout
Solution 1: Create a log file

Problem 2: r_mono_runtime_invoke crashes without any message
Solution 2: log any exception returned by r_mono_runtime_invoke

Now my run.sh output looks like this:

[Doorstop] creating logfile 'doorstop.log'
[Doorstop] Found UnityPlayer, hooking into it instead
Set current directory to /home/tobi/.steam/debian-installation/steamapps/common/Skul
Found path: /home/tobi/.steam/debian-installation/steamapps/common/Skul/Skul.x86_64
Loading in SingleInstance mode

Process finished with exit code 1.

And a doorstep.log is created which looks like this:

[Doorstop] Found UnityPlayer, hooking into it instead
[Doorstop] intercepting mono_jit_init_version
[Doorstop] jit_init_hook invoked
[Doorstop] No override (or failed to find), unsetting.
[Doorstop] Setting config paths; basedir: /home/tobi/.steam/debian-installation/steamapps/common/Skul; config: /home/tobi/.steam/debian-installation/steamapps/common/Skul/Skul.x86_64.config
[Doorstop] DOORSTOP_INVOKE_DLL_PATH: /home/tobi/.steam/debian-installation/steamapps/common/Skul/BepInEx/core/net35/BepInEx.Preloader.Unity.dll
[Doorstop] Managed dir: /home/tobi/.steam/debian-installation/steamapps/common/Skul/Skul_Data/Managed
[Doorstop] Got image: 0xf3eb70 
[Doorstop] Found entrypoints in '/home/tobi/.steam/debian-installation/steamapps/common/Skul/BepInEx/core/net35/BepInEx.Preloader.Unity.dll'!
[Doorstop] Invoking entrypoint
[Doorstop] Invoking done!
[Doorstop] Exception thrown while invoking assembly entrypoint!
[Doorstop] Exception: System.MissingMethodException: void System.IO.File.WriteAllText(string,string)
  at BepInEx.Preloader.Unity.DoorstopEntrypoint.Main () [0x00001] in <ef330f1f328c417db123facb90a9293c>:0 

* Print managed UnhandledException instead of silently crashing.
#undef LOAD_METHOD
}

#define LOG(message) \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no real idea how c works.
So if anybody knows how to create a proper log-method, I am open for suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant