Skip to content

Commit aa1be20

Browse files
committed
修复一个bug
1 parent ddf7ee2 commit aa1be20

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Il2CppDumper/Il2Cpp/Il2Cpp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public virtual void Init(ulong codeRegistration, ulong metadataRegistration)
173173
for (var i = 0; i < pMetadataRegistration.typesCount; ++i)
174174
{
175175
types[i] = MapVATR<Il2CppType>(pTypes[i]);
176-
types[i].Init();
176+
types[i].Init(Version);
177177
typeDic.Add(pTypes[i], types[i]);
178178
}
179179
if (Version >= 24.2)

Il2CppDumper/Il2Cpp/Il2CppClass.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,25 @@ public class Il2CppType
142142
public uint num_mods { get; set; }
143143
public uint byref { get; set; }
144144
public uint pinned { get; set; }
145+
public uint valuetype { get; set; }
145146

146-
public void Init()
147+
public void Init(double version)
147148
{
148149
attrs = bits & 0xffff;
149150
type = (Il2CppTypeEnum)((bits >> 16) & 0xff);
150-
num_mods = (bits >> 24) & 0x3f;
151-
byref = (bits >> 30) & 1;
152-
pinned = bits >> 31;
151+
if (version >= 27.2)
152+
{
153+
num_mods = (bits >> 24) & 0x1f;
154+
byref = (bits >> 29) & 1;
155+
pinned = (bits >> 30) & 1;
156+
valuetype = bits >> 31;
157+
}
158+
else
159+
{
160+
num_mods = (bits >> 24) & 0x3f;
161+
byref = (bits >> 30) & 1;
162+
pinned = bits >> 31;
163+
}
153164
data = new Union { dummy = datapoint };
154165
}
155166

0 commit comments

Comments
 (0)