Plugins: Add PostProcessMetadata hook
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Il2CppInspector
|
||||
{
|
||||
public class Metadata : BinaryObjectReader
|
||||
{
|
||||
public Il2CppGlobalMetadataHeader Header;
|
||||
public Il2CppGlobalMetadataHeader Header { get; set; }
|
||||
|
||||
public Il2CppAssemblyDefinition[] Assemblies { get; }
|
||||
public Il2CppImageDefinition[] Images { get; }
|
||||
@@ -217,6 +217,9 @@ namespace Il2CppInspector
|
||||
StringLiterals = new string[stringLiteralList.Length];
|
||||
for (var i = 0; i < stringLiteralList.Length; i++)
|
||||
StringLiterals[i] = ReadFixedLengthString(Header.stringLiteralDataOffset + stringLiteralList[i].dataIndex, stringLiteralList[i].length);
|
||||
|
||||
// Post-processing hook
|
||||
PluginHooks.PostProcessMetadata(this);
|
||||
}
|
||||
|
||||
// Save metadata to file, overwriting if necessary
|
||||
|
||||
17
Il2CppInspector.Common/Plugins/PluginHooks.cs
Normal file
17
Il2CppInspector.Common/Plugins/PluginHooks.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
|
||||
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
// This is the ONLY line to update when the API version changes
|
||||
using Il2CppInspector.PluginAPI.V100;
|
||||
|
||||
namespace Il2CppInspector
|
||||
{
|
||||
// Hooks we provide to plugins which can choose whether or not to provide implementations
|
||||
internal static class PluginHooks
|
||||
{
|
||||
public static void PostProcessMetadata(Metadata metadata) => PluginManager.Try<IPostProcessMetadata>(p => p.PostProcessMetadata(metadata));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user