Example #1
0
        private bool GetBoneById(Int64 pEnemySoldier, int Id, out Vector3 _World)
        {
            _World = new Vector3();

            Int64 pRagdollComp = RPM.ReadInt64(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_ragdollComponent);

            if (!RPM.IsValid(pRagdollComp))
            {
                return(false);
            }

            byte m_ValidTransforms = RPM.ReadByte(pRagdollComp + (Offsets.PZ_ClientRagDollComponent.m_ragdollTransforms + Offsets.PZ_UpdatePoseResultData.m_ValidTransforms));

            if (m_ValidTransforms != 1)
            {
                return(false);
            }

            Int64 pQuatTransform = RPM.ReadInt64(pRagdollComp + (Offsets.PZ_ClientRagDollComponent.m_ragdollTransforms + Offsets.PZ_UpdatePoseResultData.m_ActiveWorldTransforms));

            if (!RPM.IsValid(pQuatTransform))
            {
                return(false);
            }

            _World = RPM.ReadVector3(pQuatTransform + Id * 0x20);
            return(true);
        }
Example #2
0
        private Int64 GetLocalSoldier()
        {
            Int64 pGContext = RPM.ReadInt64(Offsets.OFFSET_CLIENTGAMECONTEXT);

            if (!RPM.IsValid(pGContext))
            {
                return(0x000F000000000000);
            }

            Int64 pPlayerManager = RPM.ReadInt64(pGContext + Offsets.PZ_ClientGameContext.m_pPlayerManager);

            if (!RPM.IsValid(pPlayerManager))
            {
                return(0x000F000000000000);
            }

            Int64 plocalPlayer = RPM.ReadInt64(pPlayerManager + Offsets.PZ_ClientPlayerManager.m_pLocalPlayer);

            if (!RPM.IsValid(plocalPlayer))
            {
                return(0x000F000000000000);
            }

            Int64 pLocalSoldier = GetClientSoldierEntity(plocalPlayer, localPlayer);

            if (!RPM.IsValid(pLocalSoldier))
            {
                return(0x000F000000000000);
            }
            else
            {
                return(pLocalSoldier);
            }
        }
Example #3
0
        // Quit Application
        private void Quit()
        {
            updateStream.Abort();
            //aimbotStream.Abort();
            RPM.CloseProcess();

            // Close main process
            Environment.Exit(0);
        }
Example #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter your Origin ID: ");
            NamePlayer = Console.ReadLine();
            if (RPM.Inject("bf1"))
            {
                Console.WriteLine("Have fun " + NamePlayer + "  :)  ");
                Console.WriteLine("Wait: ");

                Thread.Sleep(2000);
                Console.WriteLine("Done: ");

                Overlay overlay = new Overlay();

                Console.ReadLine();
            }
            Console.ReadKey();
        }
Example #5
0
        // Update Thread
        private void Update(object sender)
        {
            Pimp pimp = new Pimp(Pimp.BlockMethod.Zero, true, true, false);

            if (pimp.Inject("bf4"))
            {
                while (IsGameRunning)
                {
                    bool check = pimp.IsScreenShot();
                    if (!check)
                    {
                        rect.Width  = overlay.Width;
                        rect.Height = overlay.Height;
                        d2d.BeginScene();
                        d2d.ClearScene(clearBrush);
                        OverlayControl();
                        d2d.EndScene();
                    }
                }
                RPM.CloseProcess();
                Environment.Exit(0);
            }
        }
Example #6
0
        // Init
        public Overlay(Process process)
        {
            this.process = process;

            // check the game window exists then create the overlay
            while (true)
            {
                handle = NativeMethods.FindWindow(null, "Battlefield 4");

                if (handle != IntPtr.Zero)
                {
                    break;
                }
            }

            gameCheckThread = new Thread(new ParameterizedThreadStart(GameCheck));
            gameCheckThread.Start();
            if (process.MainWindowHandle == IntPtr.Zero)
            {
                Thread.Sleep(1000);
            }

            RPM.OpenProcess(process.Id);

            // setup the overlay
            var rendererOptions = new Direct2DRendererOptions()
            {
                AntiAliasing = OPTIONS_AA,
                Hwnd         = IntPtr.Zero,
                MeasureFps   = OPTIONS_ShowFPS,
                VSync        = OPTIONS_VSync
            };

            OverlayManager manager = new OverlayManager(handle, rendererOptions);

            overlay    = manager.Window;
            d2d        = manager.Graphics;
            clearBrush = d2d.CreateBrush(0xF5, 0xF5, 0xF5, 0);  // our transparent colour



            // Init player array
            localPlayer = new GPlayer();
            //localPlayer.CurrentWeapon = new Weapon();
            localWeapons  = new List <Gun>();
            players       = new List <GPlayer>();
            targetEnimies = new List <GPlayer>();

            // Init update thread
            updateStream = new Thread(new ParameterizedThreadStart(Update));
            updateStream.Start();


            ScreenCapture sc = new ScreenCapture();

            sc.CaptureWindowToFile(process.MainWindowHandle, @"C:\PZ_BF4_FAIRFIGHT_GAME_SS.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);



            // Init Key Listener
            KeyAssign();
        }
Example #7
0
        private void MainScan()
        {
            var font = d2d.CreateFont("Consolas", 11);

            players.Clear();
            targetEnimies.Clear();

            // Read Local
            #region Get Local Player

            // Render View
            Int64 pGameRenderer = RPM.ReadInt64(Offsets.OFFSET_GAMERENDERER);
            Int64 pRenderView   = RPM.ReadInt64(pGameRenderer + Offsets.PZ_GameRenderer.m_pRenderView);

            // Read Screen Matrix
            localPlayer.ViewProj = RPM.ReadMatrix(pRenderView + Offsets.PZ_RenderView.m_viewProj);

            Int64 pGContext = RPM.ReadInt64(Offsets.OFFSET_CLIENTGAMECONTEXT);
            if (!RPM.IsValid(pGContext))
            {
                return;
            }

            Int64 pPlayerManager = RPM.ReadInt64(pGContext + Offsets.PZ_ClientGameContext.m_pPlayerManager);
            if (!RPM.IsValid(pPlayerManager))
            {
                return;
            }

            Int64 plocalPlayer = RPM.ReadInt64(pPlayerManager + Offsets.PZ_ClientPlayerManager.m_pLocalPlayer);
            if (!RPM.IsValid(plocalPlayer))
            {
                return;
            }

            localPlayer.Team = RPM.ReadInt32(plocalPlayer + Offsets.PZ_ClientPlayer.m_teamId);

            Int64 pLocalSoldier = GetClientSoldierEntity(plocalPlayer, localPlayer);
            if (!RPM.IsValid(pLocalSoldier))
            {
                return;
            }

            Int64 pHealthComponent = RPM.ReadInt64(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_pHealthComponent);
            if (!RPM.IsValid(pHealthComponent))
            {
                return;
            }

            Int64 pPredictedController = RPM.ReadInt64(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_pPredictedController);
            if (!RPM.IsValid(pPredictedController))
            {
                return;
            }

            // Health
            localPlayer.Health    = RPM.ReadFloat(pHealthComponent + Offsets.PZ_HealthComponent.m_Health);
            localPlayer.MaxHealth = RPM.ReadFloat(pHealthComponent + Offsets.PZ_HealthComponent.m_MaxHealth);

            if (localPlayer.IsDead())
            {
                return;
            }

            // Origin
            localPlayer.Origin   = RPM.ReadVector3(pPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Position);
            localPlayer.Velocity = RPM.ReadVector3(pPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Velocity);

            // Other
            localPlayer.Pose = RPM.ReadInt32(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_poseType);
            localPlayer.Yaw  = RPM.ReadFloat(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_authorativeYaw);

            localPlayer.IsOccluded = RPM.ReadByte(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_occluded);

            #endregion

            // Pointer to Players Array
            Int64 m_ppPlayer = RPM.ReadInt64(pPlayerManager + Offsets.PZ_ClientPlayerManager.m_ppPlayer);
            if (!RPM.IsValid(m_ppPlayer))
            {
                return;
            }


            #region Get Other Players by Id
            for (uint i = 0; i < 64; i++)
            {
                // Create new Player
                GPlayer player = new GPlayer();

                // Pointer to ClientPlayer class (Player Array + (Id * Size of Pointer))
                Int64 pEnemyPlayer = RPM.ReadInt64(m_ppPlayer + (i * sizeof(Int64)));
                if (!RPM.IsValid(pEnemyPlayer))
                {
                    continue;
                }

                player.Name = RPM.ReadString(pEnemyPlayer + Offsets.PZ_ClientPlayer.szName, 10);

                Int64 pEnemySoldier = GetClientSoldierEntity(pEnemyPlayer, player);
                if (!RPM.IsValid(pEnemySoldier))
                {
                    continue;
                }

                Int64 pEnemyHealthComponent = RPM.ReadInt64(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_pHealthComponent);
                if (!RPM.IsValid(pEnemyHealthComponent))
                {
                    continue;
                }

                Int64 pEnemyPredictedController = RPM.ReadInt64(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_pPredictedController);
                if (!RPM.IsValid(pEnemyPredictedController))
                {
                    continue;
                }

                // Health
                player.Health    = RPM.ReadFloat(pEnemyHealthComponent + Offsets.PZ_HealthComponent.m_Health);
                player.MaxHealth = RPM.ReadFloat(pEnemyHealthComponent + Offsets.PZ_HealthComponent.m_MaxHealth);

                if (player.Health <= 0.1f) // DEAD
                {
                    continue;
                }

                // Origin (Position in Game X, Y, Z)
                player.Origin   = RPM.ReadVector3(pEnemyPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Position);
                player.Velocity = RPM.ReadVector3(pEnemyPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Velocity);

                // Other
                player.Team       = RPM.ReadInt32(pEnemyPlayer + Offsets.PZ_ClientPlayer.m_teamId);
                player.Pose       = RPM.ReadInt32(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_poseType);
                player.Yaw        = RPM.ReadFloat(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_authorativeYaw);
                player.IsOccluded = RPM.ReadByte(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_occluded);

                // Distance to You
                player.Distance = Vector3.Distance(localPlayer.Origin, player.Origin);

                players.Add(player);

                if (player.IsValid())
                {
                    // Player Bone
                    bBoneOk = (GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_HEAD, out player.Bone.BONE_HEAD) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTELBOWROLL, out player.Bone.BONE_LEFTELBOWROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTFOOT, out player.Bone.BONE_LEFTFOOT) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTHAND, out player.Bone.BONE_LEFTHAND) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTKNEEROLL, out player.Bone.BONE_LEFTKNEEROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTSHOULDER, out player.Bone.BONE_LEFTSHOULDER) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_NECK, out player.Bone.BONE_NECK) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTELBOWROLL, out player.Bone.BONE_RIGHTELBOWROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTFOOT, out player.Bone.BONE_RIGHTFOOT) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTHAND, out player.Bone.BONE_RIGHTHAND) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTKNEEROLL, out player.Bone.BONE_RIGHTKNEEROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTSHOULDER, out player.Bone.BONE_RIGHTSHOULDER) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_SPINE, out player.Bone.BONE_SPINE) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_SPINE1, out player.Bone.BONE_SPINE1) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_SPINE2, out player.Bone.BONE_SPINE2));



                    #region Drawing ESP on Overlay

                    // Desconsidera Aliados
                    if (!bEspAllies && (player.Team == localPlayer.Team))
                    {
                        continue;
                    }

                    // Desconsidera os "Não Visíveis"
                    if (bEspVisiblesOnly && (!player.IsVisible() || player.Distance > 75) && !player.InVehicle)
                    {
                        continue;
                    }

                    #region ESP Bone
                    if (bBoneOk && ESP_Bone)
                    {
                        DrawBone(player);
                    }
                    #endregion

                    Vector3 w2sFoot, w2sHead;
                    if (WorldToScreen(player.Origin, out w2sFoot) && WorldToScreen(player.Origin, player.Pose, out w2sHead))
                    {
                        float H = w2sFoot.Y - w2sHead.Y;
                        float W = H / 2;
                        float X = w2sHead.X - W / 2;
                        int   iAux;
                        #region ESP Color

                        var color = (player.Team == localPlayer.Team) ? d2d.CreateBrush(0, 0, 255, 255) : player.IsVisible() ? d2d.CreateBrush(0, 255, 0, 255) : d2d.CreateBrush(255, 0, 0, 255);
                        #endregion

                        #region ESP Box
                        // ESP Box
                        if (ESP_Box && !bEspVisiblesOnly)
                        {
                            if (bEsp3D)
                            {
                                DrawAABB(player.GetAABB(), player.Origin, player.Yaw, color); // 3D Box
                            }
                            else
                            {
                                d2d.DrawRectangle((int)X, (int)w2sHead.Y, (int)W, (int)H, 2, color); // 2D Box
                            }
                        }
                        #endregion

                        #region ESP Vehicle
                        if (ESP_Vehicle)
                        {
                            DrawAABB(player.VehicleAABB, player.VehicleTranfsorm, player.Team == localPlayer.Team ? d2d.CreateBrush(64, 154, 200, 255) : d2d.CreateBrush(255, 129, 72, 255));
                        }
                        #endregion

                        #region ESP Name
                        if (ESP_Name && !bEspVisiblesOnly)
                        {
                            d2d.DrawTextWithBackground(player.Name, (int)X, (int)w2sFoot.Y, font, d2d.CreateBrush(240, 240, 240, 255), d2d.CreateBrush(0, 0, 0, 255));
                        }
                        #endregion

                        #region ESP Distance
                        if (ESP_Distance && !bEspVisiblesOnly)
                        {
                            iAux = (int)w2sFoot.Y;
                            if (ESP_Name)
                            {
                                iAux = iAux + 13;
                            }
                            d2d.DrawTextWithBackground((int)player.Distance + "m", (int)X, iAux, font, d2d.CreateBrush(240, 240, 240, 255), d2d.CreateBrush(0, 0, 0, 255));
                        }
                        #endregion

                        #region ESP Health
                        if (ESP_Health && !bEspVisiblesOnly)
                        {
                            DrawHealth((int)X, (int)w2sHead.Y - 6, (int)W, 3, (int)player.Health, (int)player.MaxHealth);
                            if (player.InVehicle && player.IsDriver)
                            {
                                DrawHealth((int)X, (int)w2sHead.Y - 10, (int)W, 3, (int)player.VehicleHealth, (int)player.VehicleMaxHealth);
                            }
                        }
                        #endregion
                    }
                    #endregion
                }
            }
            #endregion
        }
Example #8
0
        private Int64 GetClientSoldierEntity(Int64 pClientPlayer, GPlayer player)
        {
            player.InVehicle = false;
            player.IsDriver  = false;


            Int64 pAttached = RPM.ReadInt64(pClientPlayer + Offsets.PZ_ClientPlayer.m_pAttachedControllable);

            if (RPM.IsValid(pAttached))
            {
                Int64 m_ClientSoldier = RPM.ReadInt64(RPM.ReadInt64(pClientPlayer + Offsets.PZ_ClientPlayer.m_character)) - sizeof(Int64);
                if (RPM.IsValid(m_ClientSoldier))
                {
                    player.InVehicle = true;

                    Int64 pVehicleEntity = RPM.ReadInt64(pClientPlayer + Offsets.PZ_ClientPlayer.m_pAttachedControllable);
                    if (RPM.IsValid(pVehicleEntity))
                    {
                        // Driver
                        if (RPM.ReadInt32(pClientPlayer + Offsets.PZ_ClientPlayer.m_attachedEntryId) == 0)
                        {
                            // Vehicle AABB
                            if (ESP_Vehicle)
                            {
                                Int64 pDynamicPhysicsEntity = RPM.ReadInt64(pVehicleEntity + Offsets.PZ_ClientVehicleEntity.m_pPhysicsEntity);
                                if (RPM.IsValid(pDynamicPhysicsEntity))
                                {
                                    Int64 pPhysicsEntity = RPM.ReadInt64(pDynamicPhysicsEntity + Offsets.PZ_DynamicPhysicsEntity.m_EntityTransform);
                                    player.VehicleTranfsorm = RPM.ReadMatrix(pPhysicsEntity + Offsets.PZ_PhysicsEntityTransform.m_Transform);
                                    player.VehicleAABB      = RPM.ReadAABB(pVehicleEntity + Offsets.PZ_ClientVehicleEntity.m_childrenAABB);
                                }
                            }
                            Int64 _EntityData = RPM.ReadInt64(pVehicleEntity + Offsets.PZ_ClientSoldierEntity.m_data);
                            if (RPM.IsValid(_EntityData))
                            {
                                Int64 _NameSid = RPM.ReadInt64(_EntityData + Offsets.PZ_VehicleEntityData.m_NameSid);

                                string strName = RPM.ReadName(_NameSid, 20);
                                if (strName.Length > 11)
                                {
                                    Int64 pAttachedClient = RPM.ReadInt64(m_ClientSoldier + Offsets.PZ_ClientSoldierEntity.m_pPlayer);
                                    // AttachedControllable Max Health
                                    Int64 p  = RPM.ReadInt64(pAttachedClient + Offsets.PZ_ClientPlayer.m_pAttachedControllable);
                                    Int64 p2 = RPM.ReadInt64(p + Offsets.PZ_ClientSoldierEntity.m_pHealthComponent);
                                    player.VehicleHealth = RPM.ReadFloat(p2 + Offsets.PZ_HealthComponent.m_vehicleHealth);

                                    // AttachedControllable Health
                                    player.VehicleMaxHealth = RPM.ReadFloat(_EntityData + Offsets.PZ_VehicleEntityData.m_FrontMaxHealth);

                                    // AttachedControllable Name
                                    player.VehicleName = strName.Remove(0, 11);
                                    player.IsDriver    = true;
                                }
                            }
                        }
                    }
                }
                return(m_ClientSoldier);
            }
            return(RPM.ReadInt64(pClientPlayer + Offsets.PZ_ClientPlayer.m_pControlledControllable));
        }