Skip to content

Commit

Permalink
修复一个bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfare committed Apr 22, 2022
1 parent ddf7ee2 commit aa1be20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Il2CppDumper/Il2Cpp/Il2Cpp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public virtual void Init(ulong codeRegistration, ulong metadataRegistration)
for (var i = 0; i < pMetadataRegistration.typesCount; ++i)
{
types[i] = MapVATR<Il2CppType>(pTypes[i]);
types[i].Init();
types[i].Init(Version);
typeDic.Add(pTypes[i], types[i]);
}
if (Version >= 24.2)
Expand Down
19 changes: 15 additions & 4 deletions Il2CppDumper/Il2Cpp/Il2CppClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}

Expand Down

0 comments on commit aa1be20

Please sign in to comment.