少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
 
#include "AOTHomologousImage.h"
 
namespace hybridclr
{
    namespace metadata
    {
        struct SuperSetTypeDefDetail
        {
            bool inited;
            uint32_t homoRowIndex;
            uint32_t homoParentRowIndex;
            uint32_t homoMethodStartIndex; // start from 1
            uint32_t homoFieldStartIndex; // start from 1
            const char* name;
            const char* namespaze;
            int32_t aotTypeIndex; // il2cpp type index
            const Il2CppType* aotIl2CppType;
            const Il2CppTypeDefinition* aotTypeDef;
            const Il2CppClass* aotKlass;
        };
 
        struct SuperSetMethodDefDetail
        {
            uint32_t homoRowIndex;
            MethodRefSig signature;
            const Il2CppTypeDefinition* declaringTypeDef;
            const Il2CppClass* declaringKlass;
            const char* name;
            const Il2CppMethodDefinition* aotMethodDef;
            MethodBody* body;
        };
 
        struct SuperSetFieldDefDetail
        {
            uint32_t homoRowIndex;
            const char* name;
            Il2CppType type;
            const Il2CppTypeDefinition* declaringTypeDef;
            const Il2CppType* declaringIl2CppType;
            const Il2CppFieldDefinition* aotFieldDef;
        };
 
        class SuperSetAOTHomologousImage : public AOTHomologousImage
        {
        public:
            SuperSetAOTHomologousImage() : AOTHomologousImage() {}
 
            void InitRuntimeMetadatas() override;
 
            void InitTypes0();
            void InitNestedClass();
            void InitType(SuperSetTypeDefDetail& type);
            void InitTypes1();
            void ReadMethodDefSig(BlobReader& reader, MethodRefSig& method);
            void InitMethods();
            void InitFields();
 
            void ReadTypeFromResolutionScope(uint32_t scope, uint32_t typeNamespace, uint32_t typeName, Il2CppType& type) override;
            MethodBody* GetMethodBody(uint32_t token) override;
            const Il2CppType* GetIl2CppTypeFromRawTypeDefIndex(uint32_t index) override;
            Il2CppGenericContainer* GetGenericContainerByRawIndex(uint32_t index) override;
            Il2CppGenericContainer* GetGenericContainerByTypeDefRawIndex(int32_t typeDefIndex) override;
            const Il2CppMethodDefinition* GetMethodDefinitionFromRawIndex(uint32_t index) override;
            void ReadFieldRefInfoFromFieldDefToken(uint32_t rowIndex, FieldRefInfo& ret) override;
        private:
            Il2CppType _defaultIl2CppType;
 
            std::vector<SuperSetTypeDefDetail> _typeDefs;
            Il2CppHashMap<int32_t, SuperSetTypeDefDetail*, il2cpp::utils::PassThroughHash<int32_t>> _aotTypeIndex2TypeDefs;
 
            Il2CppHashMap<uint32_t, SuperSetMethodDefDetail*, il2cpp::utils::PassThroughHash<uint32_t>> _token2MethodDefs;
            std::vector<SuperSetMethodDefDetail> _methodDefs;
 
            std::vector<SuperSetFieldDefDetail> _fields;
        };
    }
}