diff --git a/Il2CppInspector.Common/Model/AppModel.cs b/Il2CppInspector.Common/Model/AppModel.cs index 59822fc..d7127e7 100644 --- a/Il2CppInspector.Common/Model/AppModel.cs +++ b/Il2CppInspector.Common/Model/AppModel.cs @@ -40,6 +40,9 @@ namespace Il2CppInspector.Model // The types are ordered to enable the production of code output without forward dependencies public List DependencyOrderedCppTypes { get; private set; } + // Required forward definition types for the C++ type definitions + public List RequiredForwardDefinitions { get; private set; } = []; + // Composite mapping of all the .NET methods in the IL2CPP binary public MultiKeyDictionary Methods { get; } = new MultiKeyDictionary(); @@ -247,7 +250,7 @@ namespace Il2CppInspector.Model break; } - AddTypes(declarationGenerator.GenerateRemainingTypeDeclarations()); + AddTypes(definitions); // Any method here SHOULD already be in the Methods list // but we have seen one example where this is not the case for a MethodDef @@ -305,6 +308,8 @@ namespace Il2CppInspector.Model declarationGenerator.IncludeType(type); AddTypes(declarationGenerator.GenerateRemainingTypeDeclarations()); + RequiredForwardDefinitions = declarationGenerator.GenerateRequiredForwardDefinitions(); + // Restore stdout Console.SetOut(stdout);