From 4befde8ab4177380060d7056c42bbd003db1938b Mon Sep 17 00:00:00 2001 From: LukeFZ <17146677+LukeFZ@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:54:05 +0100 Subject: [PATCH] increase CodeRegistration validation heuristics thresholds due to some games reaching them --- Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs index cb65d57..d57f98d 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs @@ -296,8 +296,11 @@ namespace Il2CppInspector */ if ((Metadata != null && Metadata.Types.Length != MetadataRegistration.TypeDefinitionsSizesCount) || CodeRegistration.ReversePInvokeWrapperCount > 0x10000 - || CodeRegistration.UnresolvedVirtualCallCount > 0x4000 // >= 22 - || CodeRegistration.InteropDataCount > 0x1000 // >= 23 + // L-NOTE: These below boundaries have been updated already as some games + // have reached these limits during normal use. Maybe we should just remove them + // at this point? + || CodeRegistration.UnresolvedVirtualCallCount > 0x8000 // >= 22 + || CodeRegistration.InteropDataCount > 0x2000 // >= 23 || (Image.Version <= MetadataVersions.V241 && CodeRegistration.InvokerPointersCount > CodeRegistration.MethodPointersCount)) throw new NotSupportedException("The detected Il2CppCodeRegistration / Il2CppMetadataRegistration structs do not pass validation. This may mean that their fields have been re-ordered as a form of obfuscation and Il2CppInspector has not been able to restore the original order automatically. Consider re-ordering the fields in Il2CppBinaryClasses.cs and try again.");