move 29/31.1/.2 to use tags (-2022,-2023) instead of minor versions

This commit is contained in:
LukeFZ
2024-08-18 22:40:14 +02:00
parent 43d7433e12
commit a7081ccfa9
6 changed files with 22 additions and 24 deletions

View File

@@ -239,7 +239,7 @@ namespace Il2CppInspector
if ((Image.Version == MetadataVersions.V290 || Image.Version == MetadataVersions.V310) &&
cr.InteropData + cr.InteropDataCount >= (ulong)Image.Length)
{
Image.Version = new StructVersion(Image.Version.Major, 1, Image.Version.Tag);
Image.Version = new StructVersion(Image.Version.Major, 0, MetadataVersions.Tag2022);
cr = Image.ReadMappedVersionedObject<Il2CppCodeRegistration>(codeRegistration);
}
}
@@ -250,9 +250,6 @@ namespace Il2CppInspector
// The first item in CodeRegistration is the total number of method pointers
vas = FindAllMappedWords(imageBytes, (ulong) metadata.Methods.Count(m => (uint) m.MethodIndex != 0xffff_ffff));
if (!vas.Any())
return (0, 0);
// The count of method pointers will be followed some bytes later by
// the count of custom attribute generators; the distance between them
// depends on the il2cpp version so we just use ReadMappedObject to simplify the math

View File

@@ -206,7 +206,7 @@ namespace Il2CppInspector
var secondToken = Methods[1].Token;
if (secondToken >> 24 != 0x6)
{
Version = new StructVersion(Version.Major, 1, Version.Tag);
Version = new StructVersion(Version.Major, 0, MetadataVersions.Tag2023);
Methods = ReadVersionedObjectArray<Il2CppMethodDefinition>(Header.MethodsOffset,
Header.MethodsSize / Sizeof<Il2CppMethodDefinition>());