Beispiel #1
0
        private void connectBox_Click(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(ipBox.Text, 7331);

            try
            {
                Gecko.Connect();
            }
            catch (ETCPGeckoException)
            {
                MessageBox.Show(Properties.Strings.CONNECTION_FAILED_TEXT);
            }
            catch (System.Net.Sockets.SocketException)
            {
                MessageBox.Show(Properties.Strings.INVALID_IP_TEXT);
            }

            if (Gecko.peek(0x12CDADA0) == 0x000003F2)
            {
                diff = 0x0;
            }
            else if (Gecko.peek(0x12CE2DA0) == 0x000003F2)
            {
                diff = 0x8000;
            }
            else if (Gecko.peek(0x12CE3DA0) == 0x000003F2)
            {
                diff = 0x9000;
            }
            else
            {
                MessageBox.Show(Properties.Strings.FIND_DIFF_FAILED_TEXT);

                Gecko.Disconnect();
                return;
            }

            // do a version check using "ToHu" of "ToHuman"
            if (Gecko.peek(0x105EF400) != 0x546F4875)
            {
                MessageBox.Show(Properties.Strings.VERSION_CHECK_FAILED_TEXT);

                Gecko.Disconnect();
                return;
            }

            Configuration.currentConfig.lastIp = ipBox.Text;
            Configuration.Save();

            connectBox.Enabled    = false;
            disconnectBox.Enabled = true;

            load();
        }
Beispiel #2
0
        private void connectBox_Click(object sender, EventArgs e)
        {
            _gecko = TCPGecko.Instance(ipBox.Text);

            try
            {
                _gecko.Connect();
            }
            catch (ETCPGeckoException)
            {
                MessageBox.Show(Strings.CONNECTION_FAILED_TEXT);
            }
            catch (SocketException)
            {
                MessageBox.Show(Strings.INVALID_IP_TEXT);
            }

            //offset difference checker
            var JRAddr = _gecko.peek(0x106E975C) + 0x92D8;

            if (_gecko.peek(JRAddr) == 0x000003F2)
            {
                MemoryUtils.Offset = JRAddr - 0x12CDADA0;
            }
            else
            {
                MessageBox.Show(Strings.FIND_DIFF_FAILED_TEXT);

                _gecko.Disconnect();
                return;
            }

            // do a version check using "ToHu" of "ToHuman"
            if (_gecko.peek((uint)OctohaxAddress.Player00 + 0x50) != 0x546F4875)
            {
                MessageBox.Show(Strings.VERSION_CHECK_FAILED_TEXT);

                _gecko.Disconnect();
                return;
            }

            Configuration.CurrentConfig.LastIp = ipBox.Text;
            Configuration.Save();

            connectBox.Enabled    = false;
            disconnectBox.Enabled = true;

            Reload();
        }
 private void DisconnButton_Click(object sender, EventArgs e)
 {
     Gecko.Disconnect();
     editingBox.Enabled    = false;
     DisconnButton.Enabled = false;
     ConnectButton.Enabled = true;
 }
Beispiel #4
0
 private void disconnectBox_Click(object sender, EventArgs e)
 {
     disconnectBox.Enabled = false;
     hold();
     Gecko.Disconnect();
     connectBox.Enabled = true;
 }
Beispiel #5
0
 private void button2_Click(object sender, EventArgs e)
 {
     Gecko.Disconnect();
     groupBox2.Enabled     = false;
     DisconnButton.Enabled = false;
     ConnectButton.Enabled = true;
 }
Beispiel #6
0
 private void Disconnect()
 {
     patchOctohax(0);         //reverts safe octohax
     patchOctosfx(0);         //reverts Octoling sfx
     autoRefreshTimer.Stop(); //stops poking timer
     Gecko.Disconnect();
     hold();
 }
Beispiel #7
0
 private void buttonDisconn_Click(object sender, EventArgs e)
 {
     Gecko.Disconnect();
     groupBox2.Enabled     = false;
     groupBox3.Enabled     = false;
     groupBox4.Enabled     = false;
     buttonDisconn.Enabled = false;
     buttonConnect.Enabled = true;
     ObjectTimer.Stop();
     mapCheckerTimer.Stop();
 }
Beispiel #8
0
        private void buttonConnect_Click(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(IPBox.Text, 7331);
            try
            {
                Gecko.Connect();
            }
            catch (ETCPGeckoException)
            {
                MessageBox.Show("Connection to the Gecko client failed!: \n\n" + "\n\nPlease check your network connection/firewall.", "Connection failed", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            //offset difference checker
            uint JRAddr = Gecko.peek(0x106E975C) + 0x92D8;

            if (Gecko.peek(JRAddr) == 0x000003F2)
            {
                diff = JRAddr - 0x12CDADA0;
            }
            else
            {
                MessageBox.Show("The program cannot find the Splattershot Jr. in memory.  It's possible the program doesn't support the version of Gecko you are using.  Please make sure Splatoon is running and try again using a supported version of Gecko. ", "Unsupported Gecko version found!", MessageBoxButtons.OK, MessageBoxIcon.Hand);

                Gecko.Disconnect();
                return;
            }

            Gecko.poke(0x10014cfc, 0x00000001);
            System.Threading.Thread.Sleep(100);

            groupBox2.Enabled     = true;
            groupBox3.Enabled     = true;
            groupBox4.Enabled     = true;
            buttonDisconn.Enabled = true;
            buttonConnect.Enabled = false;
            if (checkBox1.Checked)
            {
                mapCheckerTimer.Start();
            }

            Configuration.currentConfig.lastIp   = IPBox.Text;
            Configuration.currentConfig.AutoPoke = checkBox1.Checked;
            Configuration.Save();
        }
Beispiel #9
0
 void DisconnectBoxClick(object sender, EventArgs e)
 {
     try
     {
         disconnectBox.Enabled = false;
         hold();
         Gecko.Disconnect();
         connectBox.Enabled = true;
         statusLabel.Text   = "Disconnected from Wii U.";
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("Failed to disconnect. You are not connected, how do you expect me to disconnect?.");
         statusLabel.Text = "Not connected, cannot disconnect.";
     }
     catch (Exception f)
     {
         MessageBox.Show("Failed to disconnect. Report this issue on the AshAIO 2 GitHub (https://github.com/ASHTeam/ash-aio-2/issues/new) and include the following information:\n" + f);
         statusLabel.Text = "Unknown exception occured during disconnection.";
     }
 }
Beispiel #10
0
        static void Main(string[] args)
        {
            // Get user ip address
            string ip;

            if (File.Exists("ip.txt"))
            {
                ip = File.ReadAllText("ip.txt").Trim();
            }
            else if (args.Length > 0)
            {
                ip = args[0];
            }
            else
            {
                Console.Write("Ip: ");
                ip = Console.ReadLine();
            }

            // Setup discord
            DiscordController discord = new DiscordController();

            discord.Initialize();
            DiscordRpc.UpdatePresence(discord.presence);

            // Setup tcpgecko using ip
            TCPGecko gecko = new TCPGecko(ip, 7331);

            if (!gecko.Connect())
            {
                Console.WriteLine("Failed to connect.");
                return;
            }

            int[] players = new int[8];
            int   stage = 0, mode = 0;

            while (true)
            {
                // Grab some values from memory
                try
                {
                    players[0] = (int)gecko.peek(0x1098EDEB) & 0xFF;
                    players[1] = (int)gecko.peek(0x1098EE6B) & 0xFF;
                    players[2] = (int)gecko.peek(0x1098EEEB) & 0xFF;
                    players[3] = (int)gecko.peek(0x1098EF6B) & 0xFF;
                    players[4] = (int)gecko.peek(0x1098EFEB) & 0xFF;
                    players[5] = (int)gecko.peek(0x1098F06B) & 0xFF;
                    players[6] = (int)gecko.peek(0x1098F0EB) & 0xFF;
                    players[7] = (int)gecko.peek(0x1098F16B) & 0xFF;
                    stage      = (int)gecko.peek(0x1097577F) & 0xFF;
                    mode       = (int)gecko.peek(0x1098B2AB) & 0xFF;

                    //Uncomment this for debug print
                    Console.WriteLine($"Mode = {mode}");
                    Console.WriteLine($"Stage = {stage}");
                    for (int i = 0; i < 8; i++)
                    {
                        Console.WriteLine($"Player {i + 1} - {players[i]}");
                    }
                }
                catch { } // 3DS mode crashes for some reason idk

                List <int> activePlayers = new List <int>();
                for (int i = 0; i < 8; i++)
                {
                    if (players[i] != 0xFF)
                    {
                        activePlayers.Add(players[i]);
                    }
                }

                if (Info.IN_GAME_MODES.Contains(mode) && Info.STAGE_IMAGE_KEYS.ContainsKey(stage))
                {
                    discord.presence = new DiscordRpc.RichPresence()
                    {
                        smallImageKey  = "",
                        smallImageText = "",
                        largeImageKey  = Info.STAGE_IMAGE_KEYS[stage],
                        largeImageText = Info.STAGE_NAMES[stage]
                    };
                }
                else if (mode == 0x2E)
                {
                    discord.presence = new DiscordRpc.RichPresence()
                    {
                        smallImageKey  = "",
                        smallImageText = "",
                        largeImageKey  = "stage_maker",
                        largeImageText = ""
                    };
                }
                else
                {
                    discord.presence = new DiscordRpc.RichPresence()
                    {
                        smallImageKey  = "",
                        smallImageText = "",
                        largeImageKey  = "smash",
                        largeImageText = ""
                    };
                }

                if (Info.MODE_DESCRIPTIONS.ContainsKey(mode))
                {
                    discord.presence.state = Info.MODE_DESCRIPTIONS[mode];
                }
                else
                {
                    discord.presence.state = "In game";
                }
                if (Info.SINGLEPLAYER_MODES.Contains(mode))
                {
                    if (activePlayers.Count >= 1 && Info.CHARACTER_NAMES.ContainsKey(activePlayers[0]))
                    {
                        discord.presence.details = $"Playing as {Info.CHARACTER_NAMES[activePlayers[0]]}";
                    }
                }
                else if (Info.IN_GAME_MODES.Contains(mode))
                {
                    if (activePlayers.Count == 1 && Info.CHARACTER_NAMES.ContainsKey(activePlayers[0]))
                    {
                        discord.presence.details = $"Playing as {Info.CHARACTER_NAMES[activePlayers[0]]}";
                    }
                    else if (activePlayers.Count == 2 && Info.CHARACTER_NAMES.ContainsKey(activePlayers[0]) && Info.CHARACTER_NAMES.ContainsKey(activePlayers[1]))
                    {
                        discord.presence.details = $"{Info.CHARACTER_NAMES[activePlayers[0]]} vs {Info.CHARACTER_NAMES[activePlayers[1]]}";
                    }
                }

                DiscordRpc.UpdatePresence(discord.presence);

                // Sleep 5 seconds between updating stuff
                System.Threading.Thread.Sleep(5000);
            }
            gecko.Disconnect();
            Console.ReadLine();
        }