Skip to content

Commit ed3c169

Browse files
committed
Il2Cpp: Check both GameAssembly and UserAssembly
1 parent e366c88 commit ed3c169

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

BepInEx.IL2CPP/IL2CPPChainloader.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ public override void Initialize(string gameExePath = null)
6868
ClassInjector.Detour = new UnhollowerDetourHandler();
6969

7070
var gameAssemblyModule = Process.GetCurrentProcess().Modules.Cast<ProcessModule>()
71-
.First(x => x.ModuleName.Contains("GameAssembly"));
71+
.FirstOrDefault(x => x.ModuleName.Contains("GameAssembly") ||
72+
x.ModuleName.Contains("UserAssembly"));
73+
74+
if (gameAssemblyModule == null)
75+
{
76+
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.");
77+
return;
78+
}
7279

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

0 commit comments

Comments
 (0)