diff --git a/Il2CppDumper/Utils/SectionHelper.cs b/Il2CppDumper/Utils/SectionHelper.cs index a246b46..43a2a86 100644 --- a/Il2CppDumper/Utils/SectionHelper.cs +++ b/Il2CppDumper/Utils/SectionHelper.cs @@ -220,7 +220,8 @@ namespace Il2CppDumper foreach (var section in data) { il2Cpp.Position = section.offset; - while (il2Cpp.Position < section.offsetEnd - il2Cpp.PointerSize) + var end = Math.Min(section.offsetEnd, il2Cpp.Length) - il2Cpp.PointerSize; + while (il2Cpp.Position < end) { var addr = il2Cpp.Position; if (il2Cpp.ReadIntPtr() == typeDefinitionsCount)