Plugins: Add PreProcessBinary, PostProcessBinary, PostProcessAppModel

This commit is contained in:
Katy Coe
2020-12-29 21:32:54 +01:00
parent 3e3818a2ed
commit 0ce0bbe74d
3 changed files with 8 additions and 5 deletions

View File

@@ -259,7 +259,8 @@ namespace Il2CppInspector
CodeRegistration = Image.ReadMappedObject<Il2CppCodeRegistration>(codeRegistration); CodeRegistration = Image.ReadMappedObject<Il2CppCodeRegistration>(codeRegistration);
MetadataRegistration = Image.ReadMappedObject<Il2CppMetadataRegistration>(metadataRegistration); MetadataRegistration = Image.ReadMappedObject<Il2CppMetadataRegistration>(metadataRegistration);
// TODO: Plugin hook PreProcessBinary // Plugin hook to pre-process binary
isModified |= PluginHooks.PreProcessBinary(this).IsStreamModified;
// Do basic validatation that MetadataRegistration and CodeRegistration are sane // Do basic validatation that MetadataRegistration and CodeRegistration are sane
/* /*
@@ -381,7 +382,8 @@ namespace Il2CppInspector
GenericMethodInvokerIndices.Add(MethodSpecs[tableEntry.genericMethodIndex], tableEntry.indices.invokerIndex); GenericMethodInvokerIndices.Add(MethodSpecs[tableEntry.genericMethodIndex], tableEntry.indices.invokerIndex);
} }
// TODO: Plugin hook PostProcessBinary // Plugin hook to pre-process binary
isModified |= PluginHooks.PostProcessBinary(this).IsStreamModified;
} }
// IL2CPP API exports // IL2CPP API exports

View File

@@ -177,7 +177,7 @@ namespace Il2CppInspector
// Get all metadata strings // Get all metadata strings
var pluginGetStringsResult = PluginHooks.GetStrings(this); var pluginGetStringsResult = PluginHooks.GetStrings(this);
if (pluginGetStringsResult.FullyProcessed && !pluginGetStringsResult.IsInvalid) if (pluginGetStringsResult.IsDataModified && !pluginGetStringsResult.IsInvalid)
Strings = pluginGetStringsResult.Strings; Strings = pluginGetStringsResult.Strings;
else { else {
@@ -247,7 +247,7 @@ namespace Il2CppInspector
// Get all string literals // Get all string literals
var pluginGetStringLiteralsResult = PluginHooks.GetStringLiterals(this); var pluginGetStringLiteralsResult = PluginHooks.GetStringLiterals(this);
if (pluginGetStringLiteralsResult.FullyProcessed) if (pluginGetStringLiteralsResult.IsDataModified)
StringLiterals = pluginGetStringLiteralsResult.StringLiterals.ToArray(); StringLiterals = pluginGetStringLiteralsResult.StringLiterals.ToArray();
else { else {

View File

@@ -272,7 +272,8 @@ namespace Il2CppInspector.Model
// Restore stdout // Restore stdout
Console.SetOut(stdout); Console.SetOut(stdout);
// TODO: Plugin hook PostProcessAppModel // Plugin hook to post-process model
PluginHooks.PostProcessAppModel(this);
// This is to allow this method to be chained after a new expression // This is to allow this method to be chained after a new expression
return this; return this;