From aa1be209f51d3be97bce5b6d67c240290b256003 Mon Sep 17 00:00:00 2001 From: Perfare Date: Fri, 22 Apr 2022 23:10:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Il2CppDumper/Il2Cpp/Il2Cpp.cs | 2 +- Il2CppDumper/Il2Cpp/Il2CppClass.cs | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Il2CppDumper/Il2Cpp/Il2Cpp.cs b/Il2CppDumper/Il2Cpp/Il2Cpp.cs index 59535e58..37e71822 100644 --- a/Il2CppDumper/Il2Cpp/Il2Cpp.cs +++ b/Il2CppDumper/Il2Cpp/Il2Cpp.cs @@ -173,7 +173,7 @@ public virtual void Init(ulong codeRegistration, ulong metadataRegistration) for (var i = 0; i < pMetadataRegistration.typesCount; ++i) { types[i] = MapVATR(pTypes[i]); - types[i].Init(); + types[i].Init(Version); typeDic.Add(pTypes[i], types[i]); } if (Version >= 24.2) diff --git a/Il2CppDumper/Il2Cpp/Il2CppClass.cs b/Il2CppDumper/Il2Cpp/Il2CppClass.cs index 75472398..cc590825 100644 --- a/Il2CppDumper/Il2Cpp/Il2CppClass.cs +++ b/Il2CppDumper/Il2Cpp/Il2CppClass.cs @@ -142,14 +142,25 @@ public class Il2CppType public uint num_mods { get; set; } public uint byref { get; set; } public uint pinned { get; set; } + public uint valuetype { get; set; } - public void Init() + public void Init(double version) { attrs = bits & 0xffff; type = (Il2CppTypeEnum)((bits >> 16) & 0xff); - num_mods = (bits >> 24) & 0x3f; - byref = (bits >> 30) & 1; - pinned = bits >> 31; + if (version >= 27.2) + { + num_mods = (bits >> 24) & 0x1f; + byref = (bits >> 29) & 1; + pinned = (bits >> 30) & 1; + valuetype = bits >> 31; + } + else + { + num_mods = (bits >> 24) & 0x3f; + byref = (bits >> 30) & 1; + pinned = bits >> 31; + } data = new Union { dummy = datapoint }; }