Skip to content

Commit

Permalink
Lib: Support metadata 29.2 now that it's been dumped
Browse files Browse the repository at this point in the history
  • Loading branch information
SamboyCoding committed Jun 2, 2024
1 parent 6e702b8 commit e45cbda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions LibCpp2IL/Metadata/Il2CppMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public class Il2CppMetadata : ClassReadingBinaryReader
}
else if (version == 29)
{
if (unityVersion.GreaterThanOrEquals(2023, 2, 0, UnityVersionType.Alpha, 22))
actualVersion = 29.2f; //2023.2.0a22 introduces v29.2 which adds a new field to Il2CppMethodDefinition
if (unityVersion.GreaterThanOrEquals(2022, 1, 0, UnityVersionType.Beta, 7))
actualVersion = 29.1f; //2022.1.0b7 introduces v29.1 which adds two new pointers to codereg
else
Expand Down
6 changes: 5 additions & 1 deletion LibCpp2IL/Metadata/Il2CppMethodDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Il2CppMethodDefinition : ReadableClass
public ushort iflags;
public ushort slot;
public ushort parameterCount;
[Version(Min = 29.2f)] public bool isUnmanagedCallersOnly; //uint8_t

public MethodAttributes Attributes => (MethodAttributes) flags;

Expand Down Expand Up @@ -176,6 +177,9 @@ public override void Read(ClassReadingBinaryReader reader)
iflags = reader.ReadUInt16();
slot = reader.ReadUInt16();
parameterCount = reader.ReadUInt16();

if (IsAtLeast(29.2f))
isUnmanagedCallersOnly = reader.ReadByte() != 0;
}
}
}
}

0 comments on commit e45cbda

Please sign in to comment.