Esempio n. 1
0
        private void ConnectButton_Click(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(IPBox.Text, 7331);
            try
            {
                Gecko.Connect();
            }
            catch (ETCPGeckoException exc)
            {
                MessageBox.Show("Connection to the TCPGecko failed: \n\n" + exc.Message + "\n\nCheck your network connection/firewall.", "Connection failed", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

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

            uint JRAddr = Gecko.peek(0x106E975C) + 0x92D8;

            if (Gecko.peek(JRAddr) == 0x000003F2)
            {
                diff = JRAddr - 0x12CDADA0;
            }
            else
            {
                DisconnButton_Click(sender, e);
                MessageBox.Show(Properties.Resources.FIND_DIFF_FAILED_TEXT, "Connection Aborted", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }

            groupBox2.Enabled     = true;
            DisconnButton.Enabled = true;
            ConnectButton.Enabled = false;
        }
Esempio n. 2
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();
        }
Esempio n. 3
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 ConnectButton_Click(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(IPBox.Text, 7331);
            try
            {
                Gecko.Connect();
            }
            catch (ETCPGeckoException exc)
            {
                MessageBox.Show("Connection to the TCPGecko failed: \n\n" + exc.Message + "\n\nCheck your network connection/firewall.", "Connection failed", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            editingBox.Enabled    = true;
            DisconnButton.Enabled = true;
            ConnectButton.Enabled = false;
        }
Esempio n. 5
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();
        }
Esempio n. 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(IPBox.Text, 7331);
            try
            {
                Gecko.Connect();
            }
            catch (ETCPGeckoException exc)
            {
                MessageBox.Show("Connection to the TCPGecko failed: \n\n" + exc.Message + "\n\nCheck your network connection/firewall.", "Connection failed", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            Gecko.poke(0x10014cfc, 0x00000001);
            System.Threading.Thread.Sleep(1000);
            if (Gecko.peek(0x10014D00) == 0x00000000)
            {
                /*
                 * MessageBox.Show("register: " + String.Format("{0:x2}", Gecko.peek(0x10014D00)), "info", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 * MessageBox.Show("✘", "fail", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 */
                hasExtendedHandlerInstalled = false;
            }
            else
            {
                /*
                 * MessageBox.Show("register: " + String.Format("{0:x2}", Gecko.peek(0x10014D00)), "info", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 * MessageBox.Show("✓", "good", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 */
                hasExtendedHandlerInstalled = true;
            }
            Gecko.poke(0x10014cfc, 0x00000000);

            Gecko.poke(0x10613C2C, 0x5F476573);
            Gecko.poke(0x10613C3C, 0x756C6174);
            Gecko.poke(0x10613C4C, 0x68650000);
            Gecko.poke(0x10613C88, 0x63650000);

            groupBox2.Enabled     = true;
            DisconnButton.Enabled = true;
            ConnectButton.Enabled = false;
        }
Esempio n. 7
0
        void ConnectBoxClick(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(ipBox.Text, 7331);
            try
            {
                Gecko.Connect();
                statusLabel.Text = "Connected to TCPGecko.";
            }
            catch (ETCPGeckoException)
            {
                MessageBox.Show("Failed to connect to the Wii U. Make sure you've ran TCPGecko on your Wii U and that you are on the same network as your Wii U.");
                statusLabel.Text = "Failed to connect, TCPGecko not found.";
                return;
            }
            catch (System.Net.Sockets.SocketException)
            {
                MessageBox.Show("Invalid IP entered.");
                statusLabel.Text = "Failed to connect, invalid IP entered.";
                return;
            }
            //offset difference checker (not used unless needed)

            /*uint JRAddr = Gecko.peek(0x106E975C) + 0x92D8;
             * if (Gecko.peek(JRAddr) == 0x000003F2)
             * {
             *      diff = JRAddr - 0x12CDADA0;
             * }
             * else
             * {
             *      MessageBox.Show("Failed to find diff.");
             *      statusLabel.Text = "Failed to find diff.";
             *      Gecko.Disconnect();
             *      return;
             * }*/
            connectBox.Enabled    = false;
            disconnectBox.Enabled = true;

            release();
        }
Esempio n. 8
0
        private void connectBox_Click(object sender, EventArgs e)
        {
            Gecko = new TCPGecko(ipBox.Text, 7331);

            try
            {
                Gecko.Connect();
                connectBox.Enabled = false;
                getDiff(0x0, 0x9000, 0x8000);
                load();
                disconnectBox.Enabled = true;
            }
            catch (ETCPGeckoException)
            {
                MessageBox.Show("Connection failed.\nTry making sure your IP is correct and that TCPGecko is not being blocked by firewalls.");
            }

            catch (System.Net.Sockets.SocketException)
            {
                MessageBox.Show("Invalid IP entry.");
            }
        }
Esempio n. 9
0
        private void connectBox_Click(object sender, EventArgs e)
        {
            //start a TCP connection
            Gecko = new TCPGecko(ipBox.Text, 7331);
            try
            {
                Gecko.Connect();
            }
            catch (ETCPGeckoException)
            {
                MessageBox.Show(Properties.Strings.CONNECTION_FAILED_TEXT);
                return;
            }
            catch (System.Net.Sockets.SocketException)
            {
                MessageBox.Show(Properties.Strings.INVALID_IP_TEXT);
                return;
            }

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

            if (Gecko.peek(JRAddr) == 0x000003F2) //loadiine & geckiine
            {
                uint diff  = octodiff = JRAddr - 0x12CDADA0;
                uint diff2 = Gecko.peek(0x106EA828) - 0x332C1100;

                //base addresses
                SquadAddr  = 0x1D9B1C2C + diff;
                PBAddr     = 0x1D9B2264 + diff;
                OnlineAddr = 0x1CAFD9E8 + diff2;
                //FestAddr = 0x1CAFD918 + diff2;
#if DEBUG
                //for debuging do not remove
                Console.WriteLine("Debugging Data (used for math):");
                Console.WriteLine("diff: " + diff.ToString("X"));
                Console.WriteLine("diff2: " + diff2.ToString("X"));
                Console.WriteLine("Online: " + OnlineAddr.ToString("X"));
                Console.WriteLine("Private: " + PBAddr.ToString("X"));
                Console.WriteLine("Squad: " + SquadAddr.ToString("X"));
                Console.WriteLine("Festi: " + FestAddr.ToString("X"));
                Console.WriteLine("Gender: " + (0x12D1F364 + octodiff).ToString("X"));
#endif
            }
            else //when the pointer fails to work
            {
                disconnectBox_Click(sender, e);
                MessageBox.Show(Properties.Strings.FIND_DIFF_FAILED_TEXT, "Connection Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //save IP to xml
            Configuration.currentConfig.lastIp = ipBox.Text;
            Configuration.Save();

            //change object states
            load();

            //loads Octo sfx
            if (sfxNormalRadio.Checked)
            {
                sfxNormalRadio_CheckedChanged(sender, e);
            }
            else if (sfxEliteRadio.Checked)
            {
                sfxEliteRadio_CheckedChanged(sender, e);
            }

            //Fixes the player Octoling sfx
            patchOctosfx(1);

            //starts poking timer
            getNames();
            autoRefreshTimer.Start();

            //get player's mii name (WILL be used when applicable on GUI)
            miiName = yourMiiName();

            //enable octohax if the first slot is an Octoling
            if (autoRefresh[0])
            {
                patchOctohax(1);
            }
        }
Esempio n. 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();
        }