Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Runtime.InteropServices;
using Il2CppInterop.Common;
Expand Down Expand Up @@ -75,8 +75,8 @@ private IntPtr FindGetTypeInfoFromTypeDefinitionIndex(bool forceICallMethod = fa
else getTypeInfoFromTypeDefinitionIndex = imageGetTypeXrefs[0];
if ((getTypeInfoFromTypeDefinitionIndex.ToInt64() & 0xF) != 0)
{
Logger.Instance.LogTrace("Image::GetType xref wasn't aligned, attempting to resolve from icall");
return FindGetTypeInfoFromTypeDefinitionIndex(true);
Logger.Instance.LogTrace("Image::GetType xref wasn't aligned, GetTypeInfoFromTypeDefinitionIndex is likely inlined into Image::GetType");
getTypeInfoFromTypeDefinitionIndex = imageGetType;
}
if (imageGetTypeXrefs.Count() > 1 && UnityVersionHandler.IsMetadataV29OrHigher)
{
Expand Down
4 changes: 2 additions & 2 deletions Il2CppInterop.Runtime/Injection/InjectorHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -187,7 +187,7 @@ static nint GetClassInitSubstitute()
}
nint pClassInit = s_ClassInitSignatures
.Select(s => MemoryUtils.FindSignatureInModule(Il2CppModule, s))
.FirstOrDefault(p => p != 0);
.FirstOrDefault(p => p != 0 && (long)p >= (long)Il2CppModule.BaseAddress && (long)p < (long)Il2CppModule.BaseAddress + Il2CppModule.ModuleMemorySize);

if (pClassInit == 0)
{
Expand Down
Loading