示例#1
0
        public string GetUITextValue(string uiHandle)
        {
            uint ptr = GetUIPtr(uiHandle);

            if (ptr == Offsets.INVALID)
            {
                return(null);
            }

            int length = ReadInt(ptr + Offsets.UI_TEXTBOX_LENGTH);

            return(D3.ReadASCIIString(ReadUInt(ptr + Offsets.UI_TEXTBOX_STR), length));
        }
示例#2
0
文件: Form1.cs 项目: alien88/wrenbot
 public BlackMagic EnableMagic(string who, ProxySocket Socket)
 {
     Process[] p = Process.GetProcessesByName("Darkages");
     foreach (Process s in p)
     {
         Magic = new BlackMagic(s.MainWindowHandle);
         var o = Magic.ReadASCIIString(0x0075E850, 20);
         if (this.Character.ToLower() == o.ToLower())
         {
             return(Magic);
         }
     }
     return(null);
 }
示例#3
0
        static void Main(string[] args)
        {
            BlackMagic wow = new BlackMagic();

            Console.WriteLine("Let the window remain open as long as you dont want to be flagged as AFK");
            while (true)
            {
                Process[] p = Process.GetProcessesByName("WoW");
                foreach (Process x in p)
                {
                    wow.OpenProcessAndThread(x.Id);
                    string version = wow.ReadASCIIString(0x00837C04, 6);
                    if (version == "1.12.1")
                    {
                        wow.WriteInt(0x00CF0BC8, Environment.TickCount);
                    }
                }
                System.Threading.Thread.Sleep(10000);
            }
        }
示例#4
0
        /// <summary>
        /// Returns the running WoW's in a WoWExe List containing the logged in playername and
        /// Process object.
        /// </summary>
        /// <returns>A list containing all the runnign WoW processes</returns>
        public static List <WowExe> GetRunningWows()
        {
            List <WowExe>  wows        = new List <WowExe>();
            List <Process> processList = new List <Process>(Process.GetProcessesByName("Wow"));

            foreach (Process p in processList)
            {
                AmeisenLogger.Instance.Log(LogLevel.DEBUG, $"Found WoW Process! PID: {p.Id}", "AmeisenCore");

                WowExe     wow        = new WowExe();
                BlackMagic blackmagic = new BlackMagic(p.Id);

                wow.characterName = blackmagic.ReadASCIIString(Offsets.playerName, 12);
                wow.process       = p;
                wows.Add(wow);
                blackmagic.Close();
            }

            return(wows);
        }
示例#5
0
        /// <summary>
        /// Returns the running WoW's in a WoWExe List containing the
        /// logged in playername and Process object.
        /// </summary>
        /// <returns>A list containing all the runnign WoW processes</returns>
        public static List <WowExe> GetRunningWows()
        {
            List <WowExe>  wows        = new List <WowExe>();
            List <Process> processList = new List <Process>(Process.GetProcessesByName("Wow"));

            foreach (Process p in processList)
            {
                AmeisenLogger.Instance.Log(LogLevel.DEBUG, $"Found WoW Process! PID: {p.Id}", "AmeisenCore");

                BlackMagic blackmagic = new BlackMagic(p.Id);
                uint       pDevice    = blackmagic.ReadUInt(Offsets.devicePtr1);
                uint       pEnd       = blackmagic.ReadUInt(pDevice + Offsets.devicePtr2);
                uint       pScene     = blackmagic.ReadUInt(pEnd);
                uint       endscene   = blackmagic.ReadUInt(pScene + Offsets.endScene);

                bool isAlreadyHooked = false;
                try
                {
                    isAlreadyHooked = BlackMagic.ReadByte(endscene + 0x2) == 0xE9;
                }
                catch { }

                string name = blackmagic.ReadASCIIString(Offsets.playerName, 12);
                if (name == "")
                {
                    name = "not logged in";
                }

                wows.Add(new WowExe
                {
                    characterName = name,
                    process       = p,
                    alreadyHooked = isAlreadyHooked
                });
                blackmagic.Close();
            }

            return(wows);
        }
示例#6
0
        //Returning Object name if you supply the object
        //To do: Redo this function to use offsets based on object Types instead of injection!
        public string getObjectName(uint curObject)
        {
            if (curObject == 0)
            {
                return("Not a valid object");
            }

            try
            {
                uint codecave = Memory.AllocateMemory();
                uint VMT      = Memory.ReadUInt(curObject);

                Memory.Asm.Clear();
                Memory.Asm.AddLine("fs mov eax, [0x2C]");
                Memory.Asm.AddLine("mov eax, [eax]");
                Memory.Asm.AddLine("add eax, 8");
                Memory.Asm.AddLine("mov dword [eax], {0}", curMgr);
                Memory.Asm.AddLine("mov ecx, {0}", curObject);
                Memory.Asm.AddLine("call {0}", Memory.ReadUInt(VMT + VMT_GetName)); //read pointer to GetName method
                Memory.Asm.AddLine("retn");

                uint   pCurName = Memory.Asm.InjectAndExecute(codecave);
                string curName;

                if (pCurName != uint.MaxValue)
                {
                    curName = Memory.ReadASCIIString(pCurName, 100);
                }
                else
                {
                    curName = String.Empty;
                }
                return(curName);
            }
            catch
            {
                return(null);
            }
        }
示例#7
0
 private void bScanForProcess_Click(object sender, EventArgs e)
 {
     dataGridView1.Rows.Clear();
     Process[] pWowProcesses = Process.GetProcessesByName("WoW");
     foreach (Process p in pWowProcesses)
     {
         wow.Open(p.Id);
         dataGridView1.Rows.Add(wow.ReadUInt(0x00C7B2A4) == 0 ? true : false, p.Id.ToString(), wow.ReadASCIIString((uint)0x827D88 + (uint)wow.MainModule.BaseAddress, 10).Trim());
     }
 }
示例#8
0
        public void Search(float startingX, float startingY, float startingZ)
        {
            float targetX, targetY, targetZ, dX, dY, dZ, distance;

            if (settings.Mining || settings.Herbing)
            {
                objectManager.PopulateList();
                foreach (WorkWork.Memory.Object obj in objectManager.GetObjects())
                {
                    if (obj.Type == 5)
                    {
                        string name = magic.ReadASCIIString(magic.ReadUInt(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectNameOffset1) + (uint)TbcOffsets.ObjectOffsets.GameObjectNameOffset2), 40);
                        if (settings.Herbing)
                        {
                            foreach (string herb in Herbs)
                            {
                                if (name.ToLower().Contains(herb))
                                {
                                    targetX  = magic.ReadFloat(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectOffset) + (uint)TbcOffsets.ObjectOffsets.GameObjectOffsetX);
                                    targetY  = magic.ReadFloat(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectOffset) + (uint)TbcOffsets.ObjectOffsets.GameObjectOffsetY);
                                    targetZ  = magic.ReadFloat(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectOffset) + (uint)TbcOffsets.ObjectOffsets.GameObjectOffsetZ);
                                    dX       = targetX - startingX;
                                    dY       = targetY - startingY;
                                    dZ       = targetZ - startingZ;
                                    distance = (float)Math.Sqrt(dX * dX + dY * dY + dZ * dZ);
                                    if (distance <= 30)
                                    {
                                        bot.GetPathing.WalkToPoint(targetX, targetY, targetZ, true, startingX, startingY, startingZ);
                                        bot.GetOther.Interact();
                                        bot.GetPathing.WalkToPoint(startingX, startingY, startingZ, true, targetX, targetY, targetZ);
                                        return;
                                    }
                                }
                            }
                        }
                        if (settings.Mining)
                        {
                            foreach (string node in Nodes)
                            {
                                if (name.Contains(node))
                                {
                                    targetX  = magic.ReadFloat(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectOffset) + (uint)TbcOffsets.ObjectOffsets.GameObjectOffsetX);
                                    targetY  = magic.ReadFloat(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectOffset) + (uint)TbcOffsets.ObjectOffsets.GameObjectOffsetY);
                                    targetZ  = magic.ReadFloat(magic.ReadUInt(obj.BaseAddress + (uint)TbcOffsets.ObjectOffsets.GameObjectOffset) + (uint)TbcOffsets.ObjectOffsets.GameObjectOffsetZ);
                                    dX       = targetX - startingX;
                                    dY       = targetY - startingY;
                                    dZ       = targetZ - startingZ;
                                    distance = (float)Math.Sqrt(dX * dX + dY * dY + dZ * dZ);
                                    if (distance <= 30)
                                    {
                                        bot.GetPathing.WalkToPoint(targetX, targetY, targetZ, true, startingX, startingY, startingZ);
                                        bot.GetOther.Interact();
                                        bot.GetPathing.WalkToPoint(startingX, startingY, startingZ, true, targetX, targetY, targetZ);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
示例#9
0
        /*public void ScanObject()
         * {
         *  CurrentPlayers.Clear();
         *
         *  CurrentObject.BaseAddress = FirstObject;
         *
         *  LocalPlayer.BaseAddress = GetObjectBaseByGuid(LocalPlayer.Guid);
         *  LocalPlayer.XPos = WowReader.ReadFloat((uint)(LocalPlayer.BaseAddress + ObjectOffsets.Pos_X));
         *  LocalPlayer.YPos = WowReader.ReadFloat((uint)(LocalPlayer.BaseAddress + ObjectOffsets.Pos_Y));
         *  LocalPlayer.ZPos = WowReader.ReadFloat((uint)(LocalPlayer.BaseAddress + ObjectOffsets.Pos_Z));
         *  LocalPlayer.Rotation = WowReader.ReadFloat((uint)(LocalPlayer.BaseAddress + ObjectOffsets.Rot));
         *  LocalPlayer.UnitFieldsAddress = WowReader.ReadUInt((uint)(LocalPlayer.BaseAddress + ObjectOffsets.UnitFields));
         *  LocalPlayer.CurrentHealth = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.Health));
         *  LocalPlayer.CurrentEnergy = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.Energy));
         *  LocalPlayer.MaxHealth = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.MaxHealth));
         *  LocalPlayer.Level = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.Level));
         *  LocalPlayer.MaxEnergy = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.MaxEnergy));
         *  LocalPlayer.MapId = WowReader.ReadUInt((uint)ObjectOffsets.mapId);
         *  LocalPlayer.Name = PlayerNameFromGuid(LocalPlayer.Guid);
         *  //LocalPlayer.majPosition();
         *  if (LocalPlayer.CurrentHealth <= 0) { LocalPlayer.isDead = true; }
         *
         *  LocalTarget.Guid = WowReader.ReadUInt64((uint)(ClientOffsets.LocalTargetGUID));
         *
         *  if (LocalTarget.Guid != 0)
         *  {
         *      LocalTarget.BaseAddress = GetObjectBaseByGuid(LocalTarget.Guid);
         *      LocalTarget.XPos = WowReader.ReadFloat((uint)(LocalTarget.BaseAddress + ObjectOffsets.Pos_X));
         *      LocalTarget.YPos = WowReader.ReadFloat((uint)(LocalTarget.BaseAddress + ObjectOffsets.Pos_Y));
         *      LocalTarget.ZPos = WowReader.ReadFloat((uint)(LocalTarget.BaseAddress + ObjectOffsets.Pos_Z));
         *      LocalTarget.Type = (short)WowReader.ReadUInt((uint)(LocalTarget.BaseAddress + ObjectOffsets.Type));
         *      LocalTarget.Rotation = WowReader.ReadFloat((uint)(LocalTarget.BaseAddress + ObjectOffsets.Rot));
         *      LocalTarget.UnitFieldsAddress = WowReader.ReadUInt((uint)(LocalTarget.BaseAddress + ObjectOffsets.UnitFields));
         *      LocalTarget.CurrentHealth = WowReader.ReadUInt((uint)(LocalTarget.UnitFieldsAddress + UnitOffsets.Health));
         *      LocalTarget.CurrentEnergy = WowReader.ReadUInt((uint)(LocalTarget.UnitFieldsAddress + UnitOffsets.Energy));
         *      LocalTarget.MaxHealth = WowReader.ReadUInt((uint)(LocalTarget.UnitFieldsAddress + UnitOffsets.MaxHealth));
         *      LocalTarget.Level = WowReader.ReadUInt((uint)(LocalTarget.UnitFieldsAddress + UnitOffsets.Level));
         *      LocalTarget.SummonedBy = WowReader.ReadUInt64((uint)(LocalTarget.UnitFieldsAddress + UnitOffsets.SummonedBy));
         *      LocalTarget.MaxEnergy = WowReader.ReadUInt((uint)(LocalTarget.UnitFieldsAddress + UnitOffsets.MaxEnergy));
         *      //LocalTarget.majPosition();
         *
         *      if (LocalTarget.Type == 3) // not a human player
         *          LocalTarget.Name = MobNameFromGuid(LocalTarget.Guid);
         *      if (LocalTarget.Type == 4) // a human player
         *          LocalTarget.Name = PlayerNameFromGuid(LocalTarget.Guid);
         *      if (LocalTarget.CurrentHealth <= 0) { LocalTarget.isDead = true; }
         *
         *      LocalTarget.targeted = true;
         *
         *      //we don't add LocalTarget to the ArrayList because he or she will appear again later
         *  }
         *
         *  // read the object manager from first object to last.
         *  while (CurrentObject.BaseAddress != 0 && CurrentObject.BaseAddress % 2 == 0)
         *  {
         *      CurrentObject.Type = (short)(WowReader.ReadUInt((uint)(CurrentObject.BaseAddress + ObjectOffsets.Type)));
         *
         *      if (CurrentObject.Type == 4)
         *      {
         *          CurrentObject.UnitFieldsAddress = WowReader.ReadUInt((uint)(CurrentObject.BaseAddress + ObjectOffsets.UnitFields));
         *          CurrentObject.CurrentHealth = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.Health));
         *          CurrentObject.CurrentEnergy = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.Energy));
         *          CurrentObject.MaxHealth = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.MaxHealth));
         *          CurrentObject.XPos = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Pos_X));
         *          CurrentObject.YPos = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Pos_Y));
         *          CurrentObject.ZPos = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Pos_Z));
         *          CurrentObject.Rotation = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Rot));
         *          CurrentObject.Guid = WowReader.ReadUInt64((uint)(CurrentObject.BaseAddress + ObjectOffsets.Guid));
         *          CurrentObject.Level = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.Level));
         *          CurrentObject.MaxEnergy = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.MaxEnergy));
         *          CurrentObject.Name = PlayerNameFromGuid(CurrentObject.Guid);
         *          // check to see whether this player is dead or not
         *          if (CurrentObject.CurrentHealth <= 0)
         *          {
         *              CurrentObject.isDead = true;
         *          }
         *
         *          CurrentObject.targeted = false;
         *
         *          CurrentPlayers.Add((Player)CurrentObject.Clone());
         *      }
         *      if (CurrentObject.Type == 3)
         *      {
         *          CurrentObject.UnitFieldsAddress = WowReader.ReadUInt((uint)(CurrentObject.BaseAddress + ObjectOffsets.UnitFields));
         *          CurrentObject.CurrentHealth = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.Health));
         *          CurrentObject.CurrentEnergy = WowReader.ReadUInt((uint)(LocalPlayer.UnitFieldsAddress + UnitOffsets.Energy));
         *          CurrentObject.MaxHealth = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.MaxHealth));
         *          CurrentObject.XPos = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Pos_X));
         *          CurrentObject.YPos = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Pos_Y));
         *          CurrentObject.ZPos = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Pos_Z));
         *          CurrentObject.Rotation = WowReader.ReadFloat((uint)(CurrentObject.BaseAddress + ObjectOffsets.Rot));
         *          CurrentObject.Guid = WowReader.ReadUInt64((uint)(CurrentObject.BaseAddress + ObjectOffsets.Guid));
         *          CurrentObject.Level = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.Level));
         *          CurrentObject.MaxEnergy = WowReader.ReadUInt((uint)(CurrentObject.UnitFieldsAddress + UnitOffsets.MaxEnergy));
         *          CurrentObject.Name = MobNameFromGuid(CurrentObject.Guid);
         *          // check to see whether this player is dead or not
         *          if (CurrentObject.CurrentHealth <= 0)
         *          {
         *              CurrentObject.isDead = true;
         *          }
         *
         *          CurrentObject.targeted = false;
         *
         *          CurrentPlayers.Add((Player)CurrentObject.Clone());
         *      }
         *      // set the current object as the next object in the object manager
         *      CurrentObject.BaseAddress = WowReader.ReadUInt((uint)(CurrentObject.BaseAddress + ClientOffsets.NextObjectOffset));
         *  }
         * }*/

        private string MobNameFromGuid(ulong Guid)
        {
            uint ObjectBase = GetObjectBaseByGuid(Guid);

            return(WowReader.ReadASCIIString((uint)(WowReader.ReadUInt((uint)(WowReader.ReadUInt((uint)(ObjectBase + 0x964)) + 0x05C))), 20));
        }
示例#10
0
        public static Structs.PatternList FindPatternList(Structs.PatternList patternList)
        {
            Structs.PatternList newPatternList = new Structs.PatternList();
            newPatternList.processName = patternList.processName;
            uint baseModule = 0;

            BlackMagic memread = new BlackMagic();

            if (memread.OpenProcessAndThread(SProcess.GetProcessFromProcessName(patternList.processName)))
            {
                try
                {
                    // Dump module
                    ProcessModuleCollection modules = Process.GetProcessById(memread.ProcessId).Modules;
                    foreach (ProcessModule o in modules)
                    {
                        Structs.ModuleList m = new Structs.ModuleList();
                        m.Name           = o.ModuleName;
                        m.baseAddressDec = (int)o.BaseAddress;
                        m.baseAddressHex = (o.BaseAddress).ToString("X");
                        patternList.Modules.Add(m);

                        // Check module base if exist.
                        if (patternList.baseModuleName != "")
                        {
                            if (patternList.baseModuleName.ToLower() == o.ModuleName.ToLower())
                            {
                                baseModule = (uint)o.BaseAddress;
                            }
                        }
                    }
                }
                catch { }

                foreach (Structs.Pattern p in patternList.Patterns)
                {
                    try
                    {
                        uint dwCodeLoc = memread.FindPattern(p.pattern, p.mask);
                        uint offset    = memread.ReadUInt((uint)((int)dwCodeLoc + p.offsetLocation));
                        if (offset > 0)
                        {
                            offset    = offset - baseModule;
                            dwCodeLoc = dwCodeLoc - baseModule;
                        }


                        if (offset > 0)
                        {
                            // Dump offset
                            p.offset          = offset.ToString("X");
                            p.offsetDec       = offset;
                            p.offsetUsedAtDec = (uint)((int)dwCodeLoc + p.offsetLocation);
                            p.offsetUsedAt    = ((int)dwCodeLoc + p.offsetLocation).ToString("X");
                            try
                            {
                                switch (p.type)
                                {
                                case "int64":
                                    p.value = Convert.ToString(memread.ReadUInt64(p.offsetDec));
                                    break;

                                case "int":
                                    p.value = Convert.ToString(memread.ReadInt(p.offsetDec));
                                    break;

                                case "float":
                                    p.value = Convert.ToString(memread.ReadFloat(p.offsetDec));
                                    break;

                                case "string":
                                    p.value = Convert.ToString(memread.ReadASCIIString(p.offsetDec, 30));
                                    break;
                                }
                            }
                            catch { p.value = "No Found"; }
                        }
                        else
                        {
                            p.offset = "No Found";
                        }
                    }
                    catch
                    { p.offset = "No Found"; }
                    newPatternList.Patterns.Add(p);
                }
                memread.Close();
            }
            else
            {
                MessageBox.Show("Process no found.");
            }
            return(patternList);
        }
示例#11
0
        public void Read()
        {
            try
            {
                try
                {
                    playerbase = wow.ReadUInt(wow.ReadUInt(wow.ReadUInt((uint)Globals.s_PlayerBase) + 0x34) + 0x24);
                    if (playerbase != 0)
                    {
                        Online = true;
                    }
                    else
                    {
                        Online = false;
                    }
                } //this is the player base
                catch (Exception) { Online = false; }
                BgStatus  = wow.ReadUInt((uint)Globals.BGStatus);
                IsIndoors = wow.ReadUInt((uint)Globals.IsIndoors);
                LastError = ReadRealName(wow.ReadBytes((uint)Globals.LastError, 120));
                BattlefieldInstanceExpiration = 0;                //wow.ReadUInt(0xC55A24) & 1;
                Combopoints = Convert.ToInt16(wow.ReadByte((uint)Globals.s_ComboPoint));
                CharCount   = Convert.ToInt16(wow.ReadByte((uint)Globals.CharCount));
                CharNo      = Convert.ToInt16(wow.ReadByte((uint)Globals.CharNo));
                String WOWBuild = ReadRealName(wow.ReadBytes(0x00A30BE6, 10));
                byte[] TT       = wow.ReadBytes(0x00A30BE6, 10);
                LoginState   = wow.ReadASCIIString(0xB6A9E0, 40);
                RealmName    = ReadRealName(wow.ReadBytes((uint)Globals.s_RealmName, 120));
                LoadingState = (int)wow.ReadUInt((uint)Globals.s_IsLoadingOrConnecting);
                WowControl.CheckLastError(LastError);
                ObjectInfo Target     = new ObjectInfo();
                byte[]     UnitFields = wow.ReadBytes(wow.ReadUInt(playerbase + 0x8) + (0x17 * 4), 4);
                PlayerForm = Convert.ToInt32(UnitFields[3]);
                Objects.Clear();
                IsMounted  = wow.ReadUInt(playerbase + 0x9C0);// &1;
                Temp       = new ObjectInfo();
                Temp.Auras = getAuras(playerbase);
                WowControl.PlayerBuffs.Clear();
                for (int i = 0; i < Temp.Auras.Count; i++)
                {
                    WowControl.PlayerBuffs.Add(Temp.Auras[i].auraId);
                }
                Temp.Name   = ReadRealName(wow.ReadBytes((uint)Globals.s_PlayerName, 120));
                Temp.Level  = wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x36 * 4)); // Reads players level
                Temp.Health = wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x18 * 4)); // Reads players health
                PowerList.Clear();
                Temp.Power     = GetUnitPower(playerbase);
                Temp.MaxHealth = wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x20 * 4)); // Reads players maxhealth
                if ((Location != null) & (Location != ""))
                {
                    if (Location != ReadRealName(wow.ReadBytes(wow.ReadUInt((uint)Globals.LocationName), 60)))
                    {
                        WowControl.LocationChangeTime = DateTime.Now;
                        Location = ReadRealName(wow.ReadBytes(wow.ReadUInt((uint)Globals.LocationName), 60));
                        WowControl.BadObjects.Clear();
                        if (BgStatus == 3)
                        {
                            WowControl.WaitTime = DateTime.Now.AddSeconds(20);
                        }
                        else
                        {
                            WowControl.WaitTime = DateTime.Now.AddSeconds(1);
                        }
                        return;
                    }
                }
                else
                {
                    Location = ReadRealName(wow.ReadBytes(wow.ReadUInt((uint)Globals.LocationName), 60));
                }
                Temp.X = wow.ReadFloat(playerbase + 0x798); // Read players xlocation
                Temp.Y = wow.ReadFloat(playerbase + 0x79C); // Read players ylocation
                Temp.Z = wow.ReadFloat(playerbase + 0x7A0); // Read players zlocation
                double Time = (DateTime.Now - LastRead).TotalMilliseconds;
                Speed           = WowControl.CheckPoint(Temp.X, Temp.Y, Temp.Z, X, Y, Z) / Time;
                X               = Temp.X;
                Y               = Temp.Y;
                Z               = Temp.Z;
                Temp.R          = wow.ReadFloat(playerbase + 0x7A8);                                     // Read players rotation
                Temp.IsInCombat = (wow.ReadUInt(wow.ReadUInt(playerbase + 208) + 212) >> 19) & 1;
                Temp.Faction    = GetFaction(wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x37 * 4))); //Faction
                Temp.Type       = 4;
                Temp.GUID       = wow.ReadUInt64(playerbase + 0x30);
                Objects.Add(Temp);
                LastRead = DateTime.Now;
                uint   s_curMgr   = wow.ReadUInt(wow.ReadUInt((uint)ObjectManager.CurMgrPointer) + (uint)ObjectManager.CurMgrOffset);
                uint   curObj     = wow.ReadUInt(s_curMgr + 0xAC);
                uint   nextObj    = curObj;
                UInt64 playerGUID = wow.ReadUInt64((uint)Globals.PlayerGUID);
                UInt64 targetGUID = wow.ReadUInt64((uint)Globals.TargetGUID);
                UInt64 localGUID  = wow.ReadUInt64(s_curMgr + 0xC0);
                while (curObj != 0 && (curObj & 1) == 0)
                {
                    UInt64 type  = wow.ReadUInt(curObj + 0x14);
                    UInt64 cGUID = wow.ReadUInt64(curObj + 0x30);
                    Temp.Type = Convert.ToUInt32(type);
                    if (Temp.Type == 7)
                    {
                        Temp.Type = 7;
                    }
                    Temp.GUID = cGUID;
                    switch (type)
                    {
                    case 3:
                        Temp.IsInCombat = (wow.ReadUInt(wow.ReadUInt(curObj + 208) + 212) >> 19) & 1;
                        Temp.IsPlayer   = false;
                        Temp.IsTarget   = false;
                        Temp.Name       = "Unit";
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                        }
                        Temp.X          = wow.ReadFloat(curObj + 0x7D4);
                        Temp.Y          = wow.ReadFloat(curObj + 0x7D8);
                        Temp.Z          = wow.ReadFloat(curObj + 0x7DC);
                        Temp.R          = wow.ReadFloat(curObj + 0x7A8);
                        Temp.Health     = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x18 * 4)); // Reads health
                        Temp.MaxHealth  = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x20 * 4)); // Reads maxhealth
                        Temp.Level      = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x36 * 4)); // Reads level
                        Temp.Name       = ReadRealName(wow.ReadBytes(wow.ReadUInt(wow.ReadUInt(curObj + 0x964) + 0x5c), 60));
                        Temp.Faction    = "Mob";
                        Temp.IsLootable = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x4F * 4));
                        Temp.Auras      = getAuras(curObj);
                        Temp.Power      = GetUnitPower(curObj);
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                            Target        = Temp;
                            Target.Auras  = getAuras(curObj);
                        }
                        Objects.Add(Temp);
                        break;

                    case 4:
                        Temp.IsInCombat = (wow.ReadUInt(wow.ReadUInt(curObj + 208) + 212) >> 19) & 1;
                        Temp.IsTarget   = false;
                        Temp.IsPlayer   = false;
                        Temp.Name       = GetPlayerNameByGuid(cGUID);
                        Temp.X          = wow.ReadFloat(curObj + 0x7D4);
                        Temp.Y          = wow.ReadFloat(curObj + 0x7D8);
                        Temp.Z          = wow.ReadFloat(curObj + 0x7DC);
                        Temp.R          = wow.ReadFloat(curObj + 0x7A8);
                        Temp.Health     = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x18 * 4));             // Reads health
                        Temp.MaxHealth  = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x20 * 4));             // Reads maxhealth
                        Temp.Level      = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x36 * 4));             // Reads level
                        Temp.Faction    = GetFaction(wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x37 * 4))); //Faction
                        Temp.Auras      = getAuras(curObj);
                        Temp.Power      = GetUnitPower(curObj);
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                            Target        = Temp;
                            Target.Auras  = getAuras(curObj);
                        }
                        else if (cGUID == playerGUID)
                        {
                            break;
                        }
                        if (Objects[0].GUID != Temp.GUID)
                        {
                            Objects.Add(Temp);
                        }
                        break;

                    case 5:
                        Temp.Faction    = "Object";
                        Temp.IsInCombat = 0;
                        Temp.Name       = "";
                        Temp.IsPlayer   = false;
                        Temp.IsTarget   = false;
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                        }
                        Temp.Level     = 0;
                        Temp.Health    = 0;
                        Temp.MaxHealth = 0;
                        Temp.X         = wow.ReadFloat(curObj + 0xE8);
                        Temp.Y         = wow.ReadFloat(curObj + 0xEC);
                        Temp.Z         = wow.ReadFloat(curObj + 0xF0);
                        Temp.R         = wow.ReadFloat(curObj + 0x7A8);
                        Temp.Name      = ReadRealName(wow.ReadBytes(wow.ReadUInt(wow.ReadUInt(curObj + 0x1A4) + 0x90), 60));
                        Temp.Power     = GetUnitPower(curObj);
                        Objects.Add(Temp);
                        break;
                    }
                    nextObj = wow.ReadUInt(curObj + 0x3C);
                    if (nextObj == curObj)
                    {
                        break;
                    }
                    else
                    {
                        curObj = nextObj;
                    }
                }
                Objects.Add(Target);
                WowControl.TargetBuffs.Clear();
                if (Target.Auras != null)
                {
                    for (int i = 0; i < Target.Auras.Count; i++)
                    {
                        WowControl.TargetBuffs.Add(Target.Auras[i].auraId);
                    }
                }
                if (LastError == "Нет места.")
                {
                    WowControl.FullBag = true;
                }
            }
            catch (Exception)
            {
                //WowControl.UpdateStatus("Error. " + E.Message);
                InitMemory();
            }
        }