Exemple #1
0
        public ulong GetPointerAddress(ISwitchConnectionSync sb, string ptr)
        {
            uint finadd = 0;

            if (!ptr.EndsWith("]"))
            {
                finadd = GetHexValue(ptr.Split('+').Last());
            }
            var jumps = ptr.Replace("main", "").Replace("[", "").Replace("]", "").Split(new[] { "+" }, StringSplitOptions.RemoveEmptyEntries);

            var   initaddress = GetHexValue(jumps[0].Trim());
            ulong address     = BitConverter.ToUInt64(sb.ReadBytesMain(initaddress, 0x8), 0);

            foreach (var j in jumps)
            {
                var val = GetHexValue(j.Trim());
                if (val == initaddress)
                {
                    continue;
                }
                if (val == finadd)
                {
                    address += val;
                    break;
                }
                address = BitConverter.ToUInt64(sb.ReadBytesAbsolute(address + val, 0x8), 0);
            }
            return(address);
        }
Exemple #2
0
        // Connection and getting values
        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            int Port = int.Parse(TextBoxPort.Text);

            if (Connected == false)
            {
                // Connect button behaviour
                cfg.IP     = TextBoxIP.Text;
                cfg.Port   = Port;
                Connection = cfg.CreateSync();
                Connection.Connect();

                ReloadValues();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = false;
                TextBoxPort.Enabled      = false;
                ButtonSysbotRead.Enabled = true;
                // Player
                SysBotPouchItem1Count.Enabled   = true;
                SysBotPouchItem2Count.Enabled   = true;
                SysBotPouchItem3Count.Enabled   = true;
                SysBotPouchItem4Count.Enabled   = true;
                SysBotPouchItem5Count.Enabled   = true;
                SysBotHunterCoordXCount.Enabled = true;
                SysBotHunterCoordYCount.Enabled = true;
                SysBotHunterCoordZCount.Enabled = true;
                // Quest
                SysBotMonsterHPCount.Enabled = true;
                SysBotHunterHPCount.Enabled  = true;

                Connected          = true;
                ButtonConnect.Text = "Diconnect";
            }
            else
            {
                // Disconnect button behaviour
                Connection.Disconnect();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = true;
                TextBoxPort.Enabled      = true;
                ButtonSysbotRead.Enabled = false;
                // Player
                SysBotPouchItem1Count.Enabled   = false;
                SysBotPouchItem2Count.Enabled   = false;
                SysBotPouchItem3Count.Enabled   = false;
                SysBotPouchItem4Count.Enabled   = false;
                SysBotPouchItem5Count.Enabled   = false;
                SysBotHunterCoordXCount.Enabled = false;
                SysBotHunterCoordYCount.Enabled = false;
                SysBotHunterCoordZCount.Enabled = false;
                // Quest
                SysBotMonsterHPCount.Enabled = false;
                SysBotHunterHPCount.Enabled  = false;

                Connected          = false;
                ButtonConnect.Text = "Connect";
            }
        }
Exemple #3
0
        public static void WriteUInt(uint input, ulong offset, ISwitchConnectionSync sb)
        {
            byte value = Convert.ToByte(input);

            byte[] byteArray = new byte[1];
            byteArray[0] = value;
            sb.WriteBytesAbsolute(byteArray, offset);
            return;
        }
Exemple #4
0
        // sb and getting values
        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            int Port = int.Parse(TextBoxPort.Text);

            if (Connected == false)
            {
                // Connect button behaviour
                cfg.IP   = TextBoxIP.Text;
                cfg.Port = Port;
                sb       = cfg.CreateSync();
                sb.Connect();

                ReloadValues();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = false;
                TextBoxPort.Enabled      = false;
                ButtonSysbotRead.Enabled = true;

                StatusConnection.ForeColor = Color.Green;
                StatusConnection.Text      = "Connected";
                Connected          = true;
                ButtonConnect.Text = "Disconnect";
                SysBotLog.Text    += Environment.NewLine + "Successfully connected.";
            }
            else
            {
                // Disconnect button behaviour
                sb.Disconnect();
                // Toggle buttons and fields
                TextBoxIP.Enabled        = true;
                TextBoxPort.Enabled      = true;
                ButtonSysbotRead.Enabled = false;
                // Player
                SysBotZeniCount.Enabled         = false;
                SysBotPointsCount.Enabled       = false;
                SysBotPouchItem1Count.Enabled   = false;
                SysBotPouchItem2Count.Enabled   = false;
                SysBotPouchItem3Count.Enabled   = false;
                SysBotPouchItem4Count.Enabled   = false;
                SysBotPouchItem5Count.Enabled   = false;
                SysBotHunterCoordXCount.Enabled = false;
                SysBotHunterCoordYCount.Enabled = false;
                SysBotHunterCoordZCount.Enabled = false;
                // Quest
                SysBotHunterHPCount.Enabled      = false;
                SysBotHunterStaminaCount.Enabled = false;
                SysBotMonster1HPCount.Enabled    = false;

                StatusConnection.ForeColor = Color.Red;
                StatusConnection.Text      = "Disconnected";
                Connected          = false;
                ButtonConnect.Text = "Connect";
                SysBotLog.Text    += Environment.NewLine + "Successfully disconnected.";
            }
        }
Exemple #5
0
        // sb and getting values
        private void ButtonConnect_Click(object sender, EventArgs e)
        {
            int Port = int.Parse(TextBoxPort.Text);

            if (Connected == false)
            {
                // Connect button behaviour
                cfg.IP   = TextBoxIP.Text;
                cfg.Port = Port;
                sb       = cfg.CreateSync();
                sb.Connect();

                ReloadValues();
                // Toggle buttons and fields
                TextBoxIP.Enabled          = false;
                TextBoxPort.Enabled        = false;
                ButtonSysbotRead.Enabled   = true;
                PointsTotalNumeric.Enabled = true;

                StatusConnection.ForeColor = Color.Green;
                StatusConnection.Text      = "Connected";
                Connected          = true;
                ButtonConnect.Text = "Disconnect";
                SysBotLog.Text    += Environment.NewLine + "Successfully connected.";
            }
            else
            {
                // Disconnect button behaviour
                sb.Disconnect();
                // Toggle buttons and fields
                TextBoxIP.Enabled          = true;
                TextBoxPort.Enabled        = true;
                ButtonSysbotRead.Enabled   = false;
                PointsTotalNumeric.Enabled = false;

                StatusConnection.ForeColor = Color.Red;
                StatusConnection.Text      = "Disconnected";
                Connected          = false;
                ButtonConnect.Text = "Connect";
                SysBotLog.Text    += Environment.NewLine + "Successfully disconnected.";
            }
        }
Exemple #6
0
 public static void WriteFloat(float input, ulong offset, ISwitchConnectionSync sb)
 {
     byte[] Bytes = BitConverter.GetBytes(input);
     sb.WriteBytesAbsolute(Bytes, offset);
 }