IL2CPP: Load InterfaceOffsets, VTableMethodIndices and MethodSpecs
This commit is contained in:
@@ -40,6 +40,9 @@ namespace Il2CppInspector
|
|||||||
// Generated functions which call constructors on custom attributes
|
// Generated functions which call constructors on custom attributes
|
||||||
public ulong[] CustomAttributeGenerators { get; private set; }
|
public ulong[] CustomAttributeGenerators { get; private set; }
|
||||||
|
|
||||||
|
// Generic method specs for vtables
|
||||||
|
public Il2CppMethodSpec[] MethodSpecs { get; private set; }
|
||||||
|
|
||||||
// Every defined type
|
// Every defined type
|
||||||
public List<Il2CppType> Types { get; private set; }
|
public List<Il2CppType> Types { get; private set; }
|
||||||
|
|
||||||
@@ -187,7 +190,10 @@ namespace Il2CppInspector
|
|||||||
Types = image.ReadMappedObjectPointerArray<Il2CppType>(MetadataRegistration.ptypes, (int) MetadataRegistration.typesCount);
|
Types = image.ReadMappedObjectPointerArray<Il2CppType>(MetadataRegistration.ptypes, (int) MetadataRegistration.typesCount);
|
||||||
|
|
||||||
// Custom attribute constructors
|
// Custom attribute constructors
|
||||||
CustomAttributeGenerators = Image.ReadMappedArray<ulong>(CodeRegistration.customAttributeGenerators, (int) CodeRegistration.customAttributeCount);
|
CustomAttributeGenerators = image.ReadMappedArray<ulong>(CodeRegistration.customAttributeGenerators, (int) CodeRegistration.customAttributeCount);
|
||||||
|
|
||||||
|
// Generic method specs
|
||||||
|
MethodSpecs = image.ReadMappedArray<Il2CppMethodSpec>(MetadataRegistration.methodSpecs, (int) MetadataRegistration.methodSpecsCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,4 +209,11 @@ namespace Il2CppInspector
|
|||||||
public ulong sizes;
|
public ulong sizes;
|
||||||
public ulong lobounds;
|
public ulong lobounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Il2CppMethodSpec
|
||||||
|
{
|
||||||
|
public int methodDefinitionIndex;
|
||||||
|
public int classIndexIndex;
|
||||||
|
public int methodIndexIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,15 +41,18 @@ namespace Il2CppInspector
|
|||||||
public Il2CppGenericParameter[] GenericParameters => Metadata.GenericParameters;
|
public Il2CppGenericParameter[] GenericParameters => Metadata.GenericParameters;
|
||||||
public int[] GenericConstraintIndices => Metadata.GenericConstraintIndices;
|
public int[] GenericConstraintIndices => Metadata.GenericConstraintIndices;
|
||||||
public Il2CppCustomAttributeTypeRange[] AttributeTypeRanges => Metadata.AttributeTypeRanges;
|
public Il2CppCustomAttributeTypeRange[] AttributeTypeRanges => Metadata.AttributeTypeRanges;
|
||||||
|
public Il2CppInterfaceOffsetPair[] InterfaceOffsets => Metadata.InterfaceOffsets;
|
||||||
public int[] InterfaceUsageIndices => Metadata.InterfaceUsageIndices;
|
public int[] InterfaceUsageIndices => Metadata.InterfaceUsageIndices;
|
||||||
public int[] NestedTypeIndices => Metadata.NestedTypeIndices;
|
public int[] NestedTypeIndices => Metadata.NestedTypeIndices;
|
||||||
public int[] AttributeTypeIndices => Metadata.AttributeTypeIndices;
|
public int[] AttributeTypeIndices => Metadata.AttributeTypeIndices;
|
||||||
|
public uint[] VTableMethodIndices => Metadata.VTableMethodIndices;
|
||||||
public Dictionary<int, (ulong, object)> FieldDefaultValue { get; } = new Dictionary<int, (ulong, object)>();
|
public Dictionary<int, (ulong, object)> FieldDefaultValue { get; } = new Dictionary<int, (ulong, object)>();
|
||||||
public Dictionary<int, (ulong, object)> ParameterDefaultValue { get; } = new Dictionary<int, (ulong, object)>();
|
public Dictionary<int, (ulong, object)> ParameterDefaultValue { get; } = new Dictionary<int, (ulong, object)>();
|
||||||
public List<long> FieldOffsets { get; }
|
public List<long> FieldOffsets { get; }
|
||||||
public List<Il2CppType> TypeUsages => Binary.Types;
|
public List<Il2CppType> TypeUsages => Binary.Types;
|
||||||
public Dictionary<string, Il2CppCodeGenModule> Modules => Binary.Modules;
|
public Dictionary<string, Il2CppCodeGenModule> Modules => Binary.Modules;
|
||||||
public ulong[] CustomAttributeGenerators => Binary.CustomAttributeGenerators;
|
public ulong[] CustomAttributeGenerators => Binary.CustomAttributeGenerators;
|
||||||
|
public Il2CppMethodSpec[] MethodSpecs => Binary.MethodSpecs;
|
||||||
|
|
||||||
// TODO: Finish all file access in the constructor and eliminate the need for this
|
// TODO: Finish all file access in the constructor and eliminate the need for this
|
||||||
public IFileFormatReader BinaryImage => Binary.Image;
|
public IFileFormatReader BinaryImage => Binary.Image;
|
||||||
|
|||||||
@@ -31,11 +31,13 @@ namespace Il2CppInspector
|
|||||||
public Il2CppGenericContainer[] GenericContainers { get; }
|
public Il2CppGenericContainer[] GenericContainers { get; }
|
||||||
public Il2CppGenericParameter[] GenericParameters { get; }
|
public Il2CppGenericParameter[] GenericParameters { get; }
|
||||||
public Il2CppCustomAttributeTypeRange[] AttributeTypeRanges { get; }
|
public Il2CppCustomAttributeTypeRange[] AttributeTypeRanges { get; }
|
||||||
|
public Il2CppInterfaceOffsetPair[] InterfaceOffsets { get; }
|
||||||
|
|
||||||
public int[] InterfaceUsageIndices { get; }
|
public int[] InterfaceUsageIndices { get; }
|
||||||
public int[] NestedTypeIndices { get; }
|
public int[] NestedTypeIndices { get; }
|
||||||
public int[] AttributeTypeIndices { get; }
|
public int[] AttributeTypeIndices { get; }
|
||||||
public int[] GenericConstraintIndices { get; }
|
public int[] GenericConstraintIndices { get; }
|
||||||
|
public uint[] VTableMethodIndices { get; }
|
||||||
|
|
||||||
public Dictionary<int, string> Strings { get; } = new Dictionary<int, string>();
|
public Dictionary<int, string> Strings { get; } = new Dictionary<int, string>();
|
||||||
|
|
||||||
@@ -109,6 +111,8 @@ namespace Il2CppInspector
|
|||||||
GenericContainers = ReadArray<Il2CppGenericContainer>(Header.genericContainersOffset, Header.genericContainersCount / Sizeof(typeof(Il2CppGenericContainer)));
|
GenericContainers = ReadArray<Il2CppGenericContainer>(Header.genericContainersOffset, Header.genericContainersCount / Sizeof(typeof(Il2CppGenericContainer)));
|
||||||
GenericParameters = ReadArray<Il2CppGenericParameter>(Header.genericParametersOffset, Header.genericParametersCount / Sizeof(typeof(Il2CppGenericParameter)));
|
GenericParameters = ReadArray<Il2CppGenericParameter>(Header.genericParametersOffset, Header.genericParametersCount / Sizeof(typeof(Il2CppGenericParameter)));
|
||||||
GenericConstraintIndices = ReadArray<int>(Header.genericParameterConstraintsOffset, Header.genericParameterConstraintsCount / sizeof(int));
|
GenericConstraintIndices = ReadArray<int>(Header.genericParameterConstraintsOffset, Header.genericParameterConstraintsCount / sizeof(int));
|
||||||
|
InterfaceOffsets = ReadArray<Il2CppInterfaceOffsetPair>(Header.interfaceOffsetsOffset, Header.interfaceOffsetsCount / Sizeof(typeof(Il2CppInterfaceOffsetPair)));
|
||||||
|
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)));
|
Assemblies = ReadArray<Il2CppAssemblyDefinition>(Header.assembliesOffset, Header.assembliesCount / Sizeof(typeof(Il2CppAssemblyDefinition)));
|
||||||
|
|||||||
@@ -415,4 +415,10 @@ namespace Il2CppInspector
|
|||||||
public int start;
|
public int start;
|
||||||
public int count;
|
public int count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Il2CppInterfaceOffsetPair
|
||||||
|
{
|
||||||
|
public int interfaceTypeIndex;
|
||||||
|
public int offset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user