diff --git a/Il2CppInspector.Common/Outputs/CppDeclarations.cs b/Il2CppInspector.Common/Outputs/CppDeclarations.cs index 4b6496b..1e21a98 100644 --- a/Il2CppInspector.Common/Outputs/CppDeclarations.cs +++ b/Il2CppInspector.Common/Outputs/CppDeclarations.cs @@ -52,7 +52,7 @@ namespace Il2CppInspector.Outputs } } - private string AsCType(TypeInfo ti) { + public string AsCType(TypeInfo ti) { // IsArray case handled by TypeNamer.GetName if (ti.IsByRef || ti.IsPointer) { return $"{AsCType(ti.ElementType)} *"; diff --git a/Il2CppInspector.Common/Outputs/IDAPythonScript.cs b/Il2CppInspector.Common/Outputs/IDAPythonScript.cs index bacf783..be9891f 100644 --- a/Il2CppInspector.Common/Outputs/IDAPythonScript.cs +++ b/Il2CppInspector.Common/Outputs/IDAPythonScript.cs @@ -144,6 +144,7 @@ typedef __int64 int64_t; return; } + var stringType = typeGenerator.AsCType(model.TypesByFullName["System.String"]); foreach (var usage in model.Package.MetadataUsages) { var address = usage.VirtualAddress; string name; @@ -151,7 +152,7 @@ typedef __int64 int64_t; switch (usage.Type) { case MetadataUsageType.StringLiteral: var str = model.GetMetadataUsageName(usage); - writeName(address, $"StringLiteral_{stringToIdentifier(str)}"); + writeTypedName(address, stringType, $"StringLiteral_{stringToIdentifier(str)}"); writeComment(address, str); break; case MetadataUsageType.Type: