diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs index e731a1a..78a45cc 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs @@ -159,7 +159,7 @@ namespace Il2CppInspector return usages.Values.ToList(); } - public List buildLateBindingMetadataUsages() + private List buildLateBindingMetadataUsages() { // plagiarism. noun - https://www.lexico.com/en/definition/plagiarism // the practice of taking someone else's work or ideas and passing them off as one's own. @@ -314,7 +314,8 @@ namespace Il2CppInspector // Merge all metadata usage references into a single distinct list MetadataUsages = buildMetadataUsages(); - // TODO: Plugin hook PostProcessPackage + // Plugin hook PostProcessPackage + PluginHooks.PostProcessPackage(this); } // Get a method pointer if available diff --git a/Il2CppInspector.Common/Plugins/API/V100/Hooks.cs b/Il2CppInspector.Common/Plugins/API/V100/Hooks.cs index 35b66ea..da21d0f 100644 --- a/Il2CppInspector.Common/Plugins/API/V100/Hooks.cs +++ b/Il2CppInspector.Common/Plugins/API/V100/Hooks.cs @@ -44,6 +44,14 @@ namespace Il2CppInspector.PluginAPI.V100 void GetStringLiterals(Metadata metadata, PluginGetStringLiteralsEventInfo data); } + /// + /// Post-process the entire IL2CPP application package after the metadata and binary have been loaded and merged + /// + public interface IPostProcessPackage + { + void PostProcessPackage(Il2CppInspector package, PluginPostProcessPackageEventInfo data); + } + /// /// Post-process the .NET type model to make changes after it has been fully created /// diff --git a/Il2CppInspector.Common/Plugins/API/V100/PluginEventInfo.cs b/Il2CppInspector.Common/Plugins/API/V100/PluginEventInfo.cs index b0c2ae6..d3b2861 100644 --- a/Il2CppInspector.Common/Plugins/API/V100/PluginEventInfo.cs +++ b/Il2CppInspector.Common/Plugins/API/V100/PluginEventInfo.cs @@ -88,6 +88,11 @@ namespace Il2CppInspector.PluginAPI.V100 public List StringLiterals { get; set; } = new List(); } + /// + /// Event info for PostProcessPackage + /// + public class PluginPostProcessPackageEventInfo : PluginEventInfo { } + /// /// Event info for PostProcessTypeModel /// diff --git a/Il2CppInspector.Common/Plugins/PluginHooks.cs b/Il2CppInspector.Common/Plugins/PluginHooks.cs index 04ceaca..78a1544 100644 --- a/Il2CppInspector.Common/Plugins/PluginHooks.cs +++ b/Il2CppInspector.Common/Plugins/PluginHooks.cs @@ -30,6 +30,9 @@ namespace Il2CppInspector public static PluginGetStringLiteralsEventInfo GetStringLiterals(Metadata metadata) => PluginManager.Try((p, e) => p.GetStringLiterals(metadata, e)); + public static PluginPostProcessPackageEventInfo PostProcessPackage(Il2CppInspector package) + => PluginManager.Try((p, e) => p.PostProcessPackage(package, e)); + public static PluginPostProcessTypeModelEventInfo PostProcessTypeModel(TypeModel typeModel) => PluginManager.Try((p, e) => p.PostProcessTypeModel(typeModel, e));