diff --git a/Hybrid/SamplePluginHybrid.rc b/Hybrid/SamplePluginHybrid.rc index 7fde86d..88e7afc 100644 Binary files a/Hybrid/SamplePluginHybrid.rc and b/Hybrid/SamplePluginHybrid.rc differ diff --git a/Hybrid/SamplePluginHybrid.vcxproj b/Hybrid/SamplePluginHybrid.vcxproj index 5949b7b..847c6e6 100644 --- a/Hybrid/SamplePluginHybrid.vcxproj +++ b/Hybrid/SamplePluginHybrid.vcxproj @@ -20,37 +20,37 @@ {7E56DBB6-453E-48FA-B70E-62CA46BD0BB4} - v4.6.1 + v4.7.2 ManagedCProj SamplePluginHybrid - 10.0.16299.0 + 10.0 DynamicLibrary true - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode DynamicLibrary true - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode diff --git a/Hybrid/SamplePluginHybridExt.cpp b/Hybrid/SamplePluginHybridExt.cpp index 53a3de6..b3fd1dd 100644 --- a/Hybrid/SamplePluginHybridExt.cpp +++ b/Hybrid/SamplePluginHybridExt.cpp @@ -7,24 +7,26 @@ namespace SamplePluginHybrid { this->host = host; - // Register a node info reader to display custom data on nodes. - reader = gcnew SampleNodeInfoReader; - - host->RegisterNodeInfoReader(reader); - return true; } /// This method gets called when ReClass.NET unloads the plugin. void SamplePluginHybridExt::Terminate() { - host->DeregisterNodeInfoReader(reader); - host = nullptr; } + IReadOnlyList^ SamplePluginHybridExt::GetNodeInfoReaders() + { + // Register a node info reader to display custom data on nodes. + + auto reader = gcnew List(); + reader->Add(gcnew SampleNodeInfoReader); + return reader; + } + /// This method lets ReClass.NET print the name and the value of the node. - String^ SampleNodeInfoReader::ReadNodeInfo(BaseNode^ node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer^ memory) + String^ SampleNodeInfoReader::ReadNodeInfo(BaseHexCommentNode^ node, IRemoteMemoryReader^ reader, MemoryBuffer^ memory, IntPtr nodeAddress, IntPtr nodeValue) { return node->Name + "@" + nodeAddress.ToString("X") + " => " + nodeValue.ToString("X"); } diff --git a/Hybrid/SamplePluginHybridExt.h b/Hybrid/SamplePluginHybridExt.h index 7d3a974..4f31172 100644 --- a/Hybrid/SamplePluginHybridExt.h +++ b/Hybrid/SamplePluginHybridExt.h @@ -1,6 +1,7 @@ #pragma once using namespace System; +using namespace System::Collections::Generic; using namespace ReClassNET; using namespace ReClassNET::Memory; using namespace ReClassNET::Nodes; @@ -15,6 +16,7 @@ namespace SamplePluginHybrid public: virtual bool Initialize(IPluginHost^ host) override; virtual void Terminate() override; + virtual IReadOnlyList^ GetNodeInfoReaders() override; private: IPluginHost^ host; @@ -24,6 +26,6 @@ namespace SamplePluginHybrid public ref class SampleNodeInfoReader : INodeInfoReader { public: - virtual String^ ReadNodeInfo(BaseNode^ node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer^ memory); + virtual String^ ReadNodeInfo(BaseHexCommentNode^ node, IRemoteMemoryReader^ reader, MemoryBuffer^ memory, IntPtr nodeAddress, IntPtr nodeValue); }; } diff --git a/Managed/SamplePluginManaged.csproj b/Managed/SamplePluginManaged.csproj index fb02280..f913fe4 100644 --- a/Managed/SamplePluginManaged.csproj +++ b/Managed/SamplePluginManaged.csproj @@ -9,8 +9,9 @@ Properties SamplePluginManaged SamplePluginManaged - v4.6.1 + v4.7.2 512 + x86 diff --git a/Managed/SamplePluginManagedExt.cs b/Managed/SamplePluginManagedExt.cs index 150cb27..5a6c7e0 100644 --- a/Managed/SamplePluginManagedExt.cs +++ b/Managed/SamplePluginManagedExt.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -15,7 +16,6 @@ namespace SamplePluginManaged public class SamplePluginManagedExt : Plugin { private IPluginHost host; - private INodeInfoReader reader; /// The icon to display in the plugin manager form. public override Image Icon => null; @@ -28,11 +28,6 @@ public override bool Initialize(IPluginHost host) // Notfiy the plugin if a window is shown. GlobalWindowManager.WindowAdded += OnWindowAdded; - // Register a node info reader to display custom data on nodes. - reader = new SampleNodeInfoReader(); - - host.RegisterNodeInfoReader(reader); - return true; } @@ -41,13 +36,18 @@ public override void Terminate() { // Clean up what you have registered. - host.DeregisterNodeInfoReader(reader); - GlobalWindowManager.WindowAdded -= OnWindowAdded; host = null; } + public override IReadOnlyList GetNodeInfoReaders() + { + // Register a node info reader to display custom data on nodes. + + return new[] { new SampleNodeInfoReader() }; + } + /// /// This method gets called when a new windows is opened. /// You can use this function to add a settings panel into the settings dialog for example. @@ -97,7 +97,7 @@ private void OnWindowAdded(object sender, GlobalWindowManagerEventArgs e) public class SampleNodeInfoReader : INodeInfoReader { /// This method lets ReClass.NET print the name and the value of the node. - public string ReadNodeInfo(BaseNode node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer memory) + public string ReadNodeInfo(BaseHexCommentNode node, IRemoteMemoryReader reader, MemoryBuffer memory, IntPtr nodeAddress, IntPtr nodeValue) { return $"{node.Name}@{nodeAddress.ToString("X")} => {nodeValue.ToString("X")}"; } diff --git a/Native/SamplePlugin.vcxproj b/Native/SamplePlugin.vcxproj index c6013ea..6f1ca8a 100644 --- a/Native/SamplePlugin.vcxproj +++ b/Native/SamplePlugin.vcxproj @@ -22,33 +22,33 @@ {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F} Win32Proj SamplePlugin - 10.0.16299.0 + 10.0 SamplePluginNative DynamicLibrary true - v141 + v142 MultiByte DynamicLibrary false - v141 + v142 true MultiByte DynamicLibrary true - v141 + v142 MultiByte DynamicLibrary false - v141 + v142 true MultiByte