コード例 #1
0
ファイル: Form1.cs プロジェクト: yahya14/GeckoMapTester
        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;
        }
コード例 #2
0
        public bool Compare(Stream regStream, BreakpointType bpType, uint bpAddress, TCPGecko gecko)
        {
            if (regStream.Length != 0x120)
            {
                return(false);
            }

            int spos = PRegister * 4;

            uint val = 0;

            if (spos == 0x120)
            {
                switch (bpType)
                {
                case BreakpointType.Read:
                    val = gecko.peek(bpAddress);
                    break;

                case BreakpointType.ReadWrite:
                case BreakpointType.Write:
                    gecko.Step();
                    val = gecko.peek(bpAddress);
                    break;

                default:
                    return(true);
                }
            }
            else
            {
                regStream.Seek(spos, SeekOrigin.Begin);
                val = GlobalFunctions.ReadStream(regStream);
            }

            switch (PCondition)
            {
            case BreakpointComparison.Equal:
                return(val == value);

            case BreakpointComparison.NotEqual:
                return(val != value);

            case BreakpointComparison.Greater:
                return(val > value);

            case BreakpointComparison.GreaterEqual:
                return(val >= value);

            case BreakpointComparison.Lower:
                return(val < value);

            case BreakpointComparison.LowerEqual:
                return(val <= value);
            }

            return(true);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: darryl47nopra/Splat-AIO-2
        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();
        }
コード例 #4
0
ファイル: Main.cs プロジェクト: CatRosalina/octoslots
        //TIMER FUNCTION; runs at start and stops upon disconnection
        private void autoRefreshTimer_Tick(object sender, EventArgs e)
        {
            //switches between octoling models in menus
            menuOctohax();

            uint matchCheck = Gecko.peek(0x10707EA0); //stops checking for things when a map is loaded

            if (matchCheck == 0x3F800000)             //disables names and checks that aren't needed while on menus
            {
                //syncs checks with the bool array
                checkVerify();
                //reads names to display them on the gui
                getNames();
            }

            //auto pokes main player when checked
            if (mainPlayerPokeCheck.Checked && mainPlayerPokeCheck.Enabled && matchCheck == 0x3F800000)
            {
                mainNameChecker();
            }

            //switch
            if (SinglePlayerForm.SPPoke == false)
            {
                //pokes gender 2 on checked players (main function)
                for (uint i = 0; i < 8; i++)
                {
                    if (autoRefresh[i])
                    {
                        Gecko.poke(0x12D1F364 + octodiff + (i * 0xFC), 0x00000002);
                    }
                }
            }
            else
            {
                //pokes single player genders for singleplayerform
                singlePlayerPoke();
            }

            //toggled combine between normal and elite octoling when checked
            if (sfxCombineRadio.Checked)
            {
                if (combineToggle)
                {
                    combineToggle = false;
                    sfxNormalRadio_CheckedChanged(sender, e);
                }
                else
                {
                    combineToggle = true;
                    sfxEliteRadio_CheckedChanged(sender, e);
                }
            }
        }
コード例 #5
0
ファイル: SplatAIOForm.cs プロジェクト: igromanru/Splat-AIO-2
        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();
        }
コード例 #6
0
 private void RecalculatePointer()
 {
     if (BattleDojoRadioButton.Checked)
     {
         // TODO: geckiine
         timerAddress = gecko.peek(dojoAddress + diff) + 0x280;
     }
     else if (ReconRadioButton.Checked)
     {
         timerAddress = GetPointerVal(reconAddress, reconGeckiineAddress, 0x1F000000, 0x20000000) + 0x280;
     }
     else if (AmiiboRadioButton.Checked)
     {
         timerAddress = GetPointerVal(amiiboAddress, amiiboGeckiineAddress, 0x20000000, 0x21000000) + 0x2B4;
     }
 }
コード例 #7
0
ファイル: Form1.cs プロジェクト: BKOOL999/safe_nightpatcher
        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();
        }
コード例 #8
0
        private void menuOctohax()
        {
            if (mainPlayerPokeCheck.Checked || autoRefresh[0] || autoRefresh[1])
            {
                //fast menu check
                menuCheck[0] = Gecko.peek(0x106E093C);

                //slow menu check
                if (menuCheck[0] != menuCheck[2])
                {
                    menuCheck[1] = Gecko.peek(0x10707EA0);
                }

                if (((menuCheck[0] == 0 && menuCheck[0] != menuCheck[2]) || (menuCheck[1] != 0x3F800000 && menuCheck[1] != menuCheck[3])))
                {
                    if (menuCheck[0] != menuCheck[2] && menuCheck[1] != menuCheck[3])
                    {
                        //part of the check step when the check values change
                        menuCheck[2] = menuCheck[0];
                        menuCheck[3] = menuCheck[1];
                    }

                    if (autoRefresh[0])
                    {
                        patchOctohax(1); //pokes safe octohax
                    }

                    //for Battle Dojo (experimental)
                    Gecko.poke(0x12D1F364 + octodiff, 0x00000000); //P1
                    Gecko.poke(0x12D1F460 + octodiff, 0x00000000); //P2
                }
                else if (menuCheck[0] != menuCheck[2])
                {
                    if (menuCheck[0] != menuCheck[2] && (menuCheck[1] != 0x3F800000 && menuCheck[1] != menuCheck[3]))
                    {
                        menuCheck[2] = menuCheck[0];
                        menuCheck[3] = menuCheck[1];
                    }

                    patchOctohax(0); //reverts safe octohax
                }
            }
        }
コード例 #9
0
        public uint GetPointerVal(uint basePointer, uint offset1, uint offset2)
        {
            try
            {
                uint pointerVal = Gecko.peek(Gecko.peek(basePointer) + offset1) + offset2;

                if (pointerVal > 0x1F000000 && pointerVal < 0x21000000)
                {
                    return(pointerVal);
                }
                else
                {
                    return(timerError());
                }
            }
            catch (ArgumentOutOfRangeException)
            {
                return(timerError());
            }
        }
コード例 #10
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;
        }
コード例 #11
0
        private void ProgressBitsForm_Load(object sender, EventArgs e)
        {
            Form1 mainForm = (Form1)this.Owner;

            gecko       = mainForm.Gecko;
            progression = gecko.peek(progressBitsAddress + mainForm.diff);

            tutorialBox.Checked           = (progression & 0x1) != 0;
            splatfestBox.Checked          = (progression & 0x2) != 0;
            rankedNewsBox.Checked         = ((progression & 0x4) != 0);
            lobbyBox.Checked              = (progression & 0x8) != 0;
            heroSuitBox.Checked           = (progression & 0x10) != 0;
            greatZapfishBox.Checked       = (progression & 0x80) != 0;
            cuttlefishPostGameBox.Checked = (progression & 0x100) != 0;
            rankedUnlockedBox.Checked     = (progression & 0x800) != 0;
            rankShownBox.Checked          = (progression & 0x1000) != 0;
            snailsShownBox.Checked        = (progression & 0x10000) != 0;
            levelCapRaisedBox.Checked     = (progression & 0x100000) != 0;
            warningBox.Checked            = (progression & 0x200000) != 0;
        }
コード例 #12
0
ファイル: MemViewer.cs プロジェクト: wj444/tcp-gecko-dotnet
        private void CellSelectionChange(object sender, EventArgs e)
        {
            UInt32 sAddress = cAddress & 0xFFFFFFF0;

            if (gView.SelectedCells.Count > 0)
            {
                int col = gView.SelectedCells[0].ColumnIndex;
                int row = gView.SelectedCells[0].RowIndex;
                if (col == 0)
                {
                    gView.Rows[oldRow].Cells[oldCol].Selected = true;
                }
                else
                {
                    oldCol = col;
                    oldRow = row;
                    UInt32 addr = (UInt32)(sAddress + row * 16 + (col - 1) * 4);

                    // Nothing to update if the address didn't change
                    if (selAddress == addr)
                    {
                        return;
                    }

                    selAddress       = addr;
                    pokeAddress.Text = GlobalFunctions.toHex(addr);
                    try
                    {
                        UInt32 locValue = gecko.peek(addr);
                        pokeValue.Text = GlobalFunctions.toHex(locValue);
                        fpValue.Text   = GlobalFunctions.UIntToSingle(locValue).ToString("G6");
                    }
                    catch (ETCPGeckoException exc)
                    {
                        exceptionHandling.HandleException(exc);
                    }
                }
            }
        }
コード例 #13
0
ファイル: WeaponsForm.cs プロジェクト: thomas3340/Splat-AIO-2
        private void ReloadWeaponsList()
        {
            weapons.Clear();

            equippedWeapon = gecko.peek(Form1.equippedWeaponAddress + diff);

            // dump all weapon save slots
            uint[] weaponData = Form1.DumpSaveSlots(gecko, diff, Form1.weaponsAddress, 5120);

            // read data from slots
            int j = 0;

            while (j < weaponData.Length)
            {
                uint id = weaponData[j];

                // check if an empty save slot
                if (id == 0xFFFFFFFF)
                {
                    // we've reached the end
                    break;
                }

                uint          number    = weaponData[j + 1];
                SubWeapon     sub       = (SubWeapon)weaponData[j + 2];
                SpecialWeapon special   = (SpecialWeapon)weaponData[j + 3];
                uint          turfInked = weaponData[j + 4];
                uint          timestamp = weaponData[j + 7];
                bool          newFlag   = weaponData[j + 8] == 0x0;

                weapons.Add(new Weapon(id, number, sub, special, turfInked, timestamp, newFlag));

                // move to next slot
                j += 10;
            }

            // reload the list
            ReloadListBox();
        }
コード例 #14
0
ファイル: Form1.cs プロジェクト: yahya14/GeckoMapTester
        private void writeString(uint offset, string s, int length)
        {
            uint push = 0;
            int  pos  = 0;

            if (offset % 4 != 0)
            {
                for (int i = 0; i < offset % 4; i++)
                {
                    push = push << 8 | s[pos++];
                }
                if (offset % 4 == 1)
                {
                    push = Gecko.peek(offset - offset % 4) & 0xFF000000 | push;
                }
                if (offset % 4 == 2)
                {
                    push = Gecko.peek(offset - offset % 4) & 0xFFFF0000 | push;
                }
                if (offset % 4 == 3)
                {
                    push = Gecko.peek(offset - offset % 4) & 0xFFFFFF00 | push;
                }
                Gecko.poke(offset, push);
                offset += offset % 4;
            }
            for (; pos < s.Length; offset += 4)
            {
                push = 0;
                if (pos + 1 == s.Length)
                {
                    push = (uint)s[pos++] << 24 | Gecko.peek(offset) & 0x00FFFFFF;
                    Gecko.poke(offset, push);
                    offset += 1;
                    break;
                }
                if (pos + 2 == s.Length)
                {
                    push = s[pos++];
                    push = push << 8 | s[pos++];
                    push = push << 16 | Gecko.peek(offset) & 0x0000FFFF;
                    Gecko.poke(offset, push);
                    offset += 2;
                    break;
                }
                if (pos + 3 == s.Length)
                {
                    push = s[pos++];
                    push = push << 8 | s[pos++];
                    push = push << 8 | s[pos++];
                    push = push << 8 | Gecko.peek(offset) & 0x000000FF;
                    Gecko.poke(offset, push);
                    break;
                }
                for (int i = 0; i < 4; i++)
                {
                    push = push << 8 | s[pos++];
                }
                Gecko.poke(offset, push);
            }
            for (; pos < length; offset += 4, pos += 4)
            {
                if (pos % 4 == 1)
                {
                    Gecko.poke(offset, Gecko.peek(offset) & 0xFF000000);
                    pos--;
                    continue;
                }
                if (pos % 4 == 2)
                {
                    Gecko.poke(offset, Gecko.peek(offset) & 0xFFFF0000);
                    pos--; pos--;
                    continue;
                }
                if (pos % 4 == 3)
                {
                    Gecko.poke(offset, Gecko.peek(offset) & 0xFFFFFF00);
                    pos--; pos--; pos--;
                    continue;
                }
                if (pos + 1 == length)
                {
                    push = Gecko.peek(offset) & 0x00FFFFFF;
                    Gecko.poke(offset, push);
                    offset += 1;
                    pos++;
                    break;
                }
                if (pos + 2 == length)
                {
                    push = Gecko.peek(offset) & 0x0000FFFF;
                    Gecko.poke(offset, push);
                    offset += 2;
                    pos    += 2;
                    break;
                }
                if (pos + 3 == length)
                {
                    push = Gecko.peek(offset) & 0x000000FF;
                    Gecko.poke(offset, push);
                    offset += 3;
                    pos    += 3;
                    break;
                }
                Gecko.poke(offset, 0);
            }
        }
コード例 #15
0
ファイル: Form1.cs プロジェクト: BKOOL999/safe_nightpatcher
        private void DeleteObjects()
        {
            bool tmp     = false;
            uint MapData = Gecko.peek(Base);
            uint Object  = Gecko.peek(MapData + 0x00000038);

            if (Gecko.peek(Object + 0x00000030) == 0x442835A8)
            {
                tmp = true;
            }
            else if (Gecko.peek(Gecko.peek(MapData + 0x00000058) + 0x00000030) == 0x442835A8)
            {
                tmp = true;
            }
            else if (Gecko.peek(Gecko.peek(MapData + 0x0000006c) + 0x00000030) == 0x442835A8)
            {
                tmp = true;
            }
            else if (Gecko.peek(Gecko.peek(MapData + 0x00000060) + 0x00000030) == 0x442835A8)
            {
                tmp = true;
            }
            if (Gecko.peek(0x12B4F15C) == 0x00000001 && Gecko.peek(0x10709294) == 0x4B616973 && tmp == true && hammerheadBridgeBox.Checked)
            {
                MapData = Gecko.peek(Base);
                Object  = Gecko.peek(MapData);

                uint Object1;
                uint Object2;
                uint Object3;
                uint Object4;

                if (Gecko.peek(Gecko.peek(MapData + 0x00000038) + 0x00000030) == 0x442835A8)
                {
                    Object1 = Gecko.peek(MapData + 0x00000038);
                    Object2 = Gecko.peek(MapData + 0x0000003c);
                    Object3 = Gecko.peek(MapData + 0x00000040);
                    Object4 = Gecko.peek(MapData + 0x00000044);
                }
                else if (Gecko.peek(Gecko.peek(MapData + 0x00000058) + 0x00000030) == 0x442835A8)
                {
                    Object1 = Gecko.peek(MapData + 0x00000058);
                    Object2 = Gecko.peek(MapData + 0x0000005c);
                    Object3 = Gecko.peek(MapData + 0x00000060);
                    Object4 = Gecko.peek(MapData + 0x00000064);
                }
                else if (Gecko.peek(Gecko.peek(MapData + 0x0000006c) + 0x00000030) == 0x442835A8)
                {
                    Object1 = Gecko.peek(MapData + 0x0000006c);
                    Object2 = Gecko.peek(MapData + 0x00000070);
                    Object3 = Gecko.peek(MapData + 0x00000074);
                    Object4 = Gecko.peek(MapData + 0x00000078);
                }
                else
                {
                    Object1 = Gecko.peek(MapData + 0x00000060);
                    Object2 = Gecko.peek(MapData + 0x00000064);
                    Object3 = Gecko.peek(MapData + 0x00000068);
                    Object4 = Gecko.peek(MapData + 0x0000006c);
                }

                uint Object1_Model = Gecko.peek(Object1 + 0x000001E4);
                uint Object2_Model = Gecko.peek(Object2 + 0x000001E4);
                uint Object3_Model = Gecko.peek(Object3 + 0x000001E4);
                uint Object4_Model = Gecko.peek(Object4 + 0x000001E4);

                System.Threading.Thread.Sleep(100);
                Object1 = Object1 + 0x00000004;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object1 + (i * 0x00000008), 0x00000000);
                }
                Object1 = Object1 + 0x00000010;
                for (uint i = 0; i < 2; i++)
                {
                    Gecko.poke(Object1 + (i * 0x00000004), 0x00000000);
                }

                Object1_Model = Object1_Model + 0x00000054;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object1_Model + (i * 0x00000008), 0x00000000);
                }
                Object1_Model = Object1_Model + 0x00000040;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object1_Model + (i * 0x00000008), 0x00000000);
                }
                Object1_Model = Object1_Model + 0x00000010;
                for (uint i = 0; i < 3; i++)
                {
                    Gecko.poke(Object1_Model + (i * 0x00000004), 0x00000000);
                }

                Object2 = Object2 + 0x00000004;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object2 + (i * 0x00000008), 0x00000000);
                }
                Object2 = Object2 + 0x00000010;
                for (uint i = 0; i < 2; i++)
                {
                    Gecko.poke(Object2 + (i * 0x00000004), 0x00000000);
                }

                Object2_Model = Object2_Model + 0x00000054;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object2_Model + (i * 0x00000008), 0x00000000);
                }
                Object2_Model = Object2_Model + 0x00000040;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object2_Model + (i * 0x00000008), 0x00000000);
                }
                Object2_Model = Object2_Model + 0x00000010;
                for (uint i = 0; i < 3; i++)
                {
                    Gecko.poke(Object2_Model + (i * 0x00000004), 0x00000000);
                }

                Object3 = Object3 + 0x00000004;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object3 + (i * 0x00000008), 0x00000000);
                }
                Object3 = Object3 + 0x00000010;
                for (uint i = 0; i < 2; i++)
                {
                    Gecko.poke(Object3 + (i * 0x00000004), 0x00000000);
                }

                Object3_Model = Object3_Model + 0x00000054;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object3_Model + (i * 0x00000008), 0x00000000);
                }
                Object3_Model = Object3_Model + 0x00000040;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object3_Model + (i * 0x00000008), 0x00000000);
                }
                Object3_Model = Object3_Model + 0x00000010;
                for (uint i = 0; i < 3; i++)
                {
                    Gecko.poke(Object3_Model + (i * 0x00000004), 0x00000000);
                }

                Object4 = Object4 + 0x00000004;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object4 + (i * 0x00000008), 0x00000000);
                }
                Object4 = Object4 + 0x00000010;
                for (uint i = 0; i < 2; i++)
                {
                    Gecko.poke(Object4 + (i * 0x00000004), 0x00000000);
                }

                Object4_Model = Object4_Model + 0x00000054;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object4_Model + (i * 0x00000008), 0x00000000);
                }
                Object4_Model = Object4_Model + 0x00000040;
                for (uint i = 0; i < 5; i++)
                {
                    Gecko.poke(Object4_Model + (i * 0x00000008), 0x00000000);
                }
                Object4_Model = Object4_Model + 0x00000010;
                for (uint i = 0; i < 3; i++)
                {
                    Gecko.poke(Object4_Model + (i * 0x00000004), 0x00000000);
                }
            }
            else
            {
                System.Threading.Thread.Sleep(500);
            }
        }
コード例 #16
0
        public String GetStepLog()
        {
            String          DetailedInstruction = currentInstructionAndAddress;
            String          regDetails;
            MatchCollection getRegDetails;

            if (currentInstructionAndAddress == null)
            {
                return(String.Empty);
            }

            String[] Padding = DetailedInstruction.Split('\t');

            // this will help align things
            if (Padding.Length < 3)
            {
                DetailedInstruction += "        ";
            }
            else if (Padding[2].Length < 8)
            {
                for (int i = 8 - Padding[2].Length; i > 0; i--)
                {
                    DetailedInstruction += " ";
                }
            }

            // Get all the places where there's an LR
            getRegDetails = Regex.Matches(DetailedInstruction, "lr");

            for (int i = 0; i < getRegDetails.Count; i++)
            {
                regDetails = "LR = " + GlobalFunctions.toHex(GetRegisterValue(39));
                //DetailedInstruction = DetailedInstruction.Insert(getRegDetails[i].Index + getRegDetails[i].Length, regDetails);
                DetailedInstruction += "\t" + regDetails;
            }

            // Get all the places where there's an f0-f31
            // TODO: not 0-9 or a-f!
            // TODO: over matching?  switch to trying to find the 0x to determine when not a float reg?
            //getRegDetails = Regex.Matches(DetailedInstruction, "([^0-9]f[0-9][^0-9])|" +
            //                                                  "([^0-9]f1[0-9][^0-9])|" +
            //                                                  "([^0-9]f2[0-9][^0-9])|" +
            //                                                  "([^0-9]f3[01][^0-9])");

            if (!Regex.Match(DetailedInstruction, "0x").Success)
            {
                getRegDetails = Regex.Matches(DetailedInstruction, "f[0-9]+");

                for (int i = 0; i < getRegDetails.Count; i++)
                {
                    string floatReg = getRegDetails[i].Value;
                    int    index    = Int32.Parse(floatReg.Substring(1)) + 40;
                    Single floatVal = GetFloatRegisterValue(index);
                    regDetails = floatReg + " = " + floatVal.ToString("G6");
                    //DetailedInstruction = DetailedInstruction.Insert(getRegDetails[i].Index + getRegDetails[i].Length, regDetails);
                    DetailedInstruction += "\t" + regDetails;
                }
            }

            // Get all the places where there's an r0-r31
            getRegDetails = Regex.Matches(DetailedInstruction, "r[0-9]+");

            for (int i = 0; i < getRegDetails.Count; i++)
            {
                regDetails = getRegDetails[i].Value + " = " + GlobalFunctions.toHex(GetRegisterValue(Int32.Parse(getRegDetails[i].Value.Substring(1)) + 7));
                //DetailedInstruction = DetailedInstruction.Insert(getRegDetails[i].Index + getRegDetails[i].Length, regDetails);
                DetailedInstruction += "\t" + regDetails;
            }

            getRegDetails = Regex.Matches(DetailedInstruction, "\\(r[0-9]+\\)");

            for (int i = 0; i < getRegDetails.Count; i++)
            {
                if (ValidMemory.validAddress(MemoryAddress))
                {
                    regDetails = "[" + GlobalFunctions.toHex(MemoryAddress) + "] = " + GlobalFunctions.toHex(gecko.peek(MemoryAddress));
                    //DetailedInstruction = DetailedInstruction.Insert(getRegDetails[i].Index + getRegDetails[i].Length, regDetails);
                    if (Regex.Match(DetailedInstruction, "lfd|stfd").Success)
                    {
                        regDetails += GlobalFunctions.toHex(gecko.peek(MemoryAddress + 4));
                    }
                    DetailedInstruction += "\t" + regDetails;
                }
            }

            //if (IsTakenBranch())
            if ((isConditionalBranch(currentInstruction) && BranchTaken(currentInstruction)) || currentInstruction[0] == "b")
            {
                DetailedInstruction += "\r\n";
                for (int i = 0; i < logIndent; i++)
                {
                    DetailedInstruction += "|  ";
                }
                DetailedInstruction += "\t...\t...\t...\t...";
            }

            if (logIndent > 0)
            {
                for (int i = 0; i < logIndent; i++)
                {
                    DetailedInstruction = DetailedInstruction.Insert(0, "|  ");
                }
            }

            if (IsBL())
            {
                logIndent++;
            }

            if (logIndent > 0 && IsBLR())
            {
                logIndent--;
            }

            return(DetailedInstruction);
        }
コード例 #17
0
ファイル: Main.cs プロジェクト: CatRosalina/octoslots
        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);
            }
        }
コード例 #18
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();
        }
コード例 #19
0
ファイル: fsa.cs プロジェクト: wj444/tcp-gecko-dotnet
        public void DumpTree(params String[] folders)
        {
            UInt32 FSInit;
            UInt32 FSAddClient;
            UInt32 FSDelClient;
            UInt32 FSInitCmdBlock;
            UInt32 FSOpenDir;
            UInt32 FSCloseDir;
            UInt32 FSReadDir;
            UInt32 memalign;
            UInt32 free;

            switch (gecko.OsVersionRequest())
            {
            case 400:
            case 410:
                FSInit         = 0x01060d70;
                FSAddClient    = 0x01061290;
                FSDelClient    = 0x0106129c;
                FSInitCmdBlock = 0x01061498;
                FSOpenDir      = 0x01066f3c;
                FSCloseDir     = 0x01066fac;
                FSReadDir      = 0x0106702c;
                memalign       = gecko.peek(0x10049edc);
                free           = gecko.peek(0x100adc2c);
                break;

            case 500:
            case 510:
                FSInit         = 0x010666fc;
                FSAddClient    = 0x01066d80;
                FSDelClient    = 0x01066d8c;
                FSInitCmdBlock = 0x01066fec;
                FSOpenDir      = 0x0106db58;
                FSCloseDir     = 0x0106dbc8;
                FSReadDir      = 0x0106dc48;
                memalign       = gecko.peek(0x1004e2d0);
                free           = gecko.peek(0x100b41fc);
                break;

            case 532:
            case 540:
                FSInit         = 0x010683C8;
                FSAddClient    = 0x010689FC;
                FSDelClient    = 0x01068A08;
                FSInitCmdBlock = 0x01068C54;
                FSOpenDir      = 0x0106F690;
                FSCloseDir     = 0x0106F700;
                FSReadDir      = 0x0106F780;
                memalign       = gecko.peek(0x100b4878);
                free           = gecko.peek(0x100b487c);
                break;

            default:
                MessageBox.Show("Unsupported Wii U OS version.", "Version mismatch", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                UInt32 ret;
                ret = gecko.rpc(FSInit);

                UInt32 pClient = gecko.rpc(memalign, 0x1700, 0x20);
                if (pClient == 0)
                {
                    goto noClient;
                }
                UInt32 pCmd = gecko.rpc(memalign, 0xA80, 0x20);
                if (pCmd == 0)
                {
                    goto noCmd;
                }

                ret = gecko.rpc(FSAddClient, pClient, 0);
                ret = gecko.rpc(FSInitCmdBlock, pCmd);

                UInt32 pDh = gecko.rpc(memalign, 4, 4);
                if (pDh == 0)
                {
                    goto noDh;
                }
                UInt32 pPath = gecko.rpc(memalign, 0x200, 0x20);
                if (pPath == 0)
                {
                    goto noPath;
                }
                UInt32 pBuf = gecko.rpc(memalign, 0x200, 0x20);
                if (pBuf == 0)
                {
                    goto noBuf;
                }

                root = new fileStructure("vol", -1);
                Queue <fileStructure> scanQueue = new Queue <fileStructure>();
                foreach (String item in folders)
                {
                    scanQueue.Enqueue(root.addSubFolder(item, -1));
                }
                while (scanQueue.Count > 0)
                {
                    fileStructure current = scanQueue.Dequeue();
                    using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(current.Path + "\0")))
                    {
                        gecko.Upload(pPath, pPath + (uint)ms.Length, ms);
                    }


                    ret = gecko.rpc(FSOpenDir, pClient, pCmd, pPath, pDh, 0xffffffff);
                    if (ret != 0)
                    {
                        goto noDir;
                    }

                    UInt32 dh = gecko.peek(pDh);

                    do
                    {
                        ret = gecko.rpc(FSReadDir, pClient, pCmd, dh, pBuf, 0xffffffff);
                        if (ret != 0)
                        {
                            break;
                        }

                        using (MemoryStream ms = new MemoryStream())
                        {
                            gecko.Dump(pBuf, pBuf + 0x200, ms);

                            Byte[] data = ms.ToArray();
                            UInt32 attr = ByteSwap.Swap(BitConverter.ToUInt32(data, 0));
                            UInt32 size = ByteSwap.Swap(BitConverter.ToUInt32(data, 8));

                            String name = new String(Encoding.ASCII.GetChars(data, 0x64, 0x100));
                            name = name.Remove(name.IndexOf('\0'));

                            if ((attr & 0x80000000) != 0)
                            {
                                scanQueue.Enqueue(current.addSubFolder(name, -1));
                            }
                            else
                            {
                                current.addFile(name, -1, size);
                            }
                        }
                    } while (true);

                    gecko.rpc(FSCloseDir, pClient, pCmd, dh, 0);
noDir:
                    continue;
                }

                gecko.rpc(free, pBuf);
noBuf:
                gecko.rpc(free, pPath);
noPath:
                gecko.rpc(free, pDh);
noDh:

                ret = gecko.rpc(FSDelClient, pClient);

                gecko.rpc(free, pCmd);
noCmd:
                gecko.rpc(free, pClient);
noClient:

                if (root != null)
                {
                    root.Sort();
                    root.ToTreeView(treeView);
                }
            }
            catch (ETCPGeckoException e)
            {
                exceptionHandling.HandleException(e);
            }
            catch
            {
            }
        }
コード例 #20
0
ファイル: Form1.cs プロジェクト: darryl47nopra/Splat-AIO-2
        public void load()
        {
            hold();

            rank   = Convert.ToInt32(Gecko.peek(rankAddress + diff)) + 1;
            okane  = Convert.ToInt32(Gecko.peek(okaneAddress + diff));
            ude    = Convert.ToInt32(Gecko.peek(udeAddress + diff));
            mae    = Convert.ToInt32(Gecko.peek(maeAddress + diff));
            sazae  = Convert.ToInt32(Gecko.peek(sazaeAddress + diff));
            gender = Convert.ToInt32(Gecko.peek(genderAddress + diff));
            eyes   = Convert.ToInt32(Gecko.peek(eyesAddress + diff));
            skin   = Convert.ToInt32(Gecko.peek(skinAddress + diff));
            figure = Gecko.peek(amiiboAddress + diff);

            try
            {
                rankBox.Value = rank;
            }
            catch (ArgumentOutOfRangeException)
            {
                int rankDisplay = fixStuff(Properties.Strings.BAD_RANK_1, rank, Properties.Strings.BAD_RANK_2, 0x12CDC1A8, 49, 50, 1);
                rankBox.Value = rankDisplay;
            }

            try
            {
                kaneBox.Value = okane;
            }
            catch (ArgumentOutOfRangeException)
            {
                int okaneDisplay = fixStuff(Properties.Strings.BAD_OKANE_1, okane, Properties.Strings.BAD_OKANE_2, 0x12CDC1A0, 9999999, 9999999, 0);
                kaneBox.Value = okaneDisplay;
            }

            try
            {
                maeBox.Value = mae;
            }
            catch (ArgumentOutOfRangeException)
            {
                int maeDisplay = fixStuff(Properties.Strings.BAD_MAE_1, mae, Properties.Strings.BAD_MAE_2, 0x12CDC1B0, 99, 99, 0);
                maeBox.Value = maeDisplay;
            }

            try
            {
                sazaeBox.Value = sazae;
            }
            catch (ArgumentOutOfRangeException)
            {
                int sazaeDisplay = fixStuff(Properties.Strings.BAD_SAZAE_1, sazae, Properties.Strings.BAD_SAZAE_2, 0x12CDC1B4, 999, 999, 0);
                sazaeBox.Value = sazaeDisplay;
            }

            try
            {
                udeBox.SelectedIndex = ude;
            }
            catch (ArgumentOutOfRangeException)
            {
                int udeDisplay = fixStuff(Properties.Strings.BAD_UDE_1, ude, Properties.Strings.BAD_UDE_2, 0x12CDC1AC, 10, 10, 0);
                udeBox.SelectedIndex = udeDisplay;
            }

            try
            {
                genderBox.SelectedIndex = gender;
            }
            catch (ArgumentOutOfRangeException)
            {
                genderBox.SelectedIndex = 0;
                Gecko.poke32(genderAddress, 0x00000000);
            }

            if (figure == 0xFFFFFFFF)
            {
                amiiboBox.SelectedIndex = 0;
            }
            else
            {
                amiiboBox.SelectedIndex = Convert.ToInt32(figure + 1);
            }

            eyeBox.SelectedIndex  = eyes;
            skinBox.SelectedIndex = skin;
            release();
        }
コード例 #21
0
        private void UpdateList()
        {
            try
            {
                int            i, j;
                uint[]         address;
                uint           peekAddress, actAddress, peekValue;
                WatchDataSize  dataSize;
                uint           dumpAnd;
                string         aOutput, vOutput;
                uint           add;
                bool           pointer, vPointer, vAddress;
                int            maxCount = Math.Min(addressWatchList.Count, watchOut.RowCount);
                DoubleString[] oUp      =
                    new DoubleString[maxCount];
                for (i = 0; i < maxCount; i++)
                {
                    if (!isRowDisplayed(watchOut, i))
                    {
                        continue;
                    }
                    address  = addressWatchList[i].address;
                    pointer  = address.Length > 1;
                    dataSize = addressWatchList[i].dataSize;
                    switch (dataSize)
                    {
                    case WatchDataSize.Bit8:
                        dumpAnd = 0xFFFFFFFF;
                        break;

                    case WatchDataSize.Bit16:
                        dumpAnd = 0xFFFFFFFE;
                        break;

                    default:
                        dumpAnd = 0xFFFFFFFC;
                        break;
                    }
                    vPointer    = true;
                    peekAddress = address[0];

                    for (j = 1; j < address.Length; j++)
                    {
                        if (ValidMemory.validAddress(peekAddress, enableDebug))
                        {
                            peekAddress &= 0xFFFFFFFC;
                            peekAddress  = gecko.peek(peekAddress);
                            peekAddress += address[j];
                        }
                        else
                        {
                            vPointer = false;
                            break;
                        }
                    }

                    vAddress = vPointer && ValidMemory.validAddress(peekAddress, enableDebug);
                    if (pointer)
                    {
                        aOutput = "P->";
                        if (vPointer)
                        {
                            aOutput += GlobalFunctions.toHex(peekAddress);
                        }
                        else
                        {
                            aOutput += "????????";
                        }
                    }
                    else
                    {
                        aOutput = GlobalFunctions.toHex(peekAddress);
                    }

                    if (vAddress)
                    {
                        actAddress   = peekAddress;
                        peekAddress &= 0xFFFFFFFC;
                        add          = actAddress - peekAddress;
                        add         &= dumpAnd;
                        peekValue    = gecko.peek(peekAddress);
                        vOutput      = ParseValue(peekValue, dataSize, add, addressWatchList[i]);

                        addressWatchList[i].addressAvail   = true;
                        addressWatchList[i].updatedAddress = peekAddress + add;
                    }
                    else
                    {
                        vOutput = "????????";
                        addressWatchList[i].addressAvail = false;
                    }
                    oUp[i].address = aOutput;
                    oUp[i].value   = vOutput;
                    watchOut.Invoke((MethodInvoker) delegate
                    {
                        watchOut.Rows[i].Cells[1].Value = oUp[i].address;
                        watchOut.Rows[i].Cells[3].Value = oUp[i].value;
                    });
                }
            }
            catch (ETCPGeckoException e)
            {
                listEnabled = false;
                exceptionHandling.HandleException(e);
            }
            catch
            {
            }
        }
コード例 #22
0
        public string GetStepLog()
        {
            string          DetailedInstruction = currentInstructionAndAddress;
            string          regDetails;
            MatchCollection getRegDetails;

            if (currentInstructionAndAddress == null)
            {
                return(string.Empty);
            }

            string[] Padding = DetailedInstruction.Split('\t');

            if (Padding.Length < 3)
            {
                DetailedInstruction += "        ";
            }
            else if (Padding[2].Length < 8)
            {
                for (int i = 8 - Padding[2].Length; i > 0; i--)
                {
                    DetailedInstruction += " ";
                }
            }

            getRegDetails = Regex.Matches(DetailedInstruction, "lr");

            for (int i = 0; i < getRegDetails.Count; i++)
            {
                regDetails           = "LR = " + GlobalFunctions.toHex(GetRegisterValue(39));
                DetailedInstruction += "\t" + regDetails;
            }

            if (!Regex.Match(DetailedInstruction, "0x").Success)
            {
                getRegDetails = Regex.Matches(DetailedInstruction, "f[0-9]+");

                for (int i = 0; i < getRegDetails.Count; i++)
                {
                    string floatReg = getRegDetails[i].Value;
                    int    index    = int.Parse(floatReg.Substring(1)) + 40;
                    float  floatVal = GetFloatRegisterValue(index);
                    regDetails           = floatReg + " = " + floatVal.ToString("G6");
                    DetailedInstruction += "\t" + regDetails;
                }
            }

            getRegDetails = Regex.Matches(DetailedInstruction, "r[0-9]+");

            for (int i = 0; i < getRegDetails.Count; i++)
            {
                regDetails           = getRegDetails[i].Value + " = " + GlobalFunctions.toHex(GetRegisterValue(int.Parse(getRegDetails[i].Value.Substring(1)) + 7));
                DetailedInstruction += "\t" + regDetails;
            }

            getRegDetails = Regex.Matches(DetailedInstruction, "\\(r[0-9]+\\)");

            for (int i = 0; i < getRegDetails.Count; i++)
            {
                if (ValidMemory.validAddress(MemoryAddress))
                {
                    regDetails = "[" + GlobalFunctions.toHex(MemoryAddress) + "] = " + GlobalFunctions.toHex(gecko.peek(MemoryAddress));
                    if (Regex.Match(DetailedInstruction, "lfd|stfd").Success)
                    {
                        regDetails += GlobalFunctions.toHex(gecko.peek(MemoryAddress + 4));
                    }
                    DetailedInstruction += "\t" + regDetails;
                }
            }

            if ((isConditionalBranch(currentInstruction) && BranchTaken(currentInstruction)) || currentInstruction[0] == "b")
            {
                DetailedInstruction += "\r\n";
                for (int i = 0; i < logIndent; i++)
                {
                    DetailedInstruction += "|  ";
                }
                DetailedInstruction += "\t...\t...\t...\t...";
            }

            if (logIndent > 0)
            {
                for (int i = 0; i < logIndent; i++)
                {
                    DetailedInstruction = DetailedInstruction.Insert(0, "|  ");
                }
            }

            if (IsBL())
            {
                logIndent++;
            }

            if (logIndent > 0 && IsBLR())
            {
                logIndent--;
            }

            return(DetailedInstruction);
        }
コード例 #23
0
        private void SinglePlayerForm_Load(object sender, EventArgs e)
        {
            Form1    mainForm = (Form1)this.Owner;
            TCPGecko gecko    = mainForm.Gecko;

            // apply diff to the addresses
            saveSlotsAddress        += mainForm.diff;
            environmentFlagsAddress += mainForm.diff;
            heroShotAddress         += mainForm.diff;
            inkTankAddress          += mainForm.diff;
            splatBombAddress        += mainForm.diff;
            burstBombAddress        += mainForm.diff;
            seekerAddress           += mainForm.diff;
            powerEggsAddress        += mainForm.diff;

            // dump all single player save slots
            uint[] rawLevelData = Form1.DumpSaveSlots(gecko, 0, saveSlotsAddress, 768);

            // read data from slots
            int j = 0;

            while (j < rawLevelData.Length)
            {
                uint levelNumber = rawLevelData[j];

                // check if an empty save slot
                if (levelNumber == 0xFFFFFFFF)
                {
                    // we've reached the end
                    break;
                }

                uint clearState = rawLevelData[j + 1];
                bool scroll     = Convert.ToBoolean(rawLevelData[j + 2]);

                // add to the list
                levelSaveData.Add(new LevelData(levelNumber, clearState, scroll));

                // move to next slot
                j += 3;
            }

            // load the list view
            ReloadListView();

            // load power eggs
            powerEggsBox.Value = Convert.ToInt32(gecko.peek(powerEggsAddress));

            // load upgrades
            heroShotBox.SelectedIndex  = Convert.ToInt32(gecko.peek(heroShotAddress));
            inkTankBox.SelectedIndex   = Convert.ToInt32(gecko.peek(inkTankAddress));
            splatBombBox.SelectedIndex = Convert.ToInt32(gecko.peek(splatBombAddress));

            // for these upgrades, 0xFFFFFFFF = locked
            uint burstBomb = gecko.peek(burstBombAddress);

            if (burstBomb == 0xFFFFFFFF)
            {
                burstBombBox.SelectedIndex = 0;
            }
            else
            {
                burstBombBox.SelectedIndex = Convert.ToInt32(burstBomb + 1);
            }

            uint seeker = gecko.peek(seekerAddress);

            if (seeker == 0xFFFFFFFF)
            {
                seekerBox.SelectedIndex = 0;
            }
            else
            {
                seekerBox.SelectedIndex = Convert.ToInt32(seeker + 1);
            }
        }
コード例 #24
0
        private void writeString(string s, uint offset)
        {
            uint push = 0;
            int  pos  = 0;

            if (offset % 4 != 0)
            {
                push    = s[pos++];
                offset -= offset % 4;
                Gecko.poke(offset, push);
                offset += 4;
            }
            for (; pos < s.Length; pos += 2, offset += 4)
            {
                if (pos + 1 == s.Length)
                {
                    push = (uint)(s[pos] << 16) + (Gecko.peek(offset) & 0xFF);
                }
                push = (uint)(s[pos] << 16) + s[pos + 1];
                Gecko.poke(offset, push);
            }
        }
コード例 #25
0
        private void SinglePlayerForm_Load(object sender, EventArgs e)
        {
            Form1    mainForm = (Form1)this.Owner;
            TCPGecko gecko    = mainForm.Gecko;

            // apply diff to the addresses
            saveSlotsAddress        += mainForm.diff;
            environmentFlagsAddress += mainForm.diff;
            heroShotAddress         += mainForm.diff;
            inkTankAddress          += mainForm.diff;
            splatBombAddress        += mainForm.diff;
            burstBombAddress        += mainForm.diff;
            seekerAddress           += mainForm.diff;
            powerEggsAddress        += mainForm.diff;

            // load level information
            // iterate over all 64 save slots
            uint currentPosition = saveSlotsAddress;

            for (int i = 0; i < 64; i++)
            {
                uint levelNumber = gecko.peek(currentPosition);

                // skip if an empty save slot
                if (levelNumber == 0xFFFFFFFF)
                {
                    continue;
                }

                uint clearState = gecko.peek(currentPosition + 0x4);
                bool scroll     = Convert.ToBoolean(gecko.peek(currentPosition + 0x8));

                // add to the list
                levelSaveData.Add(new LevelData(levelNumber, clearState, scroll));

                // move to next save slot
                currentPosition += 0xC;
            }

            // load the list view
            ReloadListView();

            // load power eggs
            powerEggsBox.Value = Convert.ToInt32(gecko.peek(powerEggsAddress));

            // load upgrades
            heroShotBox.SelectedIndex  = Convert.ToInt32(gecko.peek(heroShotAddress));
            inkTankBox.SelectedIndex   = Convert.ToInt32(gecko.peek(inkTankAddress));
            splatBombBox.SelectedIndex = Convert.ToInt32(gecko.peek(splatBombAddress));

            // for these upgrades, 0xFFFFFFFF = locked
            uint burstBomb = gecko.peek(burstBombAddress);

            if (burstBomb == 0xFFFFFFFF)
            {
                burstBombBox.SelectedIndex = 0;
            }
            else
            {
                burstBombBox.SelectedIndex = Convert.ToInt32(burstBomb + 1);
            }

            uint seeker = gecko.peek(seekerAddress);

            if (seeker == 0xFFFFFFFF)
            {
                seekerBox.SelectedIndex = 0;
            }
            else
            {
                seekerBox.SelectedIndex = Convert.ToInt32(seeker + 1);
            }
        }
コード例 #26
0
        public void load()
        {
            hold();
            int  rank   = ToInt32(Gecko.peek(0x12CDC1A8 + diff)) + 1;
            int  okane  = ToInt32(Gecko.peek(0x12CDC1A0 + diff));
            int  ude    = ToInt32(Gecko.peek(0x12CDC1AC + diff));
            int  mae    = ToInt32(Gecko.peek(0x12CDC1B0 + diff));
            int  sazae  = ToInt32(Gecko.peek(0x12CDC1B4 + diff));
            int  gender = ToInt32(Gecko.peek(0x12CD1D90 + diff));
            int  eyes   = ToInt32(Gecko.peek(0x12CD1D98 + diff));
            int  skin   = ToInt32(Gecko.peek(0x12CD1D94 + diff));
            uint figure = Gecko.peek(0x12D1F130 + diff);

            try
            {
                rankBox.Value = rank;
            }
            catch (ArgumentOutOfRangeException)
            {
                int rankDisplay = fixStuff(Properties.Strings.BAD_RANK_1, rank, Properties.Strings.BAD_RANK_2, 0x12CDC1A8, 49, 50, 1);
                rankBox.Value = rankDisplay;
            }
            try
            {
                kaneBox.Value = okane;
            }
            catch (ArgumentOutOfRangeException)
            {
                int okaneDisplay = fixStuff(Properties.Strings.BAD_OKANE_1, okane, Properties.Strings.BAD_OKANE_2, 0x12CDC1A0, 9999999, 9999999, 0);
                kaneBox.Value = okaneDisplay;
            }
            try
            {
                maeBox.Value = mae;
            }
            catch (ArgumentOutOfRangeException)
            {
                int maeDisplay = fixStuff(Properties.Strings.BAD_MAE_1, mae, Properties.Strings.BAD_MAE_2, 0x12CDC1B0, 99, 99, 0);
                maeBox.Value = maeDisplay;
            }
            try
            {
                sazaeBox.Value = sazae;
            }
            catch (ArgumentOutOfRangeException)
            {
                int sazaeDisplay = fixStuff(Properties.Strings.BAD_SAZAE_1, sazae, Properties.Strings.BAD_SAZAE_2, 0x12CDC1B4, 999, 999, 0);
                sazaeBox.Value = sazaeDisplay;
            }
            try
            {
                udeBox.SelectedIndex = ude;
            }
            catch (ArgumentOutOfRangeException)
            {
                int udeDisplay = fixStuff(Properties.Strings.BAD_UDE_1, ude, Properties.Strings.BAD_UDE_2, 0x12CDC1AC, 10, 10, 0);
                udeBox.SelectedIndex = udeDisplay;
            }

            if (figure == 0xFFFFFFFF)
            {
                amiiboBox.SelectedIndex = 0;
            }
            else
            {
                amiiboBox.SelectedIndex = ToInt32(figure + 1);
            }

            genderBox.SelectedIndex = gender;
            eyeBox.SelectedIndex    = eyes;
            skinBox.SelectedIndex   = skin;
            release();
        }