コード例 #1
0
        private void InfoThread()
        {
            // offset
            int controllerOffset, posOffset, healthOffset, nameOffset, teamIDOffset, poseOffset, statusOffset;

            controllerOffset = 96;
            posOffset        = 336;
            healthOffset     = 1912;
            nameOffset       = 1512;
            teamIDOffset     = 1552;
            statusOffset     = 868;
            poseOffset       = 288;
            while (true)
            {
                // Read Basic Offset
                uWorlds          = Mem.ReadMemory <int>(uWorld);
                uLevel           = Mem.ReadMemory <int>(uWorlds + 32);
                gameInstance     = Mem.ReadMemory <int>(uWorlds + 36);
                playerController = Mem.ReadMemory <int>(gameInstance + controllerOffset);
                playerCarry      = Mem.ReadMemory <int>(playerController + 32);
                uMyObject        = Mem.ReadMemory <int>(playerCarry + 788);
                //uMyself = Mem.ReadMemory<int>(uLevel + 124);
                //uMyself = Mem.ReadMemory<int>(uMyself + 36);
                //uMyself = Mem.ReadMemory<int>(uMyself + 312);
                //uCamera = Mem.ReadMemory<int>(playerCarry + 804) + 832;
                //uCursor = playerCarry + 732;
                //myWorld = Mem.ReadMemory<int>(uMyObject + 312);
                //myObjectPos = Mem.ReadMemory<Vector3>(myWorld + posOffset);
                entityEntry = Mem.ReadMemory <int>(uLevel + 112);
                entityCount = Mem.ReadMemory <int>(uLevel + 116);
                // Initilize Display Data
                DisplayData        data        = new DisplayData(viewWorld, uMyObject);
                List <PlayerData>  playerList  = new List <PlayerData>();
                List <ItemData>    itemList    = new List <ItemData>();
                List <VehicleData> vehicleList = new List <VehicleData>();
                List <BoxData>     boxList     = new List <BoxData>();
                List <GrenadeData> grenadeList = new List <GrenadeData>();
                for (int i = 0; i < entityCount; i++)
                {
                    long   entityAddv   = Mem.ReadMemory <int>(entityEntry + i * 4);
                    long   entityStruct = Mem.ReadMemory <int>(entityAddv + 16);
                    string entityType   = GameData.GetEntityType(gNames, entityStruct);
                    if (Settings.PlayerESP)
                    {
                        // if entity is player
                        if (GameData.IsPlayer(entityType))
                        {
                            //Console.WriteLine(entityType);
                            long playerWorld = Mem.ReadMemory <int>(entityAddv + 312);
                            // read player info
                            // dead player continue
                            int status = Mem.ReadMemory <int>(playerWorld + statusOffset);

                            if (status == 6)
                            {
                                continue;
                            }
                            // my team player continue
                            //int isTeam = Mem.ReadMemory<int>(Mem.ReadMemory<int>(Mem.ReadMemory<int>(entityAddv + 724 + 4)) + 20);
                            //if (isTeam > 0)
                            //    continue;
                            Mem.WriteMemory <int>(Mem.ReadMemory <int>(uMyObject + 2656) + 352, 300000);

                            string name = Encoding.Unicode.GetString(Mem.ReadMemory(Mem.ReadMemory <int>(entityAddv + nameOffset), 32));
                            name = name.Substring(0, name.IndexOf('\0'));
                            PlayerData playerData = new PlayerData
                            {
                                Type     = entityType,
                                Address  = entityAddv,
                                Position = Mem.ReadMemory <ShpVector3>(playerWorld + posOffset),
                                Status   = status,
                                Pose     = Mem.ReadMemory <int>(playerWorld + poseOffset),
                                IsRobot  = Mem.ReadMemory <int>(entityAddv + 692) == 0 ? true : false,
                                Health   = Mem.ReadMemory <float>(entityAddv + healthOffset),
                                Name     = name,
                                TeamID   = Mem.ReadMemory <int>(entityAddv + teamIDOffset),
                                //IsTeam = isTeam
                            };
                            if (playerData.Address == uMyObject || playerData.Address == uMyself)
                            {
                                myTeamID = playerData.TeamID;
                                continue;
                            }
                            if (playerData.TeamID == myTeamID)
                            {
                                continue;
                            }
                            //Console.WriteLine(entityType);
                            playerList.Add(playerData);
                            continue;
                        }
                    }
                    if (Settings.ItemESP)
                    {
                        // check if this entity is item
                        Item item = GameData.GetItemType(entityType);
                        if (item != Item.Useless)
                        {
                            // Read Item Info
                            ItemData itemData = new ItemData
                            {
                                Name     = item.GetDescription(),
                                Position = Mem.ReadMemory <ShpVector3>(Mem.ReadMemory <int>(entityAddv + 312) + posOffset),
                                Type     = item
                            };
                            itemList.Add(itemData);
                        }
                        // check if this entity is box
                        if (GameData.IsBox(entityType))
                        {
                            // Read Box Info
                            long    boxEntity = Mem.ReadMemory <int>(entityAddv + 312);
                            BoxData boxData   = new BoxData();
                            boxData.Position = Mem.ReadMemory <ShpVector3>(boxEntity + posOffset);
                            boxList.Add(boxData);
                            continue;
                        }
                    }
                    if (Settings.VehicleESP)
                    {
                        Vehicle vehicle = GameData.GetVehicleType(entityType);
                        if (vehicle != Vehicle.Unknown)
                        {
                            // Read Vehicle Info
                            VehicleData vehicleData = new VehicleData
                            {
                                Position = Mem.ReadMemory <ShpVector3>(Mem.ReadMemory <int>(entityAddv + 312) + posOffset),
                                Type     = vehicle,
                                Name     = vehicle.GetDescription()
                            };
                            vehicleList.Add(vehicleData);
                            continue;
                        }
                    }
                    // check if the entity is a grenade
                    Grenade grenade = GameData.GetGrenadeType(entityType);
                    if (grenade != Grenade.Unknown)
                    {
                        long        grenadeEntity = Mem.ReadMemory <int>(entityAddv + 312);
                        GrenadeData greData       = new GrenadeData
                        {
                            Type     = grenade,
                            Position = Mem.ReadMemory <ShpVector3>(grenadeEntity + posOffset)
                        };
                        grenadeList.Add(greData);
                    }
                }
                data.Players  = playerList.ToArray();
                data.Items    = itemList.ToArray();
                data.Vehicles = vehicleList.ToArray();
                data.Boxes    = boxList.ToArray();
                data.Grenades = grenadeList.ToArray();
                espForm.UpdateData(data);
                aimbotForm.UpdateData(data);
                Thread.Sleep(10);
            }
        }
コード例 #2
0
        private void InfoThread()
        {
            // offset
            int controllerOffset, posOffset, healthOffset, nameOffset, teamIDOffset, poseOffset, statusOffset;

            controllerOffset = 96;
            posOffset        = 336;
            healthOffset     = 2064;
            nameOffset       = 1512;
            teamIDOffset     = 1552;
            statusOffset     = 868;
            poseOffset       = 288;
            while (true)
            {
                // Read Basic Offset
                uWorlds          = Mem.ReadMemory <int>(uWorld);
                uLevel           = Mem.ReadMemory <int>(uWorlds + 32);
                gameInstance     = Mem.ReadMemory <int>(uWorlds + 36);
                playerController = Mem.ReadMemory <int>(gameInstance + controllerOffset);
                playerCarry      = Mem.ReadMemory <int>(playerController + 32);
                uMyObject        = Mem.ReadMemory <int>(playerCarry + 792); //788 old value
                //uMyself = Mem.ReadMemory<int>(uLevel + 124);
                //uMyself = Mem.ReadMemory<int>(uMyself + 36);
                //uMyself = Mem.ReadMemory<int>(uMyself + 312);
                //uCamera = Mem.ReadMemory<int>(playerCarry + 804) + 832;
                //uCursor = playerCarry + 732;
                //myWorld = Mem.ReadMemory<int>(uMyObject + 312);
                //myObjectPos = Mem.ReadMemory<Vector3>(myWorld + posOffset);
                entityEntry = Mem.ReadMemory <int>(uLevel + 112);
                entityCount = Mem.ReadMemory <int>(uLevel + 120); //116 old value
                // Initilize Display Data
                DisplayData        data        = new DisplayData(viewWorld, uMyObject);
                List <PlayerData>  playerList  = new List <PlayerData>();
                List <ItemData>    itemList    = new List <ItemData>();
                List <VehicleData> vehicleList = new List <VehicleData>();
                List <BoxData>     boxList     = new List <BoxData>();
                List <GrenadeData> grenadeList = new List <GrenadeData>();
                for (int i = 0; i < entityCount; i++)
                {
                    long   entityAddv       = Mem.ReadMemory <int>(entityEntry + i * 4);
                    long   entityStruct     = Mem.ReadMemory <int>(entityAddv + 16);
                    string entityType       = GameData.GetEntityType(gNames, entityStruct);
                    int    shootOffset      = 2400;
                    int    shootSpeedOffset = 796;
                    int    weaponOffset     = 5400;

                    long   weaponGID  = Mem.ReadMemory <int>(Mem.ReadMemory <int>(entityAddv + 4996) + 16);
                    string weaponType = GameData.GetEntityType(gNames, weaponGID);
                    Item   weapon     = GameData.GetItemType(weaponType);


                    //class VehicleCommon
                    //long VehicleCommon = Mem.ReadMemory<int>(entityAddv + 0x4E0);
                    long  VehicleCommon = Mem.ReadMemory <int>(entityAddv + 0x5c4);
                    float currentHealth = Mem.ReadMemory <float>(VehicleCommon + 0x10C);

                    if (Settings.NoRecoil)
                    {
                        if (MainForm.GetAsyncKeyState(Keys.LButton))
                        {
                            int num10 = Mem.ReadMemory <int>(this.uMyObject + (long)5400);
                            int num11 = Mem.ReadMemory <int>((long)(num10 + 2400));
                            int num12 = Mem.ReadMemory <int>((long)(num11 + 828));
                            Mem.WriteMemory <float>((long)(num11 + 1624), 0f);
                            Mem.WriteMemory <float>((long)(num11 + 1628), 0f);
                            Mem.WriteMemory <float>((long)(num11 + 1632), 0f);
                            Mem.WriteMemory <float>((long)(Mem.ReadMemory <int>((long)(Mem.ReadMemory <int>(this.uMyObject + (long)num10) + num11)) + num12), 600000f);
                        }

                        /* var weaponOffSet = Mem.ReadMemory<int>(uMyObject + 5400);
                         * int shootOffset = Mem.ReadMemory<int>(weaponOffSet + 2400);
                         * Mem.WriteMemory<float>(shootOffset + 0x658, 0f);
                         * Mem.WriteMemory<float>(shootOffset + 0x65c, 0f);
                         * Mem.WriteMemory<float>(shootOffset + 0x660, 0f);*/
                    }
                    if (Settings.Headmode)
                    {
                        Mem.WriteMemory <float>(Mem.ReadMemory <int>(Mem.ReadMemory <int>(uMyObject + weaponOffset) + shootOffset) + shootSpeedOffset, 600000f);
                    }

                    if (Settings.INSTANTHIT)
                    {
                        var weaponOffSet = 5400;
                        //Mem.WriteMemory<float>(Mem.ReadMemory<int>(Mem.ReadMemory<int>(uMyObject + weaponOffset) + shootOffset) + shootSpeedOffset, 600000);
                        Mem.WriteMemory <float>(Mem.ReadMemory <int>(Mem.ReadMemory <int>(uMyObject + weaponOffSet) + shootOffset) + shootSpeedOffset, 600000f);
                    }

                    if (Settings.SpeedCar)
                    {
                        if (MainForm.GetAsyncKeyState(Keys.LShiftKey))
                        {
                            int num = Mem.ReadMemory <int>((long)(Mem.ReadMemory <int>((long)(Mem.ReadMemory <int>((long)(Mem.ReadMemory <int>((long)(Mem.ReadMemory <int>(this.uMyObject + 312L) + 1648)) + 1776)) + 404)) + 88));
                            Mem.WriteMemory <float>((long)num, 350f);
                            Mem.WriteMemory <float>((long)(num + 4), 350f);
                            Mem.WriteMemory <float>((long)(num + 8), 350f);
                            Mem.WriteMemory <float>((long)(num + 12), 350f);
                            Mem.WriteMemory <float>((long)(num + 16), 350f);
                            Mem.WriteMemory <float>((long)(num + 20), 350f);
                            Mem.WriteMemory <float>((long)(num + 24), 350f);
                            Mem.WriteMemory <float>((long)(num + 28), 350f);
                            Mem.WriteMemory <float>((long)(num + 32), 350f);
                            Mem.WriteMemory <float>((long)(num + 36), 350f);
                            Mem.WriteMemory <float>((long)(num + 40), 350f);
                            Mem.WriteMemory <float>((long)(num + 44), 350f);
                        }
                    }

                    if (Settings.FastLanding)
                    {
                        if (MainForm.GetAsyncKeyState(Keys.LShiftKey))
                        {
                            Mem.WriteMemory <float>((long)(Mem.ReadMemory <int>(this.uMyObject + (long)3136) + 464), 35000f);
                        }
                    }
                    if (Settings.PlayerESP)
                    {
                        // if entity is player
                        if (GameData.IsPlayer(entityType))
                        {
                            //Console.WriteLine(entityType);
                            long playerWorld = Mem.ReadMemory <int>(entityAddv + 312);
                            // read player info
                            // dead player continue
                            int status = Mem.ReadMemory <int>(playerWorld + statusOffset);

                            if (status == 6)
                            {
                                continue;
                            }

                            // Enemy weapon
                            var enemy_weapon = GameData.GetEntityType(gNames, Mem.ReadMemory <int>(Mem.ReadMemory <int>(entityAddv + 5124) + 16));
                            if (string.IsNullOrEmpty(enemy_weapon))
                            {
                                enemy_weapon = "Fist";
                            }
                            else
                            {
                                try
                                {
                                    var enemy_weaponList = enemy_weapon.Split('_').ToList();
                                    enemy_weapon = enemy_weaponList[2];
                                }
                                catch
                                {
                                    enemy_weapon = "Unknown";
                                }
                            }
                            Console.WriteLine(enemy_weapon);

                            string name = Encoding.Unicode.GetString(Mem.ReadMemory(Mem.ReadMemory <int>(entityAddv + nameOffset), 32));
                            name = name.Substring(0, name.IndexOf('\0'));
                            PlayerData playerData = new PlayerData
                            {
                                Type     = entityType,
                                Address  = entityAddv,
                                Position = Mem.ReadMemory <ShpVector3>(playerWorld + posOffset),
                                Status   = status,
                                Pose     = Mem.ReadMemory <int>(playerWorld + poseOffset),
                                IsRobot  = Mem.ReadMemory <int>(entityAddv + 692) == 0 ? true : false,
                                Health   = Mem.ReadMemory <float>(entityAddv + healthOffset),
                                Name     = name,
                                TeamID   = Mem.ReadMemory <int>(entityAddv + teamIDOffset),
                                //IsTeam = isTeam
                            };
                            if (playerData.Address == uMyObject || playerData.Address == uMyself)
                            {
                                myTeamID = playerData.TeamID;
                                continue;
                            }
                            if (playerData.TeamID == myTeamID)
                            {
                                continue;
                            }
                            //Console.WriteLine(entityType);
                            playerList.Add(playerData);
                            continue;
                        }
                    }
                    if (GameData.IsBox(entityType))
                    {
                        // Read Box Info
                        long    boxEntity = Mem.ReadMemory <int>(entityAddv + 312);
                        BoxData boxData   = new BoxData();
                        boxData.Position = Mem.ReadMemory <ShpVector3>(boxEntity + 336);
                        if (Settings.ShowLootItem)
                        {
                            long boxItemsCount = Mem.ReadMemory <int>(entityAddv + 1088);
                            if (boxItemsCount < 50 && boxItemsCount > 0)
                            {
                                List <string> boxItems = new List <string>();
                                long          itemBase = Mem.ReadMemory <int>(entityAddv + 1084);
                                long          itemAddv, ammoCount;
                                string        itemName;
                                for (int j = 0; j < boxItemsCount; j++)
                                {
                                    itemAddv = itemBase + j * 48;
                                    Item boxItem = GameData.GetBoxItemType(Mem.ReadMemory <int>(itemAddv + 4));
                                    if (boxItem == Item.Useless)
                                    {
                                        continue;
                                    }
                                    ammoCount = Mem.ReadMemory <int>(itemAddv + 24);
                                    itemName  = ammoCount > 0 ? string.Format("{0} * {1}", boxItem.GetDescription(), ammoCount) : boxItem.GetDescription();
                                    boxItems.Add(itemName);
                                }
                                boxData.Items = boxItems.ToArray();
                            }
                        }
                        boxList.Add(boxData);
                        continue;
                    }
                    if (Settings.ItemESP)
                    {
                        // check if this entity is item
                        Item item = GameData.GetItemType(entityType);
                        if (item != Item.Useless)
                        {
                            // Read Item Info
                            ItemData itemData = new ItemData
                            {
                                Name     = item.GetDescription(),
                                Position = Mem.ReadMemory <ShpVector3>(Mem.ReadMemory <int>(entityAddv + 312) + posOffset),
                                Type     = item
                            };
                            itemList.Add(itemData);
                        }
                        // check if this entity is box
                        if (GameData.IsBox(entityType))
                        {
                            // Read Box Info
                            long    boxEntity = Mem.ReadMemory <int>(entityAddv + 312);
                            BoxData boxData   = new BoxData();
                            boxData.Position = Mem.ReadMemory <ShpVector3>(boxEntity + posOffset);
                            boxList.Add(boxData);
                            continue;
                        }
                    }
                    if (Settings.VehicleESP)
                    {
                        Vehicle vehicle = GameData.GetVehicleType(entityType);
                        if (vehicle != Vehicle.Unknown)
                        {
                            //int vHP = 0x10C;
                            //int vHPMax = 0x108;
                            //int vFuel = 0x124;
                            //int vFuelMax = 0x120;

                            int vHP      = 0x10C;
                            int vHPMax   = 0x108;
                            int vFuel    = 0x124;
                            int vFuelMax = 0x120;

                            float HP = Mem.ReadMemory <float>(VehicleCommon + vHP);

                            float HPMax   = Mem.ReadMemory <float>(VehicleCommon + vHPMax);
                            int   _HP     = (int)(HP * 100 / HPMax);
                            float Fuel    = Mem.ReadMemory <float>(VehicleCommon + vFuel);
                            float FuelMax = Mem.ReadMemory <float>(VehicleCommon + vFuelMax);
                            int   _Fuel   = (int)(Fuel * 100 / FuelMax);

                            // Read Vehicle Info
                            VehicleData vehicleData = new VehicleData
                            {
                                Position = Mem.ReadMemory <ShpVector3>(Mem.ReadMemory <int>(entityAddv + 312) + posOffset),
                                Type     = vehicle,
                                Name     = vehicle.GetDescription(),
                                HP       = _HP,
                                Fuel     = _Fuel,
                            };
                            vehicleList.Add(vehicleData);
                            continue;
                        }
                    }
                    // check if the entity is a grenade
                    Grenade grenade = GameData.GetGrenadeType(entityType);
                    if (grenade != Grenade.Unknown)
                    {
                        long        grenadeEntity = Mem.ReadMemory <int>(entityAddv + 312);
                        GrenadeData greData       = new GrenadeData
                        {
                            Type     = grenade,
                            Position = Mem.ReadMemory <ShpVector3>(grenadeEntity + posOffset)
                        };
                        grenadeList.Add(greData);
                    }
                }
                data.Players  = playerList.ToArray();
                data.Items    = itemList.ToArray();
                data.Vehicles = vehicleList.ToArray();
                data.Boxes    = boxList.ToArray();
                data.Grenades = grenadeList.ToArray();
                espForm.UpdateData(data);
                Thread.Sleep(10);
            }
        }