Example #1
0
        //private void switchLanguage(ControlCollection Controls)
        //{
        //    foreach(Control C in Controls)
        //    {
        //        C.Text = C.Tag;
        //        if(C.Controls.Count > 0)

        //    }
        //}
        public void playButton_Click(object sender, EventArgs e)
        {
            if (!this.SettingsOpen)
            {
                var loginResult = H2Launcher.WebControl.Login(usernameTextBox.Text, passwordTextBox.Text, H2Launcher.XliveSettings.loginToken);
                if (loginResult.LoginResultEnum != LoginResultEnum.Successfull)
                {
                    this.usernameTextBox.Text = "";
                    this.passwordTextBox.Text = "";
                }

                switch (loginResult.LoginResultEnum)
                {
                case LoginResultEnum.Successfull:
                {
                    H2Launcher.LauncherSettings.RememberUsername = usernameTextBox.Text;
                    H2Launcher.StartHalo(usernameTextBox.Text, loginResult.LoginToken, this);
                    break;
                }

                case LoginResultEnum.InvalidLoginToken:
                {
                    MetroMessageBox.Show(this, "The login token was no longer valid.\r\nPlease re-enter your login information and try again.", Fun.PauseIdiomGenerator, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                    H2Launcher.XliveSettings.loginToken = "";
                    break;
                }

                case LoginResultEnum.InvalidUsernameOrPassword:
                {
                    MetroMessageBox.Show(this, "The username or password entered is either incorrect or invalid.\r\nPlease try again.", Fun.PauseIdiomGenerator, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                    break;
                }

                case LoginResultEnum.Banned:
                {
                    if (MetroMessageBox.Show(this, "You have been banned, please visit the forum to appeal your ban.\r\nWould you like us to open the forums for you?.", Fun.PauseIdiomGenerator, System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error) == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start(@"http://www.halo2vista.com/forums/");
                    }
                    break;
                }

                case LoginResultEnum.GenericFailure:
                {
                    //wat do?
                    break;
                }
                }
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "You cannot do that!" + Environment.NewLine + Environment.NewLine + "Close the settings menu before you launch the game.", "Wait a moment!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                this._settings.BringToFront();
            }
        }
Example #2
0
        public void SetCrossHairPosition()
        {
            //Xbox FOV 1.13
            //Xbox Crosshair Offset: 1.38

            //Default FOV 1
            //Default Crosshair Offset: 1.66

            float YOffset = (float)Math.Round(0.291f - (0.0024f * H2Launcher.LauncherSettings.FieldOfView), 4, MidpointRounding.ToEven);

            H2Launcher.Memory.WriteFloat(0, false, H2Launcher.MapPointer(0x3dc00), YOffset);
        }
Example #3
0
        public async void ExecuteHotKeys()
        {
            await Task.Run(() =>
            {
                switch (H2Launcher.H2Game.GameState)
                {
                case H2GameState.lobby:
                    {
                        if (this.xDelayHotkey != null)
                        {
                            if (this.xDelayHotkey.Pressed())
                            {
                                for (int i = 0; i < 10; i++)
                                {
                                    H2Launcher.Memory.WriteByte(0, true, 0x0050A3B8, 0);
                                }
                            }
                        }
                        break;
                    }

                case H2GameState.ingame:
                    {
                        if (this.noHudHotkey != null)
                        {
                            if (this.noHudHotkey.Pressed())
                            {
                                H2Launcher.Memory.WriteByte(0, true, 0x2228F8, (byte)((this.noHudHotkey.Triggered) ? 0x84 : 0x85));
                                H2Launcher.Memory.WriteByte(0, true, 0x222311, (byte)((this.noHudHotkey.Triggered) ? 0x84 : 0x85));
                                H2Launcher.Memory.WriteUInt(0, false, H2Launcher.MapPointer(0xD8C5BC), ((this.noHudHotkey.Triggered) ? 0xF0E3367D : 0xFFFFFFFF));
                                this.noHudHotkey.Triggered = !this.noHudHotkey.Triggered;
                            }
                        }
                        break;
                    }
                }
            });
        }
Example #4
0
 private int ResolveReflexiveOffset(int Offset)
 {
     return(H2Launcher.Memory.ReadInt(0, H2Launcher.MapPointer(TagBaseOffset + Offset)));
 }
Example #5
0
        //private int MeleeAAMagnitismAngleOffset = 0x19C;
        //private int MeleeAAMagnitismRangeOffset = 0x1A0;
        //private int MeleeAAThrottleMagnitudeOffset = 0x1A4;
        //private int MeleeAAThrottleMinDistanceOffset = 0x1A8;
        //private int MeleeAAThrottleMaxAdjustmentAgleOffset = 0x1AC;
        //private int AAAngleOffset = 0x208;
        //private int AARangeOffset = 0x20C;
        //private int MagnetismAngleOffset = 0x210;
        //private int MagnetismRangeOffset = 0x214;
        //private int DeviationAngleOffset = 0x21C;

        //private int BarrelReflexiveCountOffset = 0x2D0;
        //private int BarrelReflexiveOffset = 0x2D4;
        //private int RoundsPerSecondMinOffset = 0x4;
        //private int RoundsPerSecondMaxOffset = 0x8;
        //private int ShotsPerFireUpperOffset = 0x1C; //Short
        //private int ShotsPerFireLowerOffset = 0x1E; //Short
        //private int FireRecoveryTimeOffset = 0x20;
        //private int MagazineOffset = 0x28; //Short
        //private int RoundsPerShotOffset = 0x2A; //Short
        //private int ErrorAccelerationTimeOffset = 0x38;
        //private int ErrorDecelerationTimeOffset = 0x3C;
        //private int ProjectilesPerShotOffset = 0x6A;
        //private int ErrorAngleMin = 0x74;
        //private int ErrorAngleMax = 0x78;
        //private int HeatGeneratedPerRoundOffset = 0xA4;
        //private int OverloadTimeSecOffset = 0xA8;

        /*
         *
         * When i start again change the offsets to a object[object[]] that contains (name, offset, type) for easier parsing.
         *
         * */
        public void GhettoRipping()
        {
            foreach (object[] Weapon in this.Weapon)
            {
                StringBuilder Bartley      = new StringBuilder();
                string        WeaponName   = (string)Weapon[0];
                int           WeaponOffset = (int)Weapon[1];
                Bartley.AppendLine(string.Format("{0}", WeaponName));
                foreach (object[] Property in this.Properties)
                {
                    string PropertyName   = (string)Property[0];
                    int    PropertyOffset = (int)Property[1];
                    string PropertyType   = (string)Property[2];
                    int    tOffset        = H2Launcher.MapPointer(WeaponOffset + PropertyOffset);
                    switch (PropertyType)
                    {
                    case "Single":     //Float
                    {
                        float tValue = H2Launcher.Memory.ReadFloat(0, tOffset);
                        Bartley.AppendLine(string.Format("{0}:{1}:{2}", PropertyName, PropertyOffset.ToString("X"), tValue.ToString()));
                        break;
                    }

                    case "Int16":     //Short
                    {
                        short tValue = H2Launcher.Memory.ReadShort(0, tOffset);
                        Bartley.AppendLine(string.Format("{0}:{1}:{2}", PropertyName, PropertyOffset.ToString("X"), tValue.ToString()));
                        break;
                    }

                    case "Reflexive":
                    {
                        int rCount     = H2Launcher.Memory.ReadInt(0, tOffset);
                        int rRawOffset = H2Launcher.Memory.ReadInt(0, tOffset + 4);
                        int rOffset    = H2Launcher.MapPointer(rRawOffset);
                        int rSize      = (int)Property[3];
                        Bartley.AppendLine(string.Format("{0}:{1}:{2}", PropertyName, rRawOffset.ToString("X"), rCount.ToString()));
                        for (int i = 0; i < rCount; i++)    //Loop through every part of the Reflexive
                        {
                            int pOffset = rSize * i;        //To reach the next property size of each object * i.
                            Bartley.AppendLine(string.Format("\t{0}", i.ToString()));
                            foreach (object[] rProperty in (object[])Property[4])
                            {
                                string rPropertyName   = (string)rProperty[0];
                                int    rPropertyOffset = rOffset + pOffset + (int)rProperty[1];
                                string rPropertyType   = (string)rProperty[2];
                                switch (rPropertyType)
                                {
                                case "Single":
                                {
                                    float tValue = H2Launcher.Memory.ReadFloat(0, rPropertyOffset);
                                    Bartley.AppendLine(string.Format("\t\t{0}:{1}:{2}", rPropertyName, rPropertyOffset.ToString("X"), tValue.ToString()));
                                    break;
                                }

                                case "Int16":             //Short
                                {
                                    short tValue = H2Launcher.Memory.ReadShort(0, rPropertyOffset);
                                    Bartley.AppendLine(string.Format("\t\t{0}:{1}:{2}", rPropertyName, rPropertyOffset.ToString("X"), tValue.ToString()));
                                    break;
                                }
                                }
                            }
                        }
                    }
                    break;
                    }
                }
                File.WriteAllText(Application.StartupPath + "\\AntiCheat\\" + WeaponName + ".txt", Bartley.ToString());
                int ss = 0;
            }
        }