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

@@ -51,7 +51,7 @@ namespace Il2CppInspector.Model
// For il2cpp < 19, the key is the string literal ordinal instead of the address
public Dictionary<ulong, string> Strings { get; } = new Dictionary<ulong, string>();
public bool StringIndexesAreOrdinals => Package.MetadataUsages == null;
public bool StringIndexesAreOrdinals => Package.Version < 19;
// The .NET type model for the application
public TypeModel TypeModel { get; }
@@ -239,7 +239,7 @@ namespace Il2CppInspector.Model
}
// Add string literals for metadata <19 to the model
else {
if (Package.Version < 19) {
/* Version < 19 calls `il2cpp_codegen_string_literal_from_index` to get string literals.
* Unfortunately, metadata references are just loose globals in Il2CppMetadataUsage.cpp
* so we can't automatically name those. Next best thing is to define an enum for the strings. */