Exemple #1
0
        private void AddRGCTX(StructInfo structInfo, Il2CppTypeDefinition typeDef)
        {
            var imageIndex = typeDefImageIndices[typeDef];
            var collection = executor.GetTypeRGCTXDefinition(typeDef, imageIndex);

            if (collection != null)
            {
                foreach (var definitionData in collection)
                {
                    var structRGCTXInfo = new StructRGCTXInfo();
                    structInfo.RGCTXs.Add(structRGCTXInfo);
                    structRGCTXInfo.Type = definitionData.type;
                    switch (definitionData.type)
                    {
                    case Il2CppRGCTXDataType.IL2CPP_RGCTX_DATA_TYPE:
                    {
                        var il2CppType = il2Cpp.types[definitionData.data.typeIndex];
                        structRGCTXInfo.TypeName = FixName(executor.GetTypeName(il2CppType, true, false));
                        break;
                    }

                    case Il2CppRGCTXDataType.IL2CPP_RGCTX_DATA_CLASS:
                    {
                        var il2CppType = il2Cpp.types[definitionData.data.typeIndex];
                        structRGCTXInfo.ClassName = FixName(executor.GetTypeName(il2CppType, true, false));
                        break;
                    }

                    case Il2CppRGCTXDataType.IL2CPP_RGCTX_DATA_METHOD:
                    {
                        var methodSpec = il2Cpp.methodSpecs[definitionData.data.methodIndex];
                        (var methodSpecTypeName, var methodSpecMethodName) = executor.GetMethodSpecName(methodSpec, true);
                        structRGCTXInfo.MethodName = FixName(methodSpecTypeName + "." + methodSpecMethodName);
                        break;
                    }
                    }
                }
            }
        }