Skip to content

Plugins: Reporting call results

Katy edited this page Jan 4, 2021 · 2 revisions

Reporting call results

Each plugin hook receives an object derived from PluginEventInfo which you can use to report results to Il2CppInspector.

Every such object implements at least four boolean properties which you should set appropriately at the end of each hook call. The default for each option is false. You can set these on any hook call and the current state of the PluginEventInfo object will be forwarded to the next plugin in the chain, allowing them to determine the current state of the data if required. Some objects such as PluginPreProcessMetadataEventInfo have additional reporting properties.

IsInvalid

If your plugin is designed to handle the supplied data and attempted to process it but could not complete successfully, set IsInvalid.

Note that this is different from throwing an exception. For example, if you attempt to perform some decryption but the decryption function fails without modifying the underlying data, throw an exception. If the decryption function succeeds but the resulting modified data is not correctly decrypted, set IsInvalid.

IsDataModified

If your plugin modifies the provided in-memory data structures, ie. arrays, objects or structs used by Il2CppInspector, set IsDataModified. Do not set this if you modify the raw streams representing the loaded files without modifying the already-loaded data structures, or if you only query the data (read-only operations) or create new, separate data in your plugin not used by Il2CppInspector directly.

IsStreamModified

If your plugin modifies the underlying stream for the IL2CPP metadata or binary, set IsStreamModified. Do not set this if you only read data from the underlying streams. Enabling this option will also enable the button to save the modified file in the Il2CppInspector GUI.

FullyProcessed

A plugin should set this if it has processed the supplied data in such a way that demands no further processing is performed by other plugins in the chain, to prevent unexpected behaviour or crashes. This will prevent other plugins from receiving the hook call. If you must set this, note that this should be done even if the processed data was invalid (IsInvalid == true, see above).

If this is not set, the same event will be raised on the next available plugin.

Generally, you should do processing but leave FullyProcessed as false to allow additional processing from other plugins.

IL2CPPINSPECTOR WIKI

Plugin Development

Tutorials & Guides

Example plugins

Il2CppInspectorPlugins repository

IL2CPP Articles on Katy's blog

Support

If you find Il2CppInspector useful, please consider supporting its continued development - or just buy me some cookies!

Donate via PayPal

Donate via BTC: 3FoRUqUXgYj8NY8sMQfhX6vv9LqR3e2kzz

Thank you!

Clone this wiki locally