NeighTools / UnityDoorstop

Doorstop -- run C# before Unity does!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error message unreadable (Error invoking code)

Jonyleo opened this issue · comments

I'm having problems debbuging an error message.

Info:
Game: Little witch in the woods
OS: Win 10
Visual Studio 2019 (used to build the entrypoint [release mode])

Steps to reproduce:

Using the Example entrypoint class in the README.
Placed winhttp.dll and .ini files in the game's root directory
Placed entrypoint in LWITW_Mods/net5.0/LWITW_ModLoader.dll
Changed ini file to reflect the entrypoint location.
Run the game and get this error:

(changed private information to ...)

Assembly dir: ...\Little Witch in the Woods\LWIW_Data\Managed
Opening assembly: ...\Little Witch in the Woods\LWITW_Mods\net5.0\LWITW_ModLoader.dll
Opened Assembly DLL (4096 bytes); opening its main image
Image opened; loading included assembly
Assembly loaded; looking for Doorstop.Entrypoint:Start
Invoking method 00000298F8FE6D68
Error invoking code!
Error message: 祓瑳浥䤮â¹�楆敬潎䙴畯摮硅散瑰潩㩮䌠畯摬渠瑯氠慯â�¤æ¥¦æ•¬æ¼ â�²ç�¡æ•³æ‰­ç¥¬âœ ç¥“瑳浥䤮â¹�楆敬祓瑳浥‬敖ç�²æ½©ãµDone

As you can see, that error message is pretty much unreadable.

Note: not sure if this is worth anything, but the dll is not 4096 bytes in size, it's actually 5K, let me know if that is a problem

Any help?
Thank you

Weird followup, If I leave the start function empty it no longer gives out warnings

Assembly dir: ...\Little Witch in the Woods\LWIW_Data\Managed
Opening assembly ...\Little Witch in the Woods\LWITW_Mods\net5.0\LWITW_ModLoader.dll
Opened Assembly DLL (3072 bytes); opening its main image
Image opened; loading included assembly
Assembly loaded; looking for Doorstop.Entrypoint:Start
Invoking method 0000015015F49968
Done

Fixed it, change bootstrap.c:118 from string_to_utf8 to string_to_utf16

Probably only when it's unicode, so something like

#ifdef UNICODE
utf16()...
#else
utf8()
#endif