From f25ad7a6127a51db1f36b9729371334c4eb89220 Mon Sep 17 00:00:00 2001 From: Perfare Date: Thu, 25 Nov 2021 06:59:41 +0800 Subject: [PATCH] fixed #520 --- Il2CppDumper/Il2Cpp/Il2Cpp.cs | 6 +++++- Il2CppDumper/Utils/Il2CppExecutor.cs | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Il2CppDumper/Il2Cpp/Il2Cpp.cs b/Il2CppDumper/Il2Cpp/Il2Cpp.cs index b4d8bdd..993c7fb 100644 --- a/Il2CppDumper/Il2Cpp/Il2Cpp.cs +++ b/Il2CppDumper/Il2Cpp/Il2Cpp.cs @@ -283,7 +283,11 @@ namespace Il2CppDumper public Il2CppType GetIl2CppType(ulong pointer) { - return typeDic[pointer]; + if (!typeDic.TryGetValue(pointer, out var type)) + { + return null; + } + return type; } public ulong GetMethodPointer(string imageName, Il2CppMethodDefinition methodDef) diff --git a/Il2CppDumper/Utils/Il2CppExecutor.cs b/Il2CppDumper/Utils/Il2CppExecutor.cs index 86ad718..80c77da 100644 --- a/Il2CppDumper/Utils/Il2CppExecutor.cs +++ b/Il2CppDumper/Utils/Il2CppExecutor.cs @@ -275,6 +275,10 @@ namespace Il2CppDumper if (il2Cpp.Version >= 27) { var il2CppType = il2Cpp.GetIl2CppType(genericClass.type); + if (il2CppType == null) + { + return null; + } return GetTypeDefinitionFromIl2CppType(il2CppType); } if (genericClass.typeDefinitionIndex == 4294967295 || genericClass.typeDefinitionIndex == -1)