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

Process GameAssembly.dll and global.metadata.dll from runtime #611

Closed
wants to merge 8 commits into from

Conversation

krulci
Copy link

@krulci krulci commented May 10, 2023

Description

Implemented Il2CppDumper version 6.7.40
Implemented PrincessDumper
Added Public IL2CPPInteropAssemblyPath For XUnity.AutoTranslator.
Added UseApplicationDataPath.

Motivation and Context

PrincessDumper will retrieve GameAssembly.dll from current process handle.
PrincessDumper will fix all sections so it can be processed by Il2CppDumper.
PrincessDumper will also extract global-metadata.dat from current process handle.
This feature is for games with global-metadata.dat embedded in GameAssembly.dll.
Applied CheckIfGenerationRequired() before PrincessDumper's execution.
Uses Il2CppDumper to process List<Mono.Cecil.AssemblyDefinition> since Cpp2IL is incompetent with memory dumped file.
IL2CPPInteropAssemblyPath was added for XUnity.AutoTranslator. (Plan to migrateXUnity.AutoTranslator from Unhollower to Il2CppInterop.)
UseApplicationDataPath was added to reduce the need of initilization toolchain rerun for environment where BepInEx is removed upon exit.

How Has This Been Tested?

Tested with PrincessConnectReDive (JP)
Chainloader startup complete
Tested with Umamusume (JP)

[Error  :InteropManager] Failed to generate Il2Cpp interop assemblies: System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Il2CppInterop.Generator.Passes.Pass80UnstripMethods.GetOrCreateProperty(MethodDefinition unityMethod, MethodDefinition newMethod) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Passes/Pass80UnstripMethods.cs:line 132
   at Il2CppInterop.Generator.Passes.Pass80UnstripMethods.DoPass(RewriteGlobalContext context) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Passes/Pass80UnstripMethods.cs:line 110
   at Il2CppInterop.Generator.Runners.InteropAssemblyGeneratorRunner.Run(GeneratorOptions options) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Runners/InteropAssemblyGenerator.cs:line 173
   at Il2CppInterop.Generator.Il2CppInteropGenerator.Start() in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Il2CppInteropGenerator.cs:line 30
   at Il2CppInterop.Generator.Il2CppInteropGenerator.Run() in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Il2CppInteropGenerator.cs:line 47
   at BepInEx.Unity.IL2CPP.Il2CppInteropManager.RunIl2CppInteropGenerator(List`1 sourceAssemblies) in C:\Users\_\source\repos\BepInEx\Runtimes\Unity\BepInEx.Unity.IL2CPP\Il2CppInteropManager.cs:line 429
   at BepInEx.Unity.IL2CPP.Il2CppInteropManager.GenerateInteropAssembliesFromIl2CppDumper(List`1 cecilAssemblies) in C:\Users\_\source\repos\BepInEx\Runtimes\Unity\BepInEx.Unity.IL2CPP\Il2CppInteropManager.cs:line 322

Umamusume (JP) will result at this error, but can be fixed with my Il2CppInterop's pull request Implemented TypeComparer For GetOrCreateProperty When There Are More … #91

Screenshots (if appropriate):

image
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Member

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

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

The fix looks fine to me but adding two submodules seems excessive, especially PrincessDumper since it's basically a single class. Someone actively working with the 6.x branch will have to chime in on the rest since I'm not familiar with the IL2Cpp part.

@KAPTOHKA
Copy link

KAPTOHKA commented Jul 27, 2023

I am not a programmer, I can only use and configure the software a little...
On the latest versions, including this one, I get stuck on this:

[Message: Preloader] BepInEx 6.0.0-be.672 - GAME
[Message: Preloader] Built from commit 472e950179f4a5ab2e4a89f26dba793795fb6811
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2021.3.25f1
[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 [XUnity Auto Translator 5.2.0]
[Error  :   BepInEx] Error loading [XUnity Auto Translator 5.2.0]: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.MissingMethodException: Method not found: 'System.String BepInEx.Unity.IL2CPP.Preloader.get_IL2CPPInteropAssemblyPath()'.
   at XUnity.AutoTranslator.Plugin.BepInEx.AutoTranslatorPlugin..ctor()
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
   --- End of inner exception stack trace ---
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type)
   at BepInEx.Unity.IL2CPP.IL2CPPChainloader.LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 129
   at BepInEx.Bootstrap.BaseChainloader`1.LoadPlugins(IList`1 plugins) in /home/runner/work/BepInEx/BepInEx/BepInEx.Core/Bootstrap/BaseChainloader.cs:line 411
[Info   :   BepInEx] Loading [XUnity Resource Redirector 2.0.0]
[Message:   BepInEx] Chainloader startup complete
[Message: Preloader] BepInEx 6.0.0-be.672 - GAMA_2
[Message: Preloader] Built from commit 472e950179f4a5ab2e4a89f26dba793795fb6811
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2020.3.8f1
[Info   :   BepInEx] Runtime version: 6.0.7
[Info   :   BepInEx] Runtime information: .NET 6.0.7
[Message:InteropManager] Downloading unity base libraries
[Message:InteropManager] Extracting downloaded unity base libraries
[Message:InteropManager] Running Cpp2IL to generate dummy assemblies
[Info   :    Cpp2IL] [Library] Initializing Metadata...
[Info   :    Cpp2IL] [Library] Using actual IL2CPP Metadata version 27,1
[Info   :    Cpp2IL] [Library] Initialized Metadata in 98ms
[Info   :    Cpp2IL] [Library] Using binary type Portable Executable (from LibCpp2IL)
[Info   :    Cpp2IL] [Library] Searching Binary for Required Data...
[Info   :    Cpp2IL] [Library] Got Binary codereg: 0x1811BC1E0, metareg: 0x1811BD660 in 116ms.
[Info   :    Cpp2IL] [Library] Initializing Binary...
[Info   :    Cpp2IL] [Library] Initialized Binary in 70ms
[Info   :    Cpp2IL] [Library] Mapping pointers to Il2CppMethodDefinitions...
[Info   :    Cpp2IL] [Library] Processed 43141 OK (48ms)
[Info   :    Cpp2IL] [Program] Creating application model...
[Info   :    Cpp2IL] [Program] Application model created in 625,9036ms
[Info   :InteropManager] Cpp2IL finished in 00:00:03.1659169
[Info   :InteropManager] Generating interop assemblies
[Info   :Il2CppInteropGen] Reading assemblies...
[Info   :Il2CppInteropGen] Done in 00:00:00.0541552
[Info   :Il2CppInteropGen] Reading unity assemblies...
[Info   :Il2CppInteropGen] Done in 00:00:00.0121971
[Info   :Il2CppInteropGen] Creating rewrite assemblies...
[Info   :Il2CppInteropGen] Done in 00:00:00.0095924
[Info   :Il2CppInteropGen] Computing renames...
[Info   :Il2CppInteropGen] Done in 00:00:00.0357395
[Info   :Il2CppInteropGen] Creating typedefs...
[Info   :Il2CppInteropGen] Done in 00:00:00.0331188
[Info   :Il2CppInteropGen] Computing struct blittability...
[Info   :Il2CppInteropGen] Done in 00:00:00.0318859
[Info   :Il2CppInteropGen] Filling typedefs...
[Info   :Il2CppInteropGen] Done in 00:00:00.0141674
[Info   :Il2CppInteropGen] Filling generic constraints...
[Info   :Il2CppInteropGen] Done in 00:00:00.0050883
[Info   :Il2CppInteropGen] Creating members...
[Info   :Il2CppInteropGen] Done in 00:00:00.6711145
[Info   :Il2CppInteropGen] Scanning method cross-references...
[Info   :Il2CppInteropGen] Done in 00:00:00.4857104
[Info   :Il2CppInteropGen] Finalizing method declarations...
[Info   :Il2CppInteropGen] Done in 00:00:00.7964652
[Info   :Il2CppInteropGen] 1 total potentially dead methods
[Info   :Il2CppInteropGen] Filling method parameters...
[Info   :Il2CppInteropGen] Done in 00:00:00.1834706
[Info   :Il2CppInteropGen] Creating static constructors...
[Info   :Il2CppInteropGen] Done in 00:00:00.2365051
[Info   :Il2CppInteropGen] Creating value type fields...
[Info   :Il2CppInteropGen] Done in 00:00:00.0429471
[Info   :Il2CppInteropGen] Creating enums...
[Info   :Il2CppInteropGen] Done in 00:00:00.0334631
[Info   :Il2CppInteropGen] Creating IntPtr constructors...
[Info   :Il2CppInteropGen] Done in 00:00:00.0807333
[Info   :Il2CppInteropGen] Creating non-blittable struct constructors...
[Info   :Il2CppInteropGen] Done in 00:00:00.0047449
[Info   :Il2CppInteropGen] Creating generic method static constructors...
[Info   :Il2CppInteropGen] Done in 00:00:00.0323496
[Info   :Il2CppInteropGen] Creating field accessors...
[Info   :Il2CppInteropGen] Done in 00:00:00.3762291
[Info   :Il2CppInteropGen] Filling methods...
[Info   :Il2CppInteropGen] Done in 00:00:01.3604575
[Info   :Il2CppInteropGen] Generating implicit conversions...
[Info   :Il2CppInteropGen] Done in 00:00:00.0290498
[Info   :Il2CppInteropGen] Creating properties...
[Info   :Il2CppInteropGen] Done in 00:00:00.0377080
[Info   :Il2CppInteropGen] Unstripping types...
[Info   :Il2CppInteropGen] Done in 00:00:00.0460818
[Info   :Il2CppInteropGen] Unstripping fields...
[Info   :Il2CppInteropGen] Restored 772 fields
[Info   :Il2CppInteropGen] Failed to restore 22 fields
[Info   :Il2CppInteropGen] Done in 00:00:00.0129805
[Info   :Il2CppInteropGen] Unstripping methods...
[Info   :Il2CppInteropGen] Restored 16725 methods
[Info   :Il2CppInteropGen] Failed to restore 1122 methods
[Info   :Il2CppInteropGen] Done in 00:00:00.4954489
[Info   :Il2CppInteropGen] Unstripping method bodies...
[Info   :Il2CppInteropGen] IL unstrip statistics: 7620 successful, 3237 failed
[Info   :Il2CppInteropGen] Done in 00:00:00.5193133
[Info   :Il2CppInteropGen] Writing xref cache...
[Info   :Il2CppInteropGen] Done in 00:00:00.6476920
[Info   :Il2CppInteropGen] Writing assemblies...
[Info   :Il2CppInteropGen] Done in 00:00:00.4673563
[Info   :Il2CppInteropGen] Writing method pointer map...
[Info   :Il2CppInteropGen] Done in 00:00:00.0178462
[Info   :Il2CppInteropGen] Done!
[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] 2 plugins to load
[Info   :   BepInEx] Loading [XUnity Auto Translator 5.2.0]
[Error  :   BepInEx] Error loading [XUnity Auto Translator 5.2.0]: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.MissingMethodException: Method not found: 'System.String BepInEx.Unity.IL2CPP.Preloader.get_IL2CPPInteropAssemblyPath()'.
   at XUnity.AutoTranslator.Plugin.BepInEx.AutoTranslatorPlugin..ctor()
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
   --- End of inner exception stack trace ---
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type)
   at BepInEx.Unity.IL2CPP.IL2CPPChainloader.LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 129
   at BepInEx.Bootstrap.BaseChainloader`1.LoadPlugins(IList`1 plugins) in /home/runner/work/BepInEx/BepInEx/BepInEx.Core/Bootstrap/BaseChainloader.cs:line 411
[Info   :   BepInEx] Loading [XUnity Resource Redirector 2.0.0]
[Message:   BepInEx] Chainloader startup complete

The same Games + past software versions...
GAME_1 = Crash...
GAME_2 = Everything works...

[Message: Preloader] BepInEx 6.0.0-pre.1 - GAMES_2
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   : Preloader] Running under Unity v2020.3.8
[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 27,1
[Info   :    Cpp2IL] [Library] Initialized Metadata in 686ms
[Info   :    Cpp2IL] [Library] Searching Binary for Required Data...
[Info   :    Cpp2IL] [Library] Got Binary codereg: 0x1811BC1E0, metareg: 0x1811BD660 in 504ms.
[Info   :    Cpp2IL] [Library] Initializing Binary...
[Info   :    Cpp2IL] [Library] Initialized Binary in 419ms
[Info   :    Cpp2IL] [Library] Mapping pointers to Il2CppMethodDefinitions...
[Info   :    Cpp2IL] [Library] Processed 43141 OK (72ms)
[Info   :    Cpp2IL] [Program] Building assemblies...This may take some time.
[Info   :    Cpp2IL] [Program] Finished Building Assemblies in 1052ms
[Info   :    Cpp2IL] [Program] Fixing up explicit overrides. Any warnings you see here aren't errors - they usually indicate improperly stripped or obfuscated types, but this is not a big deal. This should only take a second...
[Info   :    Cpp2IL] [Program] Fixup complete (124ms)
[Info   :    Cpp2IL] Total time: 00:00:03.3469656
[Info   : Preloader] Executing Il2CppUnhollower generator
[Info   :Unhollower] Reading assemblies...
[Info   :Unhollower] Done in 00:00:00.0030964
[Info   :Unhollower] Reading system assemblies...
[Info   :Unhollower] Done in 00:00:00.0330741
[Info   :Unhollower] Reading unity assemblies...
[Info   :Unhollower] Done in 00:00:00.0229463
[Info   :Unhollower] Creating rewrite assemblies...
[Info   :Unhollower] Done in 00:00:00.0063186
[Info   :Unhollower] Computing renames...
[Info   :Unhollower] Done in 00:00:00.0148169
[Info   :Unhollower] Creating typedefs...
[Info   :Unhollower] Done in 00:00:00.0318657
[Info   :Unhollower] Computing struct blittability...
[Info   :Unhollower] Done in 00:00:00.0021191
[Info   :Unhollower] Filling typedefs...
[Info   :Unhollower] Done in 00:00:00.0081482
[Info   :Unhollower] Filling generic constraints...
[Info   :Unhollower] Done in 00:00:00.0011680
[Info   :Unhollower] Creating members...
[Info   :Unhollower] Done in 00:00:00.1563202
[Info   :Unhollower] Scanning method cross-references...
[Info   :Unhollower] Done in 00:00:00.3173916
[Info   :Unhollower] Finalizing method declarations...
[Info   :Unhollower] Done in 00:00:00.2996463
[Info   :Unhollower] 1 total potentially dead methods
[Info   :Unhollower] Filling method parameters...
[Info   :Unhollower] Done in 00:00:00.1072865
[Info   :Unhollower] Creating static constructors...
[Info   :Unhollower] Done in 00:00:00.1203776
[Info   :Unhollower] Creating value type fields...
[Info   :Unhollower] Done in 00:00:00.0316453
[Info   :Unhollower] Creating enums...
[Info   :Unhollower] Done in 00:00:00.0098382
[Info   :Unhollower] Creating IntPtr constructors...
[Info   :Unhollower] Done in 00:00:00.0094692
[Info   :Unhollower] Creating type getters...
[Info   :Unhollower] Done in 00:00:00.0247776
[Info   :Unhollower] Creating non-blittable struct constructors...
[Info   :Unhollower] Done in 00:00:00.0026087
[Info   :Unhollower] Creating generic method static constructors...
[Info   :Unhollower] Done in 00:00:00.0099429
[Info   :Unhollower] Creating field accessors...
[Info   :Unhollower] Done in 00:00:00.2504413
[Info   :Unhollower] Filling methods...
[Info   :Unhollower] Done in 00:00:00.6276162
[Info   :Unhollower] Generating implicit conversions...
[Info   :Unhollower] Done in 00:00:00.0143232
[Info   :Unhollower] Creating properties...
[Info   :Unhollower] Done in 00:00:00.0191012
[Info   :Unhollower] Unstripping types...
[Info   :Unhollower] Done in 00:00:00.0219492
[Info   :Unhollower] Unstripping fields...
[Info   :Unhollower] 
[Info   :Unhollower] 761 fields restored
[Info   :Unhollower] 33 fields failed to restore
[Info   :Unhollower] Done in 00:00:00.0154447
[Info   :Unhollower] Unstripping methods...
[Info   :Unhollower] 
[Info   :Unhollower] 16657 methods restored
[Info   :Unhollower] 1217 methods failed to restore
[Info   :Unhollower] Done in 00:00:00.4943085
[Info   :Unhollower] Unstripping method bodies...
[Info   :Unhollower] 
[Info   :Unhollower] IL unstrip statistics: 7558 successful, 3254 failed
[Info   :Unhollower] Done in 00:00:00.4350590
[Info   :Unhollower] Generating forwarded types...
[Info   :Unhollower] Done in 00:00:00.0031124
[Info   :Unhollower] Writing xref cache...
[Info   :Unhollower] Done in 00:00:00.1472251
[Info   :Unhollower] Writing assemblies...
[Info   :Unhollower] Done in 00:00:00.7079054
[Info   :Unhollower] Writing method pointer map...
[Info   :Unhollower] Done in 00:00:00.0168630
[Info   :Unhollower] Done!
[Info   : Preloader] 0 patcher plugins loaded
[Info   : Preloader] 0 assemblies discovered
[Message:AssemblyPatcher] Executing 0 patch(es)
[Message:   BepInEx] Chainloader initialized
[Info   :Unhollower] Registered mono type UnhollowerRuntimeLib.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [XUnity Auto Translator 5.2.0]
[Info   :Unhollower] Registered mono type XUnity.AutoTranslator.Plugin.Core.PluginLoader+AutoTranslatorProxyBehaviour in il2cpp domain
[Info   :   BepInEx] Loading [XUnity Resource Redirector 2.0.0]
[Message:   BepInEx] Chainloader startup complete
[Info   :XUnity.AutoTranslator] Force loading ALL proxy assemblies.
[Warning:XUnity.AutoTranslator] Could not find 'UnityEngine.WWW' in IL2CPP domain even though it could be found in the managed domain.
[Warning:XUnity.AutoTranslator] Could not find 'UnityEngine.GUI+ToolbarButtonSize' in IL2CPP domain even though it could be found in the managed domain.
[Info   :XUnity.AutoTranslator] Loaded XUnity.AutoTranslator into Unity [2020.3.8f1] game.
[Info   :Unhollower] Registered mono type XUnity.AutoTranslator.Plugin.Core.Il2CppManagedEnumerator in il2cpp domain
[Info   :XUnity.AutoTranslator] Skipping plugin scan because no plugin-specific translations has been registered.

@krulci
Copy link
Author

krulci commented Jul 27, 2023

I am not a programmer, I can only use and configure the software a little...

On the latest versions, including this one, I get stuck on this:

[Message: Preloader] BepInEx 6.0.0-be.672 - GAME

[Message: Preloader] Built from commit 472e950179f4a5ab2e4a89f26dba793795fb6811

[Info   :   BepInEx] System platform: Windows 10 64-bit

[Info   :   BepInEx] Process bitness: 64-bit (x64)

[Info   :   BepInEx] Running under Unity 2021.3.25f1

[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 [XUnity Auto Translator 5.2.0]

[Error  :   BepInEx] Error loading [XUnity Auto Translator 5.2.0]: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

 ---> System.MissingMethodException: Method not found: 'System.String BepInEx.Unity.IL2CPP.Preloader.get_IL2CPPInteropAssemblyPath()'.

   at XUnity.AutoTranslator.Plugin.BepInEx.AutoTranslatorPlugin..ctor()

   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)

   --- End of inner exception stack trace ---

   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)

   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)

   at System.Activator.CreateInstance(Type type)

   at BepInEx.Unity.IL2CPP.IL2CPPChainloader.LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 129

   at BepInEx.Bootstrap.BaseChainloader`1.LoadPlugins(IList`1 plugins) in /home/runner/work/BepInEx/BepInEx/BepInEx.Core/Bootstrap/BaseChainloader.cs:line 411

[Info   :   BepInEx] Loading [XUnity Resource Redirector 2.0.0]

[Message:   BepInEx] Chainloader startup complete

You are not using the correct build.
That branch of XUAT requires this specific branch of BepInEx.
6.7.2 has not merged this branch so is not going to work.

@KAPTOHKA
Copy link

You are not using the correct build.
That branch of XUAT requires this specific branch of BepInEx.
6.7.2 has not merged this branch so is not going to work.

Ok...
I tried several previous versions, but the result is the same...
Tell me which version to use?

@krulci
Copy link
Author

krulci commented Jul 27, 2023

You are not using the correct build.

That branch of XUAT requires this specific branch of BepInEx.

6.7.2 has not merged this branch so is not going to work.

Ok...

I tried several previous versions, but the result is the same...

Tell me which version to use?

You need to compile this branch.
This is one of the reason this pull request is submitted.

@KAPTOHKA
Copy link

KAPTOHKA commented Aug 1, 2023

You need to compile this branch.
This is one of the reason this pull request is submitted.

I don't compile(((
Gives a lot of errors including Il2CppDumper & PrincessDumper...
Or I'm doing something wrong...

il2CppinteropManager.cs Runtimes\Unity\Bepintx.Unity.IL2CPP
The name "Princess Dumper" does not exist in the current context. [BepInEx.Unity.IL2CPP] csharp(CS0103) [Row 214, column 17]
The name "Princess Dumper" does not exist in the current context. [BepinEx.Unity.IL2CPP] csharp(CS0103) [Row 215, column 17]
The name "Il2CppDumper" does not exist in the current context. [[Belinex.Unity.IL2CPP] csharp(C50103) [Row 231, column 17]
The type or namespace name "II2CppDumper" could not be found (perhaps the using directive or assembly reference is missing). [VerInEx.Unity.IL2CPP] csharp(CS0246) [Row 231, column 84]
The type or namespace name "Il2CppDumper" could not be found (perhaps the using directive or assembly reference is missing). [BepInEx.Unity.IL2CPP] csharp(CS0246) [Row 231, column 120]
The name "II2CppDumper" does not exist in the current context. [BepInEx.Unity.IL2CPP] csharp(CS0103) [Row 232, column 17]

@KAPTOHKA
Copy link

KAPTOHKA commented Aug 3, 2023

You need to compile this branch.
This is one of the reason this pull request is submitted.

Compiled your branch...
Used THIS Auto-Translator and now everything works...)))

[Message: Preloader] BepInEx 6.0.0 - GAME
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2021.3.28f1
[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 [XUnity Auto Translator 5.2.0]
[Info   :Il2CppInterop] Registered mono type XUnity.AutoTranslator.Plugin.Core.PluginLoader+AutoTranslatorProxyBehaviour in il2cpp domain
[Info   :   BepInEx] Loading [XUnity Resource Redirector 2.0.0]
[Message:   BepInEx] Chainloader startup complete
[Info   :XUnity.AutoTranslator] Force loading ALL proxy assemblies.
[Warning:XUnity.AutoTranslator] Could not find 'UnityEngine.WWW' in IL2CPP domain even though it could be found in the managed domain.
[Warning:XUnity.AutoTranslator] Could not find 'UnityEngine.GUI+ToolbarButtonSize' in IL2CPP domain even though it could be found in the managed domain.
[Info   :XUnity.AutoTranslator] Version of TextMesh Pro: 1.4.0.
[Warning:  HarmonyX] AccessTools.Method: Could not find method for type TMPro.TMP_Text and name SetCharArray and parameters (Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStructArray<int>, int, int)
[Warning:XUnity.AutoTranslator] Could not hook 'TMP_Text_SetCharArray_Hook3'. Likely due differences between different versions of the engine or text framework.
[Info   :XUnity.AutoTranslator] Attempting to load TextMesh Pro font from asset bundle.
[Info   :XUnity.AutoTranslator] Loaded TextMesh Pro font uses version: 1.1.0
[Warning:XUnity.AutoTranslator] TextMesh Pro version mismatch. Font asset version: 1.1.0, TextMesh Pro version: 1.4.0
[Info   :XUnity.AutoTranslator] Loaded fallback font for TextMesh Pro: arialuni_sdf_u2019
[Info   :XUnity.AutoTranslator] Loaded XUnity.AutoTranslator into Unity [2021.3.28f1] game.
[Info   :XUnity.AutoTranslator] Attempting to load TextMesh Pro font from asset bundle.
[Warning:XUnity.AutoTranslator] Could not load asset bundle while loading font: F:\GAME\arialuni_sdf_u2019
[Info   :Il2CppInterop] Registered mono type XUnity.AutoTranslator.Plugin.Core.Il2CppManagedEnumerator in il2cpp domain
[Info   :XUnity.AutoTranslator] Skipping plugin scan because no plugin-specific translations has been registered.

Thank you...

It doesn't work with the original (v5.2.0) Auto-Translator...)))

@KAPTOHKA
Copy link

KAPTOHKA commented Aug 4, 2023

Now the combination of BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.672 and XUnity.AutoTranslator(v5.3.0) also work correctly...)))
But hotkeys don't work...(((

@krulci krulci closed this by deleting the head repository May 4, 2024
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.

None yet

3 participants