IL2CPP: Encoded tokens in metadata v27 must be shifted right 1 bit

This commit is contained in:
Katy Coe
2020-08-16 02:35:33 +02:00
parent ec6066aa1d
commit 5f7218f7df
3 changed files with 21 additions and 5 deletions

View File

@@ -42,6 +42,10 @@ namespace Il2CppInspector
var encodedType = encodedIndex & 0xE0000000;
usageType = (MetadataUsageType)(encodedType >> 29);
index = encodedIndex & 0x1FFFFFFF;
// From v27 the bottom bit is set to indicate the usage token hasn't been replaced with a pointer at runtime yet
if (package.Version >= 27)
index >>= 1;
}
return new MetadataUsage(usageType, (int)index);
}