public static void GetAllUnits(out List<WoWUnit> allunits, WoWConnection wc) { allunits = new List<WoWUnit>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.Player || TempObject.UnitType == WoWUnitType.NPC) { Vector3 myUnitPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress+MemoryOffsets.ObjectManagerLocalDescriptorArray)+ 0x10 +MemoryOffsets.DescriptorArrayClass8); float myUnitRot = wc.Connection.ReadFloat((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); if (myUnitRot > Math.PI) { myUnitRot = -(2 * (float)(Math.PI) - myUnitRot); } allunits.Add(new WoWUnit(TempObject, myUnitPos, myUnitRot, myClass)); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } }
public WoWObject(uint bAddress, WoWConnection wowConnection) { this.BaseAddress = bAddress; this.Guid = wowConnection.Connection.ReadUInt64(this.BaseAddress + MemoryOffsets.ObjectManagerLocalGUID); ulong temp = this.guid >> 52; switch ((this.guid >> 52) & 0xF0F) { case 0x000: this.UnitType = WoWUnitType.Player; break; case 0xF00: this.UnitType = WoWUnitType.Spell; break; case 0xF03: this.UnitType = WoWUnitType.NPC; break; case 0xF01: this.UnitType = WoWUnitType.WorldObject; break; case 0xF04: this.UnitType = WoWUnitType.PermanentPet; break; default: this.UnitType = WoWUnitType.Unknown; break; } }
public static void GetAllObjects(ref List<WoWUnit> allunits, ref List<WoWSpell> allspells, ref List<WoWPlayer> allplayers, WoWConnection wc) { allunits = new List<WoWUnit>(); allspells = new List<WoWSpell>(); List<WoWPlayer> tempplayers = new List<WoWPlayer>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.NPC) { Vector3 myUnitPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + 0x10 + MemoryOffsets.DescriptorArrayClass8); float myUnitRot = wc.Connection.ReadFloat((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); if (myUnitRot > Math.PI) { myUnitRot = -(2 * (float)(Math.PI) - myUnitRot); } allunits.Add(new WoWUnit(TempObject, myUnitPos, myUnitRot, myClass)); } else if (TempObject.UnitType == WoWUnitType.Player) { Vector3 myPlayerPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + 0x10 + MemoryOffsets.DescriptorArrayClass8); float myPlayerRot = wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); uint myMovementArrayAddress = wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalMovementArray); byte movebyte = wc.Connection.ReadByte(myMovementArrayAddress + MemoryOffsets.MovementArrayIsMoving8); if (myPlayerRot > Math.PI) { myPlayerRot = -(2 * (float)(Math.PI) - myPlayerRot); } tempplayers.Add(new WoWPlayer(TempObject, myPlayerPos, myPlayerRot, myClass, movebyte)); } else if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } foreach (WoWPlayer y in tempplayers) { try { allplayers.First(x => x.guid == y.guid).SetPositions(y); } catch (InvalidOperationException) { allplayers.Add(y); } } }
public bool ConnectToMainWoW(string windowTitle) { GameEnabled = false; radarctrl = new RadarControl(); mainwow = new WoWConnection(windowTitle); if (!mainwow.TryToConnect()) { throw new Exception(); } mainPlayer = new WoWPlayer(mainwow.Connection.ReadUInt64((uint)mainwow.Connection.MainModule.BaseAddress + MemoryOffsets.GlobalInfoPlayerGUID)); GameEnabled = true; return true; }
public bool TryToRefreshGlobalInfo(WoWConnection wowConnection) { try { this.mainPlayerGUID = wowConnection.Connection.ReadUInt((uint)wowConnection.Connection.MainModule.BaseAddress+MemoryOffsets.GlobalInfoPlayerGUID); if (!playerGUIDs.Contains(this.mainPlayerGUID)) { playerGUIDs.Add(this.mainPlayerGUID); } return true; } catch { return false; } }
public bool TryToRefreshGlobalInfo(WoWConnection wowConnection) { try { this.mainPlayerGUID = wowConnection.Connection.ReadUInt((uint)wowConnection.Connection.MainModule.BaseAddress + MemoryOffsets.GlobalInfoPlayerGUID); if (!playerGUIDs.Contains(this.mainPlayerGUID)) { playerGUIDs.Add(this.mainPlayerGUID); } return(true); } catch { return(false); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { try { WoWConnection tempWoW = new WoWConnection(senderGrid["col_WinTitle", e.RowIndex].Value.ToString()); tempWoW.TryToConnect(); WoWPlayer.SetWindowTitleForPlayer(ref Game1.allPlayers, tempWoW.GetPlayerGUID(), (senderGrid["col_WinTitle", e.RowIndex].Value.ToString())); } catch (NullReferenceException) { } } }
public static void GetAllSpells(out List<WoWSpell> allspells, WoWConnection wc) { allspells = new List<WoWSpell>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } }
public static void GetAllSpells(out List <WoWSpell> allspells, WoWConnection wc) { allspells = new List <WoWSpell>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } }
public static void GetAllObjects(ref List <WoWUnit> allunits, ref List <WoWSpell> allspells, ref List <WoWPlayer> allplayers, WoWConnection wc) { allunits = new List <WoWUnit>(); allspells = new List <WoWSpell>(); List <WoWPlayer> tempplayers = new List <WoWPlayer>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.NPC || TempObject.UnitType == WoWUnitType.PermanentPet) { Vector3 myUnitPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + MemoryOffsets.DescriptorArrayClass8); float myUnitRot = wc.Connection.ReadFloat((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); if (myUnitRot > Math.PI) { myUnitRot = -(2 * (float)(Math.PI) - myUnitRot); } allunits.Add(new WoWUnit(TempObject, myUnitPos, myUnitRot, myClass)); } else if (TempObject.UnitType == WoWUnitType.Player) { Vector3 myPlayerPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = WoWClass.None; try { myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + MemoryOffsets.DescriptorArrayClass8); } catch { } float myPlayerRot = wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); uint myMovementArrayAddress = wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalMovementArray); byte movebyte = 0;// wc.Connection.ReadByte(myMovementArrayAddress + MemoryOffsets.MovementArrayIsMoving8); if (myPlayerRot > Math.PI) { myPlayerRot = -(2 * (float)(Math.PI) - myPlayerRot); } tempplayers.Add(new WoWPlayer(TempObject, myPlayerPos, myPlayerRot, myClass, movebyte)); } else if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } foreach (WoWPlayer y in tempplayers) { try { allplayers.First(x => x.guid == y.guid).SetPositions(y); } catch (InvalidOperationException) { allplayers.Add(y); } } }