Skip to content

Commit

Permalink
Il2Cpp: Check both GameAssembly and UserAssembly
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorsington committed Nov 10, 2021
1 parent e366c88 commit ed3c169
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion BepInEx.IL2CPP/IL2CPPChainloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ public override void Initialize(string gameExePath = null)
ClassInjector.Detour = new UnhollowerDetourHandler();

var gameAssemblyModule = Process.GetCurrentProcess().Modules.Cast<ProcessModule>()
.First(x => x.ModuleName.Contains("GameAssembly"));
.FirstOrDefault(x => x.ModuleName.Contains("GameAssembly") ||
x.ModuleName.Contains("UserAssembly"));

if (gameAssemblyModule == null)
{
Logger.LogFatal("Could not locate Il2Cpp game assembly (GameAssembly.dll) or (UserAssembly.dll). The game might be obfuscated or use a yet unsupported build of Unity.");
return;
}

gameAssemblyModule.BaseAddress.TryGetFunction("il2cpp_runtime_invoke", out var runtimeInvokePtr);
PreloaderLogger.Log.LogDebug($"Runtime invoke pointer: 0x{runtimeInvokePtr.ToInt64():X}");
Expand Down

0 comments on commit ed3c169

Please sign in to comment.