add new struct definitions

This commit is contained in:
LukeFZ
2024-08-13 18:34:22 +02:00
parent 23e873280d
commit 2d3b186b4d
78 changed files with 1852 additions and 1047 deletions

View File

@@ -4,6 +4,8 @@ using System;
using System.Diagnostics;
using System.IO;
using Il2CppInspector.Next;
using Il2CppInspector.Next.BinaryMetadata;
using Il2CppInspector.Next.Metadata;
namespace Il2CppInspector.Utils;
@@ -154,18 +156,18 @@ public static class BlobReader
public static Il2CppTypeEnum ReadEncodedTypeEnum(Il2CppInspector inspector, BinaryObjectStream blob,
out Il2CppTypeDefinition enumType)
{
enumType = null;
enumType = default;
var typeEnum = (Il2CppTypeEnum)blob.ReadByte();
if (typeEnum == Il2CppTypeEnum.IL2CPP_TYPE_ENUM)
{
var typeIndex = blob.ReadCompressedInt32();
var typeHandle = (uint)inspector.TypeReferences[typeIndex].datapoint;
var typeHandle = (uint)inspector.TypeReferences[typeIndex].Data.KlassIndex;
enumType = inspector.TypeDefinitions[typeHandle];
var elementTypeHandle = inspector.TypeReferences[enumType.elementTypeIndex].datapoint;
var elementTypeHandle = inspector.TypeReferences[enumType.ElementTypeIndex].Data.KlassIndex;
var elementType = inspector.TypeDefinitions[elementTypeHandle];
typeEnum = inspector.TypeReferences[elementType.byvalTypeIndex].type;
typeEnum = inspector.TypeReferences[elementType.ByValTypeIndex].Type;
}
// This technically also handles SZARRAY (System.Array) and all others by just returning their system type