Example #1
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 #2
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 #3
0
 private int ResolveReflexiveOffset(int Offset)
 {
     return(H2Launcher.Memory.ReadInt(0, H2Launcher.MapPointer(TagBaseOffset + Offset)));
 }
Example #4
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;
            }
        }