private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            if (HotKeyTag.Text == "")
            {
                HandyControl.Controls.Growl.Error(Application.Current.Resources["ChooseHotKeyPage_NoKeyHint"].ToString());
            }
            else if (int.Parse(OCRDelayBox.Text) <= 0)
            {
                HandyControl.Controls.Growl.Error(Application.Current.Resources["ChooseHotKeyPage_TooLessDelayHint"].ToString());
            }
            else
            {
                Common.UsingHotKey   = HotKey;
                Common.UsingOCRDelay = int.Parse(OCRDelayBox.Text);

                //存入数据库

                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this)
                {
                    XamlPath = "GuidePages/ChooseLanguagePage.xaml"
                };
                this.RaiseEvent(args);
            }
        }
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            if (HookFunListView.SelectedIndex != -1)
            {
                //先关闭对本窗口的输出
                Common.textHooker.HFRSevent -= DataRecvEventHandler;

                Common.textHooker.MisakaCodeList.Add(lstData[HookFunListView.SelectedIndex].MisakaHookCode);

                //Common.textHooker.DetachUnrelatedHookWhenDataRecv = Convert.ToBoolean(Common.appSettings.AutoDetach);
                //用户开启了自动卸载
                if (Convert.ToBoolean(Common.appSettings.AutoDetach) == true)
                {
                    List <string> usedHook = new List <string>();
                    usedHook.Add(lstData[HookFunListView.SelectedIndex].HookAddress);
                    Common.textHooker.DetachUnrelatedHooks(lstData[HookFunListView.SelectedIndex].GamePID, usedHook);
                }


                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/CompletationPage.xaml";
                this.RaiseEvent(args);
            }
        }
Beispiel #3
0
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            if (GamePid != -1)
            {
                if (SameNameGameProcessList.Count == 1)
                {
                    Common.textHooker = new TextHookHandle(lstProcess[(string)GameProcessCombox.SelectedValue]);
                }
                else
                {
                    Common.textHooker = new TextHookHandle(SameNameGameProcessList);
                }

                Common.textHooker.Init(!(bool)x64GameCheckBox.IsChecked);

                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/Hook/ChooseHookFuncPage.xaml";
                this.RaiseEvent(args);
            }
            else
            {
                HandyControl.Controls.Growl.Error("请先选择一个进程再进行下一步操作!");
            }
        }
Beispiel #4
0
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            //使用路由事件机制通知窗口来完成下一步操作
            PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);

            args.XamlPath = "GuidePages/OCR/ChooseHotKeyPage.xaml";
            this.RaiseEvent(args);
        }
Beispiel #5
0
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            Common.ocr.SetOCRArea((IntPtr)SelectedHwnd, OCRArea, isAllWin);

            //使用路由事件机制通知窗口来完成下一步操作
            PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);

            args.XamlPath = "GuidePages/OCR/ChooseHandleFuncPage.xaml";
            this.RaiseEvent(args);
        }
Beispiel #6
0
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            if (HookFunListView.SelectedIndex != -1)
            {
                string hookAdd = lstData[HookFunListView.SelectedIndex].HookAddress;
                int    pid     = int.Parse(lstData[HookFunListView.SelectedIndex].GamePID, System.Globalization.NumberStyles.HexNumber);

                //先关闭对本窗口的输出
                Common.textHooker.HFSevent -= DataRecvEventHandler;

                //先要将需要用到的方法注明,再进行后续卸载操作
                Common.textHooker.HookCodeList.Add(lstData[HookFunListView.SelectedIndex].HookCode);
                Common.textHooker.MisakaCodeList.Add(lstData[HookFunListView.SelectedIndex].MisakaHookCode);

                List <string> usedHook = new List <string>();
                usedHook.Add(hookAdd);

                //用户开启了自动卸载
                if (Convert.ToBoolean(Common.appSettings.AutoDetach) == true)
                {
                    Common.textHooker.DetachUnrelatedHooks(pid, usedHook);
                }

                int sum = 0;
                for (int i = 0; i < lstData.Count; i++)
                {
                    if (lstData[i].HookCode == lstData[HookFunListView.SelectedIndex].HookCode)
                    {
                        sum++;
                    }

                    if (sum >= 2)
                    {
                        //往数据库写信息,下一次游戏启动需要重新选方法

                        break;
                    }
                }

                //不满足的游戏也应该记录一下
                if (sum <= 1)
                {
                }


                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/Hook/ChooseTextRepairFuncPage.xaml";
                this.RaiseEvent(args);
            }
            else
            {
                HandyControl.Controls.Growl.Error("请选择一项Hook方法后进入下一步!");
            }
        }
Beispiel #7
0
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            Common.textHooker.Sevent -= DataRecvEventHandler;

            Common.UsingRepairFunc = TextRepair.lstRepairFun[lstRepairFun[RepairFuncCombox.SelectedIndex]];

            //写入数据库的去重方法


            //使用路由事件机制通知窗口来完成下一步操作
            PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);

            args.XamlPath = "GuidePages/ChooseLanguagePage.xaml";
            this.RaiseEvent(args);
        }
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            SQLHelper sqliteH = new SQLHelper();

            Common.textHooker.Sevent -= DataRecvEventHandler;

            Common.UsingRepairFunc = TextRepair.lstRepairFun[lstRepairFun[RepairFuncCombox.SelectedIndex]];

            //写入数据库的去重方法
            if (Common.GameID != -1)
            {
                switch (TextRepair.lstRepairFun[lstRepairFun[RepairFuncCombox.SelectedIndex]])
                {
                case "RepairFun_RemoveSingleWordRepeat":
                    sqliteH.ExecuteSql(
                        $"UPDATE game_library SET repair_func = '{Common.UsingRepairFunc}',repair_param_a = '{Common.repairSettings.SingleWordRepeatTimes}' WHERE gameid = {Common.GameID};");
                    break;

                case "RepairFun_RemoveSentenceRepeat":
                    sqliteH.ExecuteSql(
                        $"UPDATE game_library SET repair_func = '{Common.UsingRepairFunc}',repair_param_a = '{Common.repairSettings.SentenceRepeatFindCharNum}' WHERE gameid = {Common.GameID};");
                    break;

                case "RepairFun_RegexReplace":
                    sqliteH.ExecuteSql(
                        $"UPDATE game_library SET repair_func = '{Common.UsingRepairFunc}',repair_param_a = '{Common.repairSettings.Regex}',repair_param_b = '{Common.repairSettings.Regex_Replace}' WHERE gameid = {Common.GameID};");
                    break;

                default:
                    sqliteH.ExecuteSql(
                        $"UPDATE game_library SET repair_func = '{Common.UsingRepairFunc}' WHERE gameid = {Common.GameID};");
                    break;
                }
            }

            //使用路由事件机制通知窗口来完成下一步操作
            PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);

            args.XamlPath = "GuidePages/ChooseLanguagePage.xaml";
            this.RaiseEvent(args);
        }
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            if (GamePid != -1)
            {
                if (SameNameGameProcessList.Count == 1)
                {
                    Common.textHooker = new TextHookHandle(lstProcess[(string)GameProcessCombox.SelectedValue]);
                }
                else
                {
                    Common.textHooker = new TextHookHandle(SameNameGameProcessList);
                }

                if (!Common.textHooker.Init(!(bool)x64GameCheckBox.IsChecked))
                {
                    HandyControl.Controls.MessageBox.Show(Application.Current.Resources["MainWindow_TextractorError_Hint"].ToString());
                    return;
                }

                Common.GameID = -1;
                string filepath = ProcessHelper.FindProcessPath(GamePid);
                if (filepath != "")
                {
                    Common.GameID = GameLibraryHelper.GetGameID(filepath);
                }
                SQLHelper sqliteH = new SQLHelper();
                sqliteH.ExecuteSql(
                    $"UPDATE game_library SET isx64 = '{x64GameCheckBox.IsChecked}' WHERE gameid = {Common.GameID};");


                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/Hook/ChooseHookFuncPage.xaml";
                this.RaiseEvent(args);
            }
            else
            {
                HandyControl.Controls.Growl.Error(Application.Current.Resources["ChooseGamePage_NextErrorHint"].ToString());
            }
        }
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            if (HotKeyTag.Text == "")
            {
                HandyControl.Controls.Growl.Error("请设置一个触发键");
            }
            else if (int.Parse(OCRDelayBox.Text) <= 0)
            {
                HandyControl.Controls.Growl.Error("延时时间必须大于0毫秒");
            }
            else
            {
                Common.UsingHotKey   = HotKey;
                Common.UsingOCRDelay = int.Parse(OCRDelayBox.Text);

                //存入数据库

                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/ChooseLanguagePage.xaml";
                this.RaiseEvent(args);
            }
        }
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            if (GamePid != -1)
            {
                if (SameNameGameProcessList.Count == 1)
                {
                    Common.textHooker = new TextHookHandle(lstProcess[(string)GameProcessCombox.SelectedValue]);
                }
                else
                {
                    Common.textHooker = new TextHookHandle(SameNameGameProcessList);
                }

                Common.textHooker.Init(!(bool)x64GameCheckBox.IsChecked);


                Common.GameID = -1;
                string filepath = Common.FindProcessPath(GamePid);
                if (filepath != "")
                {
                    Common.GameID = GameLibraryHelper.GetGameID(filepath);
                }
                SQLHelper sqliteH = new SQLHelper();
                sqliteH.ExecuteSql(string.Format("UPDATE game_library SET isx64 = '{0}' WHERE gameid = {1};", x64GameCheckBox.IsChecked, Common.GameID));


                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/Hook/ChooseHookFuncPage.xaml";
                this.RaiseEvent(args);
            }
            else
            {
                HandyControl.Controls.Growl.Error("请先选择一个进程再进行下一步操作!");
            }
        }
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            if (HookFunListView.SelectedIndex != -1)
            {
                SQLHelper sqliteH = new SQLHelper();

                string hookAdd = lstData[HookFunListView.SelectedIndex].HookAddress;
                int    pid     = lstData[HookFunListView.SelectedIndex].GamePID;

                //先关闭对本窗口的输出
                Common.textHooker.HFSevent -= DataRecvEventHandler;

                //先要将需要用到的方法注明,再进行后续卸载操作
                Common.textHooker.HookCodeList.Add(lstData[HookFunListView.SelectedIndex].HookCode);
                Common.textHooker.MisakaCodeList.Add(lstData[HookFunListView.SelectedIndex].MisakaHookCode);

                List <string> usedHook = new List <string>();
                usedHook.Add(hookAdd);

                //用户开启了自动卸载
                if (Convert.ToBoolean(Common.appSettings.AutoDetach) == true)
                {
                    Common.textHooker.DetachUnrelatedHooks(pid, usedHook);
                }

                int sum = 0;
                for (int i = 0; i < lstData.Count; i++)
                {
                    if (lstData[i].HookCode == lstData[HookFunListView.SelectedIndex].HookCode)
                    {
                        sum++;
                    }

                    if (sum >= 2)
                    {
                        //往数据库写信息,下一次游戏启动需要重新选方法
                        if (Common.GameID != -1)
                        {
                            sqliteH.ExecuteSql(
                                $"UPDATE game_library SET isMultiHook = '{"True"}' WHERE gameid = {Common.GameID};");
                        }

                        break;
                    }
                }

                //不满足的游戏也应该记录一下
                if (sum <= 1)
                {
                    if (Common.GameID != -1)
                    {
                        sqliteH.ExecuteSql(
                            $"UPDATE game_library SET isMultiHook = '{"False"}' WHERE gameid = {Common.GameID};");
                    }
                }

                if (Common.GameID != -1)
                {
                    sqliteH.ExecuteSql($"UPDATE game_library SET transmode = {"1"} WHERE gameid = {Common.GameID};");
                    sqliteH.ExecuteSql(
                        $"UPDATE game_library SET hookcode = '{lstData[HookFunListView.SelectedIndex].HookCode}' WHERE gameid = {Common.GameID};");

                    if (LastCustomHookCode != "NULL")
                    {
                        MessageBoxResult result = HandyControl.Controls.MessageBox.Show(
                            Application.Current.Resources["ChooseHookFuncPage_MBOX_hookcodeConfirm_left"] + "\n" + LastCustomHookCode + "\n" + Application.Current.Resources["ChooseHookFuncPage_MBOX_hookcodeConfirm_right"],
                            Application.Current.Resources["MessageBox_Ask"].ToString(),
                            MessageBoxButton.YesNoCancel,
                            MessageBoxImage.Question);

                        if (result == MessageBoxResult.Yes)
                        {
                            //记录这个特殊码到数据库
                            sqliteH.ExecuteSql(
                                $"UPDATE game_library SET hookcode_custom = '{LastCustomHookCode}' WHERE gameid = {Common.GameID};");
                        }
                        else if (result == MessageBoxResult.No)
                        {
                            //返回界面,否则会自动进入下一个界面
                            return;
                        }
                        else
                        {
                            //不记录特殊码,但也要写NULL
                            sqliteH.ExecuteSql(
                                $"UPDATE game_library SET hookcode_custom = '{"NULL"}' WHERE gameid = {Common.GameID};");
                        }
                    }
                    else
                    {
                        sqliteH.ExecuteSql(
                            $"UPDATE game_library SET hookcode_custom = '{"NULL"}' WHERE gameid = {Common.GameID};");
                    }
                }

                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this)
                {
                    XamlPath = "GuidePages/Hook/ChooseTextRepairFuncPage.xaml"
                };
                this.RaiseEvent(args);
            }
            else
            {
                HandyControl.Controls.Growl.Error(Application.Current.Resources["ChooseHookFuncPage_NextErrorHint"].ToString());
            }
        }
        private void ConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            if (HookFunListView.SelectedIndex != -1)
            {
                SQLHelper sqliteH = new SQLHelper();

                string hookAdd = lstData[HookFunListView.SelectedIndex].HookAddress;
                int    pid     = lstData[HookFunListView.SelectedIndex].GamePID;

                //先关闭对本窗口的输出
                Common.textHooker.HFSevent -= DataRecvEventHandler;

                //先要将需要用到的方法注明,再进行后续卸载操作
                Common.textHooker.HookCodeList.Add(lstData[HookFunListView.SelectedIndex].HookCode);
                Common.textHooker.MisakaCodeList.Add(lstData[HookFunListView.SelectedIndex].MisakaHookCode);

                List <string> usedHook = new List <string>();
                usedHook.Add(hookAdd);

                //用户开启了自动卸载
                if (Convert.ToBoolean(Common.appSettings.AutoDetach) == true)
                {
                    Common.textHooker.DetachUnrelatedHooks(pid, usedHook);
                }

                int sum = 0;
                for (int i = 0; i < lstData.Count; i++)
                {
                    if (lstData[i].HookCode == lstData[HookFunListView.SelectedIndex].HookCode)
                    {
                        sum++;
                    }

                    if (sum >= 2)
                    {
                        //往数据库写信息,下一次游戏启动需要重新选方法
                        if (Common.GameID != -1)
                        {
                            sqliteH.ExecuteSql(string.Format("UPDATE game_library SET isMultiHook = '{0}' WHERE gameid = {1};", "True", Common.GameID));
                        }

                        break;
                    }
                }

                //不满足的游戏也应该记录一下
                if (sum <= 1)
                {
                    if (Common.GameID != -1)
                    {
                        sqliteH.ExecuteSql(string.Format("UPDATE game_library SET isMultiHook = '{0}' WHERE gameid = {1};", "False", Common.GameID));
                    }
                }

                if (Common.GameID != -1)
                {
                    sqliteH.ExecuteSql(string.Format("UPDATE game_library SET transmode = {0} WHERE gameid = {1};", "1", Common.GameID));
                    sqliteH.ExecuteSql(string.Format("UPDATE game_library SET hookcode = '{0}' WHERE gameid = {1};", lstData[HookFunListView.SelectedIndex].HookCode, Common.GameID));
                }

                //使用路由事件机制通知窗口来完成下一步操作
                PageChangeRoutedEventArgs args = new PageChangeRoutedEventArgs(PageChange.PageChangeRoutedEvent, this);
                args.XamlPath = "GuidePages/Hook/ChooseTextRepairFuncPage.xaml";
                this.RaiseEvent(args);
            }
            else
            {
                HandyControl.Controls.Growl.Error("请选择一项Hook方法后进入下一步!");
            }
        }