Ejemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var logger   = new TextboxLogger();
            var injector = new Injector(logger);

            var  injectorForm      = new InjectorForm(injector);
            Form injectorDebugForm = new InjectorDebugForm(injector, logger)
            {
                SwitchForm = injectorForm
            };

            injectorForm.SwitchForm = injectorDebugForm;

            var startedForm = ConfigurationManager.AppSettings["StartedForm"] == "debug"
                ? injectorDebugForm : injectorForm;

            startedForm.Show();

            Application.ApplicationExit += (object sender, EventArgs e) =>
            {
                if (injector.Injected)
                {
                    injector.Close();
                }
            };

            Application.Run();
        }
Ejemplo n.º 2
0
 private void InjectorForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (injector.Injected)
     {
         injector.Close();
     }
 }
Ejemplo n.º 3
0
        private void btnDetach_Click(object sender, EventArgs e)
        {
            injector.Close();

            btnInject.Enabled = true;
            btnDetach.Enabled = false;
        }
Ejemplo n.º 4
0
 private void btnInjectSwitch_Click(object sender, EventArgs e)
 {
     if (!injector.Injected)
     {
         try
         {
             injector.Parameter.DirectXVersion = DirectXVersion.D3D9;
             injector.Inject("Europa_Client");
             btnInjectSwitch.Text = "关闭";
         }
         catch (AppException ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         injector.Close();
         btnInjectSwitch.Text = "开启";
     }
 }