BepInEx icon indicating copy to clipboard operation
BepInEx copied to clipboard

Config files are not being created due to error

Open dotorino opened this issue 2 years ago • 2 comments

What happened?

I have the Steam version of the Oddworld: Soulstorm Enhanced Edition, downloaded the #576 x64 version of the IL2CPP BepInEx 6 (since that was linked and mentioned in the description of the mod I was hoping to run), and extracted it into the root folder (containing the game's .exe).

The game does not take any longer to start up than usual and no additional files are created in BepInEx's config folder. I've enabled the console and am seeing an error message. I've reinstalled the game and extracted BepInEx into its root folder again with the same result. Running the .exe with admin rights likewise produced the same result.

BepInEx Distribution

Bleeding Edge from BepisBuilds

Log outputs

[Message: Preloader] BepInEx 6.0.0-be.576 - soulstorm
[Message: Preloader] BLEEDING EDGE Build #576 from e473f08e0a85fffd818f310c783458037a079ded at master
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   : Preloader] Running under Unity v2019.4.30
[Message: Preloader] Downloading unity base libraries
[Message: Preloader] Extracting downloaded unity base libraries
[Message: Preloader] Generating Il2CppUnhollower assemblies
[Info   :    Cpp2IL] [Library] Initializing Metadata...
[Info   :    Cpp2IL] [Library] Using actual IL2CPP Metadata version 24.5
[Info   :    Cpp2IL] [Library] Initialized Metadata in 1485ms
[Info   :    Cpp2IL] [Library] Searching Binary for Required Data...
[Info   :    Cpp2IL] [Library] Got Binary codereg: 0x182312000, metareg: 0x1823159C0 in 167ms.
[Info   :    Cpp2IL] [Library] Initializing Binary...
[Fatal  :Unhollower] Failed to generate unhollowed assemblies: Cpp2IL.Core.Exceptions.LibCpp2ILInitializationException: Fatal Exception initializing LibCpp2IL! ---> System.OverflowException: Provided address, 0xFFFFFFFF00000000, was less than image base, 0x180000000
  at LibCpp2IL.PE.PE.MapVirtualAddressToRaw (System.UInt64 uiAddr) [0x00067] in <3931b12e61dc45d7b9f004b093bede05>:0
  at LibCpp2IL.Il2CppBinary.ReadClassAtVirtualAddress[T] (System.UInt64 addr) [0x00000] in <3931b12e61dc45d7b9f004b093bede05>:0
  at LibCpp2IL.Il2CppBinary.Init (System.UInt64 pCodeRegistration, System.UInt64 pMetadataRegistration) [0x0023c] in <3931b12e61dc45d7b9f004b093bede05>:0
  at LibCpp2IL.LibCpp2IlMain.Initialize (System.Byte[] binaryBytes, System.Byte[] metadataBytes, System.Int32[] unityVersion) [0x00315] in <3931b12e61dc45d7b9f004b093bede05>:0
  at LibCpp2IL.LibCpp2IlMain.LoadFromFile (System.String pePath, System.String metadataPath, System.Int32[] unityVersion) [0x0000d] in <3931b12e61dc45d7b9f004b093bede05>:0
  at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il (System.String assemblyPath, System.String metadataPath, System.Int32[] unityVersion, System.Boolean allowUserToInputAddresses) [0x00012] in <1545415996a5462e9f767adfce5c879e>:0
   --- End of inner exception stack trace ---
  at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il (System.String assemblyPath, System.String metadataPath, System.Int32[] unityVersion, System.Boolean allowUserToInputAddresses) [0x00068] in <1545415996a5462e9f767adfce5c879e>:0
  at BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainRunner.GenerateAssembliesInternal (BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainListener listener, System.String unityVersion, BepInEx.IL2CPP.ProxyAssemblyGenerator+IL2CPPDumperType dumperType) [0x00229] in <44e427081b0348d9b8b0b673f7beff5c>:0
  at BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainRunner.GenerateAssemblies (BepInEx.IL2CPP.ProxyAssemblyGenerator+AppDomainListener listener, System.String unityVersion, BepInEx.IL2CPP.ProxyAssemblyGenerator+IL2CPPDumperType dumperType) [0x00000] in <44e427081b0348d9b8b0b673f7beff5c>:0
[Fatal  : Preloader] System.TypeInitializationException: The type initializer for 'UnhollowerBaseLib.Runtime.UnityVersionHandler' threw an exception. ---> System.TypeLoadException: Could not load type of field 'UnhollowerRuntimeLib.DelegateSupport+<>c:<>9__7_0' (2) due to: Could not load file or assembly 'Il2Cppmscorlib, Version=3.7.1.6, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at (wrapper managed-to-native) System.RuntimeTypeHandle.type_is_assignable_from(System.Type,System.Type)
  at System.RuntimeTypeHandle.CanCastTo (System.RuntimeType type, System.RuntimeType target) [0x00000] in <986ed57b9a8f4699a3c59a69eb05944a>:0
  at System.RuntimeType.IsAssignableFrom (System.Type c) [0x00020] in <986ed57b9a8f4699a3c59a69eb05944a>:0
  at UnhollowerBaseLib.Runtime.UnityVersionHandler+<>c__DisplayClass19_1.<.cctor>b__2 (System.Type i) [0x00000] in <e00b54b0593445e4abdce314024df595>:0
  at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0002c] in <c8122f496f05432baca55ffb7d139a58>:0
  at UnhollowerBaseLib.Runtime.UnityVersionHandler+<>c__DisplayClass19_0.<.cctor>b__1 (System.Type t) [0x0001a] in <e00b54b0593445e4abdce314024df595>:0
  at System.Linq.Enumerable+WhereArrayIterator`1[TSource].MoveNext () [0x0002c] in <c8122f496f05432baca55ffb7d139a58>:0
  at UnhollowerBaseLib.Runtime.UnityVersionHandler..cctor () [0x0014c] in <e00b54b0593445e4abdce314024df595>:0
   --- End of inner exception stack trace ---
  at BepInEx.IL2CPP.Preloader.Run () [0x0017e] in <44e427081b0348d9b8b0b673f7beff5c>:0
Setting breakpad minidump AppID = 619390
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561198020568137 [API loaded no]

Environment

- OS: Windows 10 Pro
- BepInEx: 6.0.0.576
- Game: Oddworld: Soulstorm

dotorino avatar Aug 11 '22 22:08 dotorino

Greetings!

The issue seems to be related to cpp2il which is a separate tool used to generate files needed to modify the game. I would suggest to first try to see if you can replicate the issue manually:

  1. Download latest release of Cpp2IL, rename it to cpp2il and put into the game folder
  2. Open a command line prompt in the game folder (Shift + Right click in game folder -> Open command line here (or Open Powershell here)
  3. Run cpp2il --exe-name soulstorm --just-give-me-dlls-asap-dammit
  4. Observe the output, making sure no crashing occurs

Overall I'd maybe report this to Cpp2IL issue tracker since error happens at Cpp2IL execution time

ghorsington avatar Aug 21 '22 08:08 ghorsington

Hey! Thank you for your response. Once I found the time I sat back down for this and followed the instructions. I had to add "." in front of "cpp2il" before it ran. I attached the output.

I'm not sure if this is already what was being asked after but the error said to add the game path, which I did after some trying around (after changing its name since I did not get around the issue with the space between "Oddworld" and "Soulstorm" in the path name). I've attached the second result below the first.

===Cpp2IL by Samboy063===
A Tool to Reverse Unity's "il2cpp" Build Process.

[Info] [Program] Running on Win32NT
Cpp2IL 2022.0.5.0
Copyright c Samboy063 2019-2022

ERROR(S):
  Required option 'game-path' is missing.

  --game-path                                    Required. Specify path to the game folder (containing the exe)

  --exe-name                                     Specify an override for the unity executable name in case the auto-detection doesn't work.

  --analysis-level                               Specify a detail level for analysis. 0 prints everything and is the default. 1 omits the ASM, but still prints textual analysis, pseudocode, and IL. 2
                                                 omits ASM and textual analysis, but prints pseudocode and IL. 3 only prints IL. 4 only prints pseudocode.

  --skip-analysis                                Skip the analysis section and stop once DummyDLLs have been generated.

  --skip-metadata-txts                           Skip the generation of [classname]_metadata.txt files.

  --disable-registration-prompts                 Disable the prompt if Code or Metadata Registration function addresses cannot be located.

  --force-binary-path                            Force the path to the il2cpp binary. Don't use unless you know what you're doing, and use in conjunction with the other force options.

  --force-metadata-path                          Force the path to the il2cpp metadata file. Don't use unless you know what you're doing, and use in conjunction with the other force options.

  --force-unity-version                          Override the unity version detection. Don't use unless you know what you're doing, and use in conjunction with the other force options.

  --verbose                                      Enable Verbose Logging.

  --experimental-enable-il-to-assembly-please    Attempt to emit IL to the assembly saved to the output directory.

  --suppress-attributes                          Suppress generation of Cpp2ILInjected attributes.

  --run-analysis-for-assembly                    Specify the name of the assembly (without .dll) to run analysis for.

  --parallel                                     Run analysis in parallel. Might break things.

  --output-root                                  Root directory to output to. Defaults to cpp2il_out in the current working directory.

  --throw-safety-out-the-window                  Throw safety out the window, and try and push all the IL we can to the DLL, *even if it might break things*. Only has an effect if IL-to-file is enabled.

  --analyze-all                                  Analyze every single assembly in the application. Probably very slow, might break.

  --skip-method-dumps                            Disable method dump files.

  --just-give-me-dlls-asap-dammit                Shorthand for --parallel --skip-method-dumps --experimental-enable-il-to-assembly-please --throw-safety-out-the-window --skip-metadata-txts

  --simple-attribute-restoration                 Don't use analysis to restore attributes, meaning any attributes with constructor parameters won't be recovered. Has no effect on metadata v29+

  --wasm-framework-file                          Path to the wasm *.framework.js file. Only needed if your binary is a WASM file. If provided, it can be used to remap obfuscated dynCall function names in
                                                 order to correct method pointers.

  --help                                         Display this help screen.

  --version                                      Display version information.

[Fail] [Program] Execution Failed: Failed to parse command line arguments
===Cpp2IL by Samboy063===
A Tool to Reverse Unity's "il2cpp" Build Process.

[Info] [Program] Running on Win32NT
[Info] [Program] Determined game's unity version to be 2019.4.30
[Warn] [Program] !!!!!!!!!!You have enabled IL-To-ASM. If this breaks, it breaks.!!!!!!!!!!
[Fail] [Program] !!!!!!!!!!Throwing safety out the window, as you requested! Forget "If this breaks, it breaks", this probably WILL break!!!!!!!!!!
[Info] [Library] Initializing Metadata...
[Info] [Library]        Using actual IL2CPP Metadata version 24,5
[Info] [Library] Initialized Metadata in 618ms
[Info] [Library] Searching Binary for Required Data...
[Info] [Library] Got Binary codereg: 0x182312000, metareg: 0x1823159C0 in 183ms.
[Info] [Library] Initializing Binary...
[Fail] [Program]

Cpp2IL.Core.Exceptions.LibCpp2ILInitializationException: Fatal Exception initializing LibCpp2IL!
 ---> System.OverflowException: Provided address, 0xFFFFFFFF00000000, was less than image base, 0x180000000
   at LibCpp2IL.PE.PE.MapVirtualAddressToRaw(UInt64 uiAddr)
   at LibCpp2IL.Il2CppBinary.Init(UInt64 pCodeRegistration, UInt64 pMetadataRegistration)
   at LibCpp2IL.LibCpp2IlMain.Initialize(Byte[] binaryBytes, Byte[] metadataBytes, Int32[] unityVersion)
   at LibCpp2IL.LibCpp2IlMain.LoadFromFile(String pePath, String metadataPath, Int32[] unityVersion)
   at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, Int32[] unityVersion, Boolean allowUserToInputAddresses)
   --- End of inner exception stack trace ---
   at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, Int32[] unityVersion, Boolean allowUserToInputAddresses)
   at Cpp2IL.Program.MainWithArgs(Cpp2IlRuntimeArgs runtimeArgs)
   at Cpp2IL.Program.Main(String[] args)

Waiting for you to press enter - feel free to copy the error...

dotorino avatar Sep 12 '22 12:09 dotorino