public override bool Initialize(IPluginHost pluginHost)
        {
            System.Diagnostics.Debugger.Launch();

            if (host != null)
            {
                Terminate();
            }

            if (pluginHost == null)
            {
                throw new ArgumentNullException(nameof(pluginHost));
            }

            host = pluginHost;

            engine = Python.CreateEngine();
            engine.Runtime.LoadAssembly(typeof(IntPtr).Assembly);             // System.dll
            engine.Runtime.LoadAssembly(typeof(Program).Assembly);            // ReClass.NET.exe

            var scriptingMenuItem = new ToolStripMenuItem("Scripts");

            var editorMenuItem = new ToolStripMenuItem("Editor");

            editorMenuItem.Click += (sender, args) =>
            {
                using (var sef = new ScriptEditorForm(new List <ScriptContent>()))
                {
                    sef.ShowDialog();
                }
            };
            scriptingMenuItem.DropDownItems.Add(editorMenuItem);

            var testMenuItem = new ToolStripMenuItem("Test");

            testMenuItem.Click += (sender, args) =>
            {
                /*var expression = @"data = process.ReadRemoteMemory(IntPtr(0xFFD20000), 4)
                 *
                 * logger.Log(LogLevel.Error, str(data[0]))
                 * logger.Log(LogLevel.Error, str(data[1]))";*/

                var expression =
                    @"for m in process.Modules:
	logger.Log(LogLevel.Error, m.Name)"    ;

                try
                {
                    ExecuteScript(expression);
                }
                catch (Exception e)
                {
                    Program.ShowException(e);
                }
            };
            scriptingMenuItem.DropDownItems.Add(testMenuItem);

            host.MainWindow.MainMenu.Items.Insert(3, scriptingMenuItem);

            return(true);
        }
コード例 #2
0
 public void Initialize(ScriptEditorForm form)
 {
 }