Exemplo n.º 1
0
        protected DeepPointer AppendBaseOffset(params int[] appendOffsets)
        {
            List <int> offsets = new List <int>(ObjectDP.GetOffsets());

            offsets.AddRange(appendOffsets); // add new offsets
            return(new DeepPointer(ObjectDP.GetBase(), new List <int>(offsets)));
        }
Exemplo n.º 2
0
        protected DeepPointer AppendBaseLastOffset(params int[] appendOffsets)
        {
            List <int> offsets = new List <int>(ObjectDP.GetOffsets());

            offsets.RemoveAt(offsets.Count - 1); // removes last offset
            offsets.AddRange(appendOffsets);     // add new offsets
            return(new DeepPointer(ObjectDP.GetBase(), new List <int>(offsets)));
        }
Exemplo n.º 3
0
        public EnemyShieldOrb(Enemy enemy) : base(enemy.GetObjectDP())
        {
            Pos       = enemy.Pos;
            enemyType = EnemyTypes.ShieldOrb;

            // glow pointer
            List <int> offsets = new List <int>(ObjectDP.GetOffsets());

            offsets.RemoveAt(offsets.Count - 1);
            offsets.Add(0x6c8);
            offsets.Add(0x130);
            offsets.Add(0x1d0);
            shieldGlowDP = new DeepPointer(ObjectDP.GetBase(), offsets);
        }
Exemplo n.º 4
0
        public EnemyDrone(Enemy enemy) : base(enemy.GetObjectDP())
        {
            enemyType = EnemyTypes.Drone;
            Pos       = enemy.Pos;

            // extra pos pointer
            List <int> offsets = new List <int>(ObjectDP.GetOffsets());

            offsets.RemoveAt(offsets.Count - 1);
            offsets.Add(0x280);
            offsets.Add(0x650);
            offsets.Add(0x340);
            dronePosDP = new DeepPointer(ObjectDP.GetBase(), offsets);
        }
Exemplo n.º 5
0
        public void LinkObject(int enemies)
        {
            if (enemies < 0)
            {
                return;
            }

            for (int i = 0; i < enemies; i++)
            {
                List <int> offsets = new List <int>(ObjectDP.GetOffsets());
                offsets.RemoveAt(offsets.Count - 1);
                offsets.Add(0x6f0);
                offsets.Add(0x8 * LinkedObjectsDP.Count);
                offsets.Add(0x220);
                LinkedObjectsDP.Add(new DeepPointer(ObjectDP.GetBase(), offsets));
            }
        }
Exemplo n.º 6
0
        private void AddPatrolPoint(Vector3f pos, float delay = .2f)
        {
            List <int>   offsets = new List <int>(ObjectDP.GetOffsets());
            SniperPatrol patrol;

            // patrol DP
            offsets.RemoveAt(offsets.Count - 1);
            offsets.Add(0x810);
            if (patrolPoints.Count == 0)
            {
                offsets.Add(0x0);
            }
            else
            {
                offsets.Add(0x8 * patrolPoints.Count);
            }

            offsets.Add(0x130);
            offsets.Add(0x1D0);
            patrol.DP_Pos = new DeepPointer(ObjectDP.GetBase(), new List <int>(offsets));

            // delay DP
            offsets = new List <int>(ObjectDP.GetOffsets());
            offsets.RemoveAt(offsets.Count - 1);
            offsets.Add(0x810);
            if (patrolPoints.Count == 0)
            {
                offsets.Add(0x0);
            }
            else
            {
                offsets.Add(0x8 * patrolPoints.Count);
            }
            offsets.Add(0x248);
            patrol.DP_Delay = new DeepPointer(ObjectDP.GetBase(), new List <int>(offsets));


            // pos and delay values
            patrol.Delay    = delay;
            patrol.Pos      = pos;
            patrol.PosPtr   = IntPtr.Zero;
            patrol.DelayPtr = IntPtr.Zero;

            patrolPoints.Add(patrol);
        }
Exemplo n.º 7
0
        public void HideBeam_Range(int enemyIndex, int beams)
        {
            if (enemyIndex < 0 || beams < 0)
            {
                return;
            }

            for (int j = 0; j < beams; j++)
            {
                List <int> offsets = new List <int>(ObjectDP.GetOffsets());
                offsets.RemoveAt(offsets.Count - 1);
                offsets.Add(0x6f0);
                offsets.Add(0x8 * enemyIndex);
                offsets.Add(0x200);
                offsets.Add(0x8 * (j + 1));
                offsets.Add(0x1D0);
                BeamsToHide.Add(new DeepPointer(ObjectDP.GetBase(), offsets));
            }
        }
Exemplo n.º 8
0
        public void DisableAttachedCP(Process game)
        {
            IntPtr parentPtr, killcountPtr, enemyPtr, killlistPtr, basePtr;
            ulong  parent;
            int    killcount;
            //check if there is a prent object
            List <int> offsets = new List <int>(ObjectDP.GetOffsets());

            offsets[offsets.Count - 1] = 0x5D0;
            DeepPointer parentDP = new DeepPointer(ObjectDP.GetBase(), offsets);

            parentDP.DerefOffsets(GameHook.game, out parentPtr);
            GameHook.game.ReadValue <ulong>(parentPtr, out parent);
            //return if there is no parent object
            if (parent == 0)
            {
                return;
            }

            //read kill count
            offsets.Add(0x230);
            DeepPointer killcountDP = new DeepPointer(ObjectDP.GetBase(), offsets);

            killcountDP.DerefOffsets(GameHook.game, out killcountPtr);
            GameHook.game.ReadValue <int>(killcountPtr, out killcount);
            //remove parent object if kill count = 0
            if (killcount == 0)
            {
                game.WriteBytes(parentPtr, new byte[8] {
                    0, 0, 0, 0, 0, 0, 0, 0
                });
                return;
            }
            //this enemy start address
            basePtr = parentPtr - 0x5d0;

            //find killlist address
            bool foundPtr = false;

            offsets[offsets.Count - 1] = 0x228;
            offsets.Add(0x0);
            DeepPointer killlistDP = new DeepPointer(ObjectDP.GetBase(), offsets);

            killlistDP.DerefOffsets(GameHook.game, out killlistPtr);
            for (var i = 0; i < killcount; i++)
            {
                //find base pointer in kill list
                GameHook.game.ReadValue <IntPtr>(killlistPtr + 0x8 * i, out enemyPtr);
                if (enemyPtr == basePtr)
                {
                    //switch pointers
                    foundPtr = true;
                    if (i != killcount - 1)
                    {
                        GameHook.game.ReadValue <IntPtr>(killlistPtr + 0x8 * (killcount - 1), out enemyPtr);
                        GameHook.game.WriteBytes(killlistPtr + 0x8 * (killcount - 1), BitConverter.GetBytes((ulong)basePtr));
                        GameHook.game.WriteBytes(killlistPtr + 0x8 * i, BitConverter.GetBytes((ulong)enemyPtr));
                    }
                    break;
                }
            }

            if (!foundPtr)
            {
                return;
            }

            killcount -= 1;
            // update decreased value
            GameHook.game.WriteBytes(killcountPtr, BitConverter.GetBytes(killcount));
            //remove parent object
            game.WriteBytes(parentPtr, new byte[8] {
                0, 0, 0, 0, 0, 0, 0, 0
            });
        }