LavaGang / MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
https://discord.gg/2Wn3N2P
Apache License 2.0
2.47k stars 477 forks source link

[Bug]: MelonLoader does not work with game "Eleven Table Tennis" #270

Closed yrichard6208 closed 2 years ago

yrichard6208 commented 2 years ago

All of the following criteria must be met

All of the following are optional to answer

Describe the issue.

I'm trying to develop a mod for VR game "Eleven Table Tennis" (It is available on Steam)

I'm seeing an exception in MelonLoader console output: [18:27:26.443] [ERROR] Unhandled Exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. [18:27:26.444] [ERROR] Parameter name: length [18:27:26.444] [ERROR] at System.Range.GetOffsetAndLength(Int32 length) in /_/src/IndexRange/Range.cs:line 99 [18:27:26.445] [ERROR] at Cpp2IL.Core.Extensions.MiscExtensions.SubArray[T](T[] source, Range range) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Extensions\MiscExtensions.cs:line 112 [18:27:26.447] [ERROR] at Cpp2IL.Core.Utils.X86Utils.GetRawManagedOrCaCacheGenMethodBody(UInt64 ptr, Boolean isCaGen) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Utils\X86Utils.cs:line 49 [18:27:26.448] [ERROR] at Cpp2IL.Core.Model.Contexts.MethodAnalysisContext..ctor(Il2CppMethodDefinition definition, TypeAnalysisContext parent) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\MethodAnalysisContext.cs:line 80 [18:27:26.449] [ERROR] at Cpp2IL.Core.Model.Contexts.TypeAnalysisContext.<.ctor>b__28_0(Il2CppMethodDefinition m) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\TypeAnalysisContext.cs:line 71 [18:27:26.450] [ERROR] at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() [18:27:26.453] [ERROR] at System.Collections.Generic.List1..ctor(IEnumerable1 collection) [18:27:26.453] [ERROR] at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) [18:27:26.455] [ERROR] at Cpp2IL.Core.Model.Contexts.TypeAnalysisContext..ctor(Il2CppTypeDefinition il2CppTypeDefinition, AssemblyAnalysisContext containingAssembly) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\TypeAnalysisContext.cs:line 71 [18:27:26.456] [ERROR] at Cpp2IL.Core.Model.Contexts.AssemblyAnalysisContext..ctor(Il2CppAssemblyDefinition assemblyDefinition, ApplicationAnalysisContext appContext) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\AssemblyAnalysisContext.cs:line 50 [18:27:26.457] [ERROR] at Cpp2IL.Core.Model.Contexts.ApplicationAnalysisContext..ctor(Il2CppBinary binary, Il2CppMetadata metadata, Single metadataVersion) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\ApplicationAnalysisContext.cs:line 73 [18:27:26.458] [ERROR] at Cpp2IL.Core.Cpp2IlApi.OnLibInitialized() in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Cpp2IlApi.cs:line 203 [18:27:26.459] [ERROR] at Cpp2IL.Program.MainWithArgs(Cpp2IlRuntimeArgs runtimeArgs) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL\Program.cs:line 324 [18:27:26.460] [ERROR] at Cpp2IL.Program.Main(String[] args) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL\Program.cs:line 268

MyMod seems is still loaded, but OnUpdate method was never called.

I have attached logs file here, could you please help take a look and let me know where the problem could be, and if it can be fixed.

MelonLoader_22-07-27_18-27-07.388.log

Thanks.

Did you attach your log file?

nitrog0d commented 2 years ago

Game works fine on latest commit in alpha-development branch, seems to be an old Cpp2IL issue AssetsTools fails to read game info at first but then uses a large class package and it works? Doesn't matter I guess image

yrichard6208 commented 2 years ago

@nitrog0d Do you have a link to private alpha-development build that I can try with this game, just like a link you have provided to fix Metal Hellsinger issue?

Thanks a lot.

nitrog0d commented 2 years ago

Try the same link, should work

yrichard6208 commented 2 years ago

@nitrog0d I have tried the build multiple times since yesterday including resinstall, it seems still does not work. I have attached the latest log here.

It looks like still fails at the same location.

I would like help debug to see where the issue is and contribute to the project, but I need some basic instructions where to start with and what things to look for this type of issue. Thanks a lot.

[17:23:19.589] [Il2CppAssemblyGenerator] [ERROR] Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. [17:23:19.590] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Utils.X86Utils.GetRawManagedOrCaCacheGenMethodBody(UInt64 ptr, Boolean isCaGen) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Utils\X86Utils.cs:line 39 [17:23:19.591] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Model.Contexts.MethodAnalysisContext..ctor(Il2CppMethodDefinition definition, TypeAnalysisContext parent) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\MethodAnalysisContext.cs:line 85 [17:23:19.591] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Model.Contexts.TypeAnalysisContext.<.ctor>b__42_0(Il2CppMethodDefinition m) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\TypeAnalysisContext.cs:line 115 [17:23:19.592] [Il2CppAssemblyGenerator] [ERROR] at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() [17:23:19.592] [Il2CppAssemblyGenerator] [ERROR] at System.Collections.Generic.List1..ctor(IEnumerable1 collection) [17:23:19.593] [Il2CppAssemblyGenerator] [ERROR] at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) [17:23:19.594] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Model.Contexts.TypeAnalysisContext..ctor(Il2CppTypeDefinition il2CppTypeDefinition, AssemblyAnalysisContext containingAssembly) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\TypeAnalysisContext.cs:line 115 [17:23:19.595] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Model.Contexts.AssemblyAnalysisContext..ctor(Il2CppAssemblyDefinition assemblyDefinition, ApplicationAnalysisContext appContext) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\AssemblyAnalysisContext.cs:line 64 [17:23:19.596] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Model.Contexts.ApplicationAnalysisContext..ctor(Il2CppBinary binary, Il2CppMetadata metadata, Single metadataVersion) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Model\Contexts\ApplicationAnalysisContext.cs:line 87 [17:23:19.596] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Cpp2IlApi.OnLibInitialized() in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Cpp2IlApi.cs:line 99 [17:23:19.601] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, UnityVersion unityVersion, Boolean allowUserToInputAddresses) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL.Core\Cpp2IlApi.cs:line 70 [17:23:19.601] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Program.MainWithArgs(Cpp2IlRuntimeArgs runtimeArgs) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL\Program.cs:line 417 [17:23:19.602] [Il2CppAssemblyGenerator] [ERROR] at Cpp2IL.Program.Main(String[] args) in C:\Users\Sam\RiderProjects\Cpp2IL\Cpp2IL\Program.cs:line 359

MelonLoader_22-09-22_17-23-03.481.log

nitrog0d commented 2 years ago

Weird? I used latest 1.969 and Cpp2IL ran fine, is that a clean install of the game and MelonLoader?

nitrog0d commented 2 years ago

Weird? I used latest 1.969 and Cpp2IL ran fine, is that a clean install of the game and MelonLoader?

yrichard6208 commented 2 years ago

@nitrog0d Yes, I have tried to uninstall and reinstall Melonloader and game itself multiple times.