IL2CPP: Implement Il2CppAssemblyNameDefinition change (metadata v24.4)
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Il2CppInspector
|
|||||||
public long[] FieldOffsetPointers { get; private set; }
|
public long[] FieldOffsetPointers { get; private set; }
|
||||||
|
|
||||||
// Generated functions which call constructors on custom attributes
|
// Generated functions which call constructors on custom attributes
|
||||||
// Only for <=24.3
|
// Only for < 27
|
||||||
public ulong[] CustomAttributeGenerators { get; private set; }
|
public ulong[] CustomAttributeGenerators { get; private set; }
|
||||||
|
|
||||||
// IL2CPP-generated functions which implement MethodBase.Invoke with a unique signature per invoker, defined in Il2CppInvokerTable.cpp
|
// IL2CPP-generated functions which implement MethodBase.Invoke with a unique signature per invoker, defined in Il2CppInvokerTable.cpp
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ namespace Il2CppInspector
|
|||||||
public ulong invokerPointers;
|
public ulong invokerPointers;
|
||||||
|
|
||||||
// Removed in metadata v27
|
// Removed in metadata v27
|
||||||
[Version(Max = 24.3)]
|
[Version(Max = 24.4)]
|
||||||
public long customAttributeCount;
|
public long customAttributeCount;
|
||||||
[Version(Max = 24.3)]
|
[Version(Max = 24.4)]
|
||||||
public ulong customAttributeGenerators;
|
public ulong customAttributeGenerators;
|
||||||
|
|
||||||
// Removed in metadata v23
|
// Removed in metadata v23
|
||||||
@@ -199,7 +199,7 @@ namespace Il2CppInspector
|
|||||||
|
|
||||||
public class Il2CppGenericClass
|
public class Il2CppGenericClass
|
||||||
{
|
{
|
||||||
[Version(Max = 24.3)]
|
[Version(Max = 24.4)]
|
||||||
public long typeDefinitionIndex; /* the generic type definition */
|
public long typeDefinitionIndex; /* the generic type definition */
|
||||||
[Version(Min = 27)]
|
[Version(Min = 27)]
|
||||||
public ulong type; // Il2CppType* /* the generic type definition */
|
public ulong type; // Il2CppType* /* the generic type definition */
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace Il2CppInspector
|
|||||||
if (Version >= 27)
|
if (Version >= 27)
|
||||||
return buildLateBindingMetadataUsages();
|
return buildLateBindingMetadataUsages();
|
||||||
|
|
||||||
// Version >= 19 && <= 24.3
|
// Version >= 19 && < 27
|
||||||
var usages = new Dictionary<uint, MetadataUsage>();
|
var usages = new Dictionary<uint, MetadataUsage>();
|
||||||
foreach (var metadataUsageList in Metadata.MetadataUsageLists)
|
foreach (var metadataUsageList in Metadata.MetadataUsageLists)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ namespace Il2CppInspector
|
|||||||
var mrSize = (ulong) Metadata.Sizeof(typeof(Il2CppMetadataRegistration), Image.Version, Image.Bits / 8);
|
var mrSize = (ulong) Metadata.Sizeof(typeof(Il2CppMetadataRegistration), Image.Version, Image.Bits / 8);
|
||||||
vas = FindAllMappedWords(imageBytes, (ulong) metadata.Types.Length).Select(a => a - mrSize + ptrSize * 4);
|
vas = FindAllMappedWords(imageBytes, (ulong) metadata.Types.Length).Select(a => a - mrSize + ptrSize * 4);
|
||||||
|
|
||||||
// >= 19 && <= 24.3
|
// >= 19 && < 27
|
||||||
if (Image.Version < 27)
|
if (Image.Version < 27)
|
||||||
foreach (var va in vas) {
|
foreach (var va in vas) {
|
||||||
var mr = Image.ReadMappedObject<Il2CppMetadataRegistration>(va);
|
var mr = Image.ReadMappedObject<Il2CppMetadataRegistration>(va);
|
||||||
|
|||||||
@@ -119,7 +119,14 @@ namespace Il2CppInspector
|
|||||||
VTableMethodIndices = ReadArray<uint>(Header.vtableMethodsOffset, Header.vtableMethodsCount / sizeof(uint));
|
VTableMethodIndices = ReadArray<uint>(Header.vtableMethodsOffset, Header.vtableMethodsCount / sizeof(uint));
|
||||||
|
|
||||||
if (Version >= 16) {
|
if (Version >= 16) {
|
||||||
Assemblies = ReadArray<Il2CppAssemblyDefinition>(Header.assembliesOffset, Header.assembliesCount / Sizeof(typeof(Il2CppAssemblyDefinition)));
|
// In v24.4 hashValueIndex was removed from Il2CppAssemblyNameDefinition, which is a field in Il2CppAssemblyDefinition
|
||||||
|
// The number of images and assemblies should be the same. If they are not, we deduce that we are using v24.4
|
||||||
|
// Note the version comparison matches both 24.2 and 24.3 here since 24.3 is tested for during binary loading
|
||||||
|
var assemblyCount = Header.assembliesCount / Sizeof(typeof(Il2CppAssemblyDefinition));
|
||||||
|
if (Version == 24.2 && assemblyCount < Images.Length)
|
||||||
|
Version = 24.4;
|
||||||
|
|
||||||
|
Assemblies = ReadArray<Il2CppAssemblyDefinition>(Header.assembliesOffset, Images.Length);
|
||||||
ParameterDefaultValues = ReadArray<Il2CppParameterDefaultValue>(Header.parameterDefaultValuesOffset, Header.parameterDefaultValuesCount / Sizeof(typeof(Il2CppParameterDefaultValue)));
|
ParameterDefaultValues = ReadArray<Il2CppParameterDefaultValue>(Header.parameterDefaultValuesOffset, Header.parameterDefaultValuesCount / Sizeof(typeof(Il2CppParameterDefaultValue)));
|
||||||
}
|
}
|
||||||
if (Version >= 19 && Version < 27) {
|
if (Version >= 19 && Version < 27) {
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ namespace Il2CppInspector
|
|||||||
// Unity 2019.1.0f2 -> v24.2
|
// Unity 2019.1.0f2 -> v24.2
|
||||||
// Unity 2019.2.8f1 -> v24.2
|
// Unity 2019.2.8f1 -> v24.2
|
||||||
// Unity 2019.3.7f1 -> v24.3
|
// Unity 2019.3.7f1 -> v24.3
|
||||||
|
// Unity 2019.4.15f1 -> v24.4
|
||||||
|
// Unity 2020.1.0f1 -> v24.3
|
||||||
|
// Unity 2020.1.11f1 -> v24.4
|
||||||
// Unity 2020.2.0f1 -> v27
|
// Unity 2020.2.0f1 -> v27
|
||||||
// https://unity3d.com/get-unity/download/archive
|
// https://unity3d.com/get-unity/download/archive
|
||||||
// Metadata version is written at the end of Unity.IL2CPP.MetadataCacheWriter.WriteLibIl2CppMetadata or WriteMetadata (Unity.IL2CPP.dll)
|
// Metadata version is written at the end of Unity.IL2CPP.MetadataCacheWriter.WriteLibIl2CppMetadata or WriteMetadata (Unity.IL2CPP.dll)
|
||||||
@@ -100,13 +103,13 @@ namespace Il2CppInspector
|
|||||||
[Version(Min = 16)]
|
[Version(Min = 16)]
|
||||||
public int assembliesCount;
|
public int assembliesCount;
|
||||||
|
|
||||||
[Version(Min = 19, Max = 24.3)]
|
[Version(Min = 19, Max = 24.4)]
|
||||||
public int metadataUsageListsOffset; // Il2CppMetadataUsageList
|
public int metadataUsageListsOffset; // Il2CppMetadataUsageList
|
||||||
[Version(Min = 19, Max = 24.3)]
|
[Version(Min = 19, Max = 24.4)]
|
||||||
public int metadataUsageListsCount;
|
public int metadataUsageListsCount;
|
||||||
[Version(Min = 19, Max = 24.3)]
|
[Version(Min = 19, Max = 24.4)]
|
||||||
public int metadataUsagePairsOffset; // Il2CppMetadataUsagePair
|
public int metadataUsagePairsOffset; // Il2CppMetadataUsagePair
|
||||||
[Version(Min = 19, Max = 24.3)]
|
[Version(Min = 19, Max = 24.4)]
|
||||||
public int metadataUsagePairsCount;
|
public int metadataUsagePairsCount;
|
||||||
[Version(Min = 19)]
|
[Version(Min = 19)]
|
||||||
public int fieldRefsOffset; // Il2CppFieldRef
|
public int fieldRefsOffset; // Il2CppFieldRef
|
||||||
@@ -214,6 +217,7 @@ namespace Il2CppInspector
|
|||||||
|
|
||||||
public int nameIndex;
|
public int nameIndex;
|
||||||
public int cultureIndex;
|
public int cultureIndex;
|
||||||
|
[Version(Max = 24.3)]
|
||||||
public int hashValueIndex;
|
public int hashValueIndex;
|
||||||
public int publicKeyIndex;
|
public int publicKeyIndex;
|
||||||
[Version(Max = 15), ArrayLength(FixedSize = 8)]
|
[Version(Max = 15), ArrayLength(FixedSize = 8)]
|
||||||
@@ -239,7 +243,7 @@ namespace Il2CppInspector
|
|||||||
public int customAttributeIndex;
|
public int customAttributeIndex;
|
||||||
|
|
||||||
public int byvalTypeIndex;
|
public int byvalTypeIndex;
|
||||||
[Version(Max = 24.3)]
|
[Version(Max = 24.4)]
|
||||||
public int byrefTypeIndex;
|
public int byrefTypeIndex;
|
||||||
|
|
||||||
public int declaringTypeIndex;
|
public int declaringTypeIndex;
|
||||||
|
|||||||
Reference in New Issue
Block a user