Example #1
0
        private void UpdatePlayerList()
        {
            GC.Collect();
            int i = 0;

            for (; i < 50; i++)
            {
                if (HackFunctions.getPlayerActive(i))
                {
                    if (playerList.Items.ContainsKey(i.ToString()))
                    {
                        float  playerX   = HackFunctions.getPlayerX(i);
                        float  playerY   = HackFunctions.getPlayerY(i);
                        int    health    = HackFunctions.getPlayerHealth(i);
                        int    maxHealth = HackFunctions.getPlayerMaxHealth(i);
                        string name      = GetPlayerName(i);
                        int    index     = playerList.Items.IndexOfKey(i.ToString());
                        playerList.Items[index].SubItems[1].Text = name;
                        playerList.Items[index].SubItems[2].Text = Convert.ToString(playerX);
                        playerList.Items[index].SubItems[3].Text = Convert.ToString(playerY);
                        playerList.Items[index].SubItems[4].Text = Convert.ToString(health);
                        playerList.Items[index].SubItems[5].Text = Convert.ToString(maxHealth);
                    }
                    else
                    {
                        float  playerX   = HackFunctions.getPlayerX(i);
                        float  playerY   = HackFunctions.getPlayerY(i);
                        int    health    = HackFunctions.getPlayerHealth(i);
                        int    maxHealth = HackFunctions.getPlayerMaxHealth(i);
                        string name      = GetPlayerName(i);
                        playerList.Items.Add(i.ToString(), i.ToString(), 0);
                        playerList.Items[i.ToString()].SubItems.Add(name);
                        playerList.Items[i.ToString()].SubItems.Add(Convert.ToString(playerX));
                        playerList.Items[i.ToString()].SubItems.Add(Convert.ToString(playerY));
                        playerList.Items[i.ToString()].SubItems.Add(Convert.ToString(health));
                        playerList.Items[i.ToString()].SubItems.Add(Convert.ToString(maxHealth));
                    }
                }
                else
                {
                    if (playerList.Items.ContainsKey(i.ToString()))
                    {
                        playerList.Items[playerList.Items.IndexOfKey(i.ToString())].Remove();
                    }
                }
            }
        }
Example #2
0
        public void InitControls()
        {
            /*int index = 0;
             * for (; index < MAX_ITEMS_1353; index++)
             * {
             *      if ((img = MainForm.resource.GetItemImageFromIndex(index)) != null)
             *      {
             *              item_images.Images.Add("Item_" + index, img);
             *      }
             * }*/
            MemoryStream ms = new MemoryStream(resource.ItemImage);
            BinaryReader br = new BinaryReader(ms);

            while (true)
            {
                if (br.PeekChar() == -1)
                {
                    break;
                }
                string       name   = br.ReadString();
                long         length = br.ReadInt64();
                byte[]       data   = br.ReadBytes((int)length);
                MemoryStream imgms  = new MemoryStream(data);
                Image        img    = Image.FromStream(imgms);
                //ms.Close();
                item_images.Images.Add(name, img);
            }
            br.Close();
            ms.Close();
            item_images.ColorDepth = ColorDepth.Depth32Bit;
            item_images.ImageSize  = new Size(20, 20);

            {
                var none = item_images.Images[0];                //just to load all images
            }

            status = new Label()
            {
                Text     = Lang.none,
                Location = new Point(0, 50),
                Size     = new Size(190, 25),
                Font     = new Font("Arial", 10)
            };
            this.Controls.Add(status);

            Extra = new Button()
            {
                Location = new Point(245, 50),
                Size     = new Size(50, 25),
                Text     = Lang.extra
            };
            Extra.Click += delegate(object sender, EventArgs e)
            {
                if (baseAddr <= 0)
                {
                    MessageBox.Show(Lang.nonePlayerBase);
                    return;
                }
                if (ExtraHack == null)
                {
                    ExtraHack = new ExtraForm();
                    ExtraHack.Show(this);
                    ExtraHack.Location = new Point(Location.X + Width, Location.Y);
                    Extra.Font         = new Font("Arial", 10, FontStyle.Bold);
                }
                else
                {
                    ExtraHack.Dispose();
                    ExtraHack  = null;
                    Extra.Font = new Font("Arial", 10);
                }
            };
            this.Controls.Add(Extra);



            mainTab = new MTabControl()
            {
                Location      = new Point(0, 75),
                Size          = new Size(300, 500 - 105),
                SelectedIndex = 0
            };
            buttonTabPage1 = RegisterTab("1");

            buttonTabPage2 = RegisterTab("2");

            buttonTabPage6 = RegisterTab("3");

            buttonTabPage3 = RegisterTab(Lang.Event);

            buttonTabPage4 = RegisterTab(Lang.builder);

            buttonTabPage5 = RegisterTab(Lang.eff);


            this.Controls.Add(mainTab);



            AddButton(buttonTabPage1, Lang.infLife, 0, HackFunctions.InfiniteHealth, HackFunctions.De_InfiniteHealth);
            AddButton(buttonTabPage1, Lang.infOxygen, 1, HackFunctions.InfiniteOxygen, HackFunctions.De_InfiniteOxygen);
            AddButton(buttonTabPage1, Lang.infSummon, 2, HackFunctions.InfiniteMinion, HackFunctions.De_InfiniteMinion);
            AddButton(buttonTabPage1, Lang.infMana, 3, HackFunctions.InfiniteMana, HackFunctions.De_InfiniteMana);
            AddButton(buttonTabPage1, Lang.infItemAndAmmo, 4, delegate() { return(HackFunctions.InfiniteBullet() & HackFunctions.InfiniteItems()); }, delegate() { return(HackFunctions.De_InfiniteBullet() & HackFunctions.De_InfiniteItems()); });
            AddButton(buttonTabPage1, Lang.infFly, 5, HackFunctions.InfiniteFly, HackFunctions.De_InfiniteFly);
            AddButton(buttonTabPage1, Lang.immuneStoned, 6, HackFunctions.immuneBuff, HackFunctions.De_immuneBuff);
            AddButton(buttonTabPage1, Lang.highLight, 7, HackFunctions.HighLight, HackFunctions.De_HighLight);
            AddButton(buttonTabPage1, Lang.ghostMode, 8, HackFunctions.GhostMode, HackFunctions.De_GhostMode);
            AddButton(buttonTabPage1, Lang.respawnAtOnce, 9, HackFunctions.NoRespawnTime, HackFunctions.De_NoRespawnTime);
            AddButton(buttonTabPage1, Lang.attackThroughWalls, 10, HackFunctions.AttackThroughWalls, HackFunctions.De_AttackThroughWalls);
            AddButton(buttonTabPage1, Lang.noPotionDelay, 11, HackFunctions.NoPotionDelay, HackFunctions.De_NoPotionDelay);

            AddButton(buttonTabPage2, Lang.decreaseGravity, 0, HackFunctions.JumpAsFeather, HackFunctions.De_JumpAsFeather);
            AddButton(buttonTabPage2, Lang.increaseSpeed, 1, HackFunctions.FastSpeed, HackFunctions.De_FastSpeed);
            AddButton(buttonTabPage2, Lang.killAllNPC, 2, HackFunctions.KillAllNPC, HackFunctions.De_KillAllNPC);
            AddButton(buttonTabPage2, Lang.projectileThroughWalls, 3, HackFunctions.ProjectileIgnoreTiles, HackFunctions.De_ProjectileIgnoreTiles);
            AddButton(buttonTabPage2, Lang.superPick, 4, HackFunctions.GrabItemFarAway, HackFunctions.De_GrabItemFarAway);
            AddButton(buttonTabPage2, Lang.extraTwoSlots, 5, HackFunctions.AddExtraSlots, HackFunctions.De_AddExtraSlots);
            AddButton(buttonTabPage2, Lang.goldHoleDropBag, 6, HackFunctions.GoldHoleDropBag, HackFunctions.De_GoldHoleDropBag);
            AddButton(buttonTabPage2, Lang.slimeGunBurn, 7, HackFunctions.SlimeGunBurn, HackFunctions.De_SlimeGunBurn);
            AddButton(buttonTabPage2, Lang.fishOnlyCrates, 8, HackFunctions.FishOnlyCrates, HackFunctions.De_FishOnlyCrates);
            AddButton(buttonTabPage2, Lang.killAllScreen, 9, HackFunctions.KillAllScreen, HackFunctions.De_KillAllScreen);
            AddButton(buttonTabPage2, Lang.allRecipe, 10, HackFunctions.EnableAllRecipes, HackFunctions.De_EnableAllRecipes);
            AddButton(buttonTabPage2, Lang.strengthen_Vampire_Knives, 11, HackFunctions.StrengthenVampireKnives, HackFunctions.De_StrengthenVampireKnives);


            AddButton(buttonTabPage6, Lang.blockAttacking, 0, HackFunctions.BlockAttacking, HackFunctions.De_BlockAttacking, true);
            AddButton(buttonTabPage6, Lang.burnAllNPC, 1, HackFunctions.BurnAllNPC, null, false);
            AddButton(buttonTabPage6, Lang.burnAllPlayer, 2, HackFunctions.BurnAllPlayer, null, false);
            AddButton(buttonTabPage6, Lang.dropLava, 3, () =>
            {
                for (int i = 0; i < 50; i++)
                {
                    if (!HackFunctions.getPlayerActive(i))
                    {
                        continue;
                    }
                    if (i == HackFunctions.getMyPlayer())
                    {
                        continue;
                    }
                    int X = (int)HackFunctions.getPlayerX(i) / 16;
                    int Y = (int)HackFunctions.getPlayerY(i) / 16;
                    HackFunctions.DropLiquid(X, Y, 32);
                    if (HackFunctions.GetNetMode() == 1)
                    {
                        HackFunctions.SendNetWater(X, Y);
                    }
                }
                return(1);
            }, null, false);
            unsafe
            {
                Button u = null;
                u = AddButton(buttonTabPage6, Lang.randomUUID, 4, () =>
                {
                    if (HackFunctions.RandomUUID() == 0)
                    {
                        return(0);
                    }
                    StringBuilder UUIDString = new StringBuilder(32 + 4);
                    Int16 *UUID = HackFunctions.ReadUUID();
                    for (int i = 0; i < 32 + 4; i++)
                    {
                        UUIDString.Append((char)UUID[i]);
                    }
                    u.Text = Lang.randomUUID + ":" + UUIDString.ToString();
                    FreeMemory((int)UUID);
                    //Marshal.FreeHGlobal((IntPtr)UUID);
                    return(1);
                }, null, false);
                u.Font = new Font("SimSun", 8);
            }



            AddButton(buttonTabPage3, Lang.toggleDay, 0, HackFunctions.ToggleTime, null, false);
            AddButton(buttonTabPage3, Lang.toggleSunDial, 1, HackFunctions.SunDial, null, false);
            AddButton(buttonTabPage3, Lang.toggleBloodMoon, 2, HackFunctions.BloodMoon, null, false);
            AddButton(buttonTabPage3, Lang.toggleEclipse, 3, HackFunctions.Eclipse, null, false);
            AddButton(buttonTabPage3, Lang.snowMoon, 4, HackFunctions.SnowMoon, null, false);
            AddButton(buttonTabPage3, Lang.pumpkinMoon, 5, HackFunctions.PumpkinMoon, null, false);


            AddButton(buttonTabPage4, Lang.superRange, 0, HackFunctions.IgnoreRange, HackFunctions.De_IgnoreRange);
            AddButton(buttonTabPage4, Lang.fastTileSpeed, 1, HackFunctions.FastTileSpeed, HackFunctions.De_FastTileSpeed);
            AddButton(buttonTabPage4, Lang.rulerEffect, 2, HackFunctions.RulerEffect, HackFunctions.De_RulerEffect);
            AddButton(buttonTabPage4, Lang.machinicalRulerEffect, 3, HackFunctions.MachinicalRulerEffect, HackFunctions.De_MachinicalRulerEffect);
            AddButton(buttonTabPage4, Lang.showCircuit, 4, HackFunctions.ShowCircuit, HackFunctions.De_ShowCircuit);

            AddButton(buttonTabPage5, Lang.infernoEffect, 0, HackFunctions.InfernoEffect, HackFunctions.De_InfernoEffect);
            AddButton(buttonTabPage5, Lang.shadowDodge, 1, HackFunctions.ShadowDodge, HackFunctions.De_ShadowDodge);

            LoadPlugins();
        }