Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to download Unity base libraries when PC name has multibyte character #407

Open
akintos opened this issue Apr 30, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@akintos
Copy link

akintos commented Apr 30, 2022

What happened?

BepInEx fails to download Unity base libraries when PC name has multibyte character

Steps to reproduce

  1. Set your PC name with some non-ascii text
  2. Try to initialize BepInEx with an IL2CPP game
  3. Game instantly crashes

BepInEx Distribution

Bleeding Edge from BepisBuilds

Log outputs

[Message: Preloader] BepInEx 6.0.0-be.559 - WL3
[Message: Preloader] BLEEDING EDGE Build #559 from fba4461f0e4cac377b88b4c3eee3a56254dec5a7 at master
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   : Preloader] Running under Unity v2019.4.4
[Message: Preloader] Downloading unity base libraries
[Fatal  :Unhollower] Failed to generate unhollowed assemblies: System.ArgumentException: Illegal byte sequence encounted in the input.
Parameter name: string
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_string_from_byvalstr(intptr,int)
  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStructure(intptr,System.Type)
  at System.Runtime.InteropServices.Marshal.PtrToStructure[T] (System.IntPtr ptr) [0x00000] in <986ed57b9a8f4699a3c59a69eb05944a>:0
  at System.Net.NetworkInformation.Win32NetworkInterface.get_FixedInfo () [0x00024] in <0cb84a912f9e474b9778c5c9aac20660>:0
  at System.Net.NetworkInformation.Win32IPGlobalProperties.get_DomainName () [0x00000] in <0cb84a912f9e474b9778c5c9aac20660>:0
  at System.Net.CookieContainer..ctor () [0x0003f] in <0cb84a912f9e474b9778c5c9aac20660>:0
  at System.Net.Http.MonoWebRequestHandler.get_CookieContainer () [0x0000a] in <4535ed4534f04d0994ac41b63161cc92>:0
  at System.Net.Http.MonoWebRequestHandler.CreateWebRequest (System.Net.Http.HttpRequestMessage request) [0x000f5] in <4535ed4534f04d0994ac41b63161cc92>:0
  at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0003e] in <4535ed4534f04d0994ac41b63161cc92>:0
  at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x000e8] in <4535ed4534f04d0994ac41b63161cc92>:0
  at System.Net.Http.HttpClient.GetStreamAsync (System.String requestUri) [0x0007d] in <4535ed4534f04d0994ac41b63161cc92>:0
  at BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainRunner.GenerateAssembliesInternal (BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainListener listener, System.String unityVersion, BepInEx.IL2CPP.ProxyAssemblyGenerator+IL2CPPDumperType dumperType) [0x00080] in <6d53a7ce7a0f41b6b0607be7a5dab661>:0
  at BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainRunner.GenerateAssemblies (BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainListener listener, System.String unityVersion, BepInEx.IL2CPP.ProxyAssemblyGenerator+IL2CPPDumperType dumperType) [0x00000] in <6d53a7ce7a0f41b6b0607be7a5dab661>:0

Environment

- OS: Windows 10 x64
- BepInEx: BepInEx 6.0.0-be.559
- Game: Wasteland 3 (IL2CPP, v2019.4.4)
@akintos akintos added the bug Something isn't working label Apr 30, 2022
@bb010g
Copy link
Collaborator

bb010g commented May 1, 2022

What system locale are you using, and does it have UTF-8 enabled?

@akintos
Copy link
Author

akintos commented May 1, 2022

The system is using EUC-KR (cp949) and UTF-8 is not enabled.

I can avoid the issue by changing the computer name into something else but this one is very hard to diagnose and confusing for new users. (BepInEx fails to initialize and does not leave any log file. You have to enable and capture the console window before it disappears.)

I know that the root of this issue lies in the Mono runtime but we may able to avoid it by using another method to download base libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants