From e75ecfc6d55f68e48231502561186ed0c86379d9 Mon Sep 17 00:00:00 2001 From: Perfare Date: Tue, 10 Aug 2021 17:39:19 +0800 Subject: [PATCH] fixed #24 --- module/src/main/cpp/il2cpp_dump.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/module/src/main/cpp/il2cpp_dump.cpp b/module/src/main/cpp/il2cpp_dump.cpp index 00a74494..8f343a1d 100644 --- a/module/src/main/cpp/il2cpp_dump.cpp +++ b/module/src/main/cpp/il2cpp_dump.cpp @@ -183,14 +183,20 @@ std::string dump_property(Il2CppClass * klass) { outPut << get_method_modifier(prop->set->flags); prop_class = il2cpp_class_from_type(prop->set->parameters[0].parameter_type); } - outPut << prop_class->name << " " << prop->name << " { "; - if (prop->get) { - outPut << "get; "; - } - if (prop->set) { - outPut << "set; "; + if (prop_class) { + outPut << prop_class->name << " " << prop->name << " { "; + if (prop->get) { + outPut << "get; "; + } + if (prop->set) { + outPut << "set; "; + } + outPut << "}\n"; + } else { + if (prop->name) { + outPut << " // unknown property " << prop->name; + } } - outPut << "}\n"; } } return outPut.str();