コード例 #1
0
        private void B_WriteCurrent_Click(object sender, EventArgs e)
        {
            var offset = StringUtil.GetHexValue(RamOffset.Text);

            if (offset == 0)
            {
                WinFormsUtil.Error(MessageStrings.MsgInvalidHexValue);
                return;
            }

            Injector.SetWriteOffset(offset);

            try
            {
                var result = Injector.Write(true);
                if (result == InjectionResult.Success)
                {
                    return;
                }
                WinFormsUtil.Alert(result.ToString());
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
            {
                WinFormsUtil.Error(ex.Message);
            }
            TurnOffAuto();
        }
コード例 #2
0
ファイル: SysBotUI.cs プロジェクト: xenfye/NHSE
        private void ReadUSB_Click(object sender, EventArgs e)
        {
            if (!BotUSB.Connect())
            {
                return;
            }

            var offset = StringUtil.GetHexValue(RamOffsetUSB.Text);

            if (offset == 0)
            {
                WinFormsUtil.Error(MessageStrings.MsgInvalidHexValue);
                return;
            }

            InjectorUSB.SetWriteOffset(offset);

            try
            {
                var result = InjectorUSB.Read(true);
                if (result == InjectionResult.Success)
                {
                    return;
                }
                WinFormsUtil.Alert(result.ToString());
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
            {
                WinFormsUtil.Error(ex.Message);
            }

            BotUSB.Disconnect();
        }
コード例 #3
0
    public void ReadFromSource()
    {
        uint offset = sbc.GetDefaultOffset();

        injector.SetWriteOffset(offset);
        try
        {
            InjectionResult injectionResult = injector.Read(true);
            if (injectionResult != InjectionResult.Success)
            {
                Debug.Log(injectionResult.ToString());
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            UISB.ConnectedText.text = (ex.Message);
            UISB.SetConnected(val: false);
        }
    }
コード例 #4
0
ファイル: SysBotUI.cs プロジェクト: yumf/NHSE
        public SysBotUI(AutoInjector injector, SysBotController c)
        {
            InitializeComponent();
            Bot      = c;
            Injector = injector;

            var offset = Bot.GetDefaultOffset();

            Injector.SetWriteOffset(offset);
            RamOffset.Text = offset.ToString("X8");

            TB_IP.Text   = Bot.IP;
            TB_Port.Text = Bot.Port;

            Bot.PopPrompt();

            TIM_Interval.Tick += (s, e) => injector.Read();
        }
コード例 #5
0
ファイル: SysBotUI.cs プロジェクト: xenfye/NHSE
        public SysBotUI(AutoInjector injector, SysBotController c, AutoInjector injectorUSB, USBBotController b)
        {
            InitializeComponent();
            this.TranslateInterface(GameInfo.CurrentLanguage);
            Bot         = c;
            Injector    = injector;
            BotUSB      = b;
            InjectorUSB = injectorUSB;

            var offset = Bot.GetDefaultOffset();

            Injector.SetWriteOffset(offset);
            RamOffset.Text = offset.ToString("X8");

            TB_IP.Text   = Bot.IP;
            TB_Port.Text = Bot.Port;

            Bot.PopPrompt();

            TIM_Interval.Tick += (s, e) => injector.Read();
        }