diff --git a/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs b/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs index f2258da..ef77200 100644 --- a/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs +++ b/Il2CppInspector.Common/Cpp/CppDeclarationGenerator.cs @@ -102,7 +102,7 @@ namespace Il2CppInspector.Cpp private void VisitFieldStructs(TypeInfo ti) { if (VisitedFieldStructs.Contains(ti)) return; - if (ti.IsByRef || ti.IsPointer || ti.ContainsGenericParameters) + if (ti.IsByRef || ti.ContainsGenericParameters) return; VisitedFieldStructs.Add(ti); diff --git a/Il2CppInspector.Common/Model/AppModel.cs b/Il2CppInspector.Common/Model/AppModel.cs index 4ffc957..a9bd61e 100644 --- a/Il2CppInspector.Common/Model/AppModel.cs +++ b/Il2CppInspector.Common/Model/AppModel.cs @@ -178,22 +178,8 @@ namespace Il2CppInspector.Model AddTypes(declarationGenerator.GenerateRemainingTypeDeclarations()); if (usage.Type == MetadataUsageType.TypeInfo) - // .NET unsafe pointer type that has not been mapped by IL2CPP to a C type - // (often void* or byte* in metadata v23 and v24.0) - if (!Types.ContainsKey(type)) { - Debug.Assert(type.IsPointer); - - // TODO: This should really be handled by CppDeclarationGenerator, and doesn't generate the full definition - var cppType = CppTypeCollection.Struct(declarationGenerator.TypeNamer.GetName(type)); - var cppObjectType = (CppComplexType) CppTypeCollection["Il2CppObject"]; - cppType.Fields = new SortedDictionary>(cppObjectType.Fields); - - DependencyOrderedCppTypes.Add(cppType); - Types.Add(type, cppType, new AppType(type, cppType, cppClassPtr: address) {Group = Group}); - } - else - // Regular type definition - Types[type].TypeClassAddress = address; + // Regular type definition + Types[type].TypeClassAddress = address; else if (!Types.ContainsKey(type)) // Generic type definition has no associated C++ type, therefore no dictionary sub-key diff --git a/Il2CppInspector.Common/Reflection/Extensions.cs b/Il2CppInspector.Common/Reflection/Extensions.cs index b23bbe8..5491f81 100644 --- a/Il2CppInspector.Common/Reflection/Extensions.cs +++ b/Il2CppInspector.Common/Reflection/Extensions.cs @@ -85,6 +85,8 @@ namespace Il2CppInspector.Reflection } public static string ToCIdentifier(this string str) { + // replace * with Ptr + str = str.Replace("*", "Ptr"); // replace illegal characters str = Regex.Replace(str, "[^a-zA-Z0-9_]", "_"); // ensure identifier starts with a letter or _ (and is non-empty)