├── Externals ├── WhiteMagic.dll ├── WhiteMagic.pdb └── WhiteMagic.xml ├── cleanPattern ├── IModifier.cs ├── AddModifier.cs ├── LeaModifier.cs ├── Properties │ └── AssemblyInfo.cs ├── Pattern.cs └── cleanPattern.csproj ├── cleanCore ├── D3D │ ├── IResource.cs │ ├── Font.cs │ ├── Rendering.cs │ ├── Direct3DAPI.cs │ └── Pulse.cs ├── AuctionHouse │ ├── AuctionListType.cs │ └── WoWAuction.cs ├── WoWBag.cs ├── UI │ ├── Merchant.cs │ └── Inventory.cs ├── WoWCorpse.cs ├── WoWDynamicObject.cs ├── WoWParty.cs ├── Properties │ └── AssemblyInfo.cs ├── WoWContainer.cs ├── WoWGameObject.cs ├── Location.cs ├── Helper.cs ├── WoWScript.cs ├── WoWItem.cs ├── WoWLocalPlayer.cs ├── WoWWorld.cs ├── Constants.cs ├── Events.cs ├── WoWPlayer.cs ├── cleanCore.csproj ├── LuaInterface.cs ├── Manager.cs ├── Teleporter.cs ├── WoWObject.cs ├── WoWUnit.cs ├── Offsets.cs └── Descriptors.cs ├── TeleportBook ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── Form1.cs ├── TeleportBook.csproj ├── Form1.Designer.cs └── Form1.resx ├── README.markdown ├── LICENSE └── cleanCore.sln /Externals/WhiteMagic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stschake/cleanCore/HEAD/Externals/WhiteMagic.dll -------------------------------------------------------------------------------- /Externals/WhiteMagic.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stschake/cleanCore/HEAD/Externals/WhiteMagic.pdb -------------------------------------------------------------------------------- /cleanPattern/IModifier.cs: -------------------------------------------------------------------------------- 1 | namespace cleanPattern 2 | { 3 | 4 | public interface IModifier 5 | { 6 | uint Apply(uint address); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /cleanCore/D3D/IResource.cs: -------------------------------------------------------------------------------- 1 | namespace cleanCore.D3D 2 | { 3 | 4 | public interface IResource 5 | { 6 | void OnLostDevice(); 7 | void OnResetDevice(); 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /TeleportBook/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cleanPattern/AddModifier.cs: -------------------------------------------------------------------------------- 1 | namespace cleanPattern 2 | { 3 | 4 | public class AddModifier : IModifier 5 | { 6 | public uint Offset { get; private set; } 7 | 8 | public AddModifier() 9 | { 10 | 11 | } 12 | 13 | public AddModifier(uint val) 14 | { 15 | Offset = val; 16 | } 17 | 18 | public uint Apply(uint addr) 19 | { 20 | return (addr + Offset); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | cleanCore is an C# interface to the WoW Game 4 | 5 | # Security 6 | 7 | Apart from module scans, cleanCore is vulnerable to Warden scans by making two modifications: 8 | 9 | 1. detouring a LUA function to provide access to events 10 | 2. detouring EndScene to provide a pulse 11 | 12 | the latter is considered safe; if you worry about the first one, deactivate events. 13 | 14 | # License 15 | 16 | cleanCore is licensed under the FreeBSD license or Simplified BSD license. -------------------------------------------------------------------------------- /cleanCore/AuctionHouse/AuctionListType.cs: -------------------------------------------------------------------------------- 1 | namespace cleanCore.AuctionHouse 2 | { 3 | 4 | public enum AuctionListType 5 | { 6 | /// 7 | /// An item up for auction, the "Browse" tab in the dialog 8 | /// 9 | List, 10 | 11 | /// 12 | /// An item the player has bid on, the "Bids" tab in the dialog 13 | /// 14 | Bidder, 15 | 16 | /// 17 | /// An item the player has up for auction, the "Auctions" tab in the dialog 18 | /// 19 | Owner 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /cleanCore/WoWBag.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public class WoWBag 7 | { 8 | public IntPtr Pointer { get; set; } 9 | 10 | // see CGPlayer_C__AutoEquipItem 11 | public int Slots 12 | { 13 | get { return Helper.Magic.Read(Pointer); } 14 | } 15 | 16 | public ulong GetItemGuid(int index) 17 | { 18 | var array = Helper.Magic.Read(Pointer + 0x4); 19 | return Helper.Magic.Read((uint)(array + (index*0x8))); 20 | } 21 | 22 | public WoWBag(IntPtr pointer) 23 | { 24 | Pointer = pointer; 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /TeleportBook/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using cleanCore; 4 | using cleanCore.D3D; 5 | 6 | namespace TeleportBook 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Offsets.Initialize(); 17 | Pulse.OnFrame += OnFrame; 18 | 19 | Application.EnableVisualStyles(); 20 | Application.Run(new Form1()); 21 | } 22 | 23 | static void OnFrame(object sender, EventArgs e) 24 | { 25 | Teleporter.Pulse(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /cleanCore/UI/Merchant.cs: -------------------------------------------------------------------------------- 1 | namespace cleanCore.UI 2 | { 3 | 4 | public static class Merchant 5 | { 6 | 7 | public static bool CanRepair 8 | { 9 | get 10 | { 11 | var ret = WoWScript.Execute("CanMerchantRepair()"); 12 | return ret.Count > 0 && (ret[0] == "1" || ret[1] == "true"); 13 | } 14 | } 15 | 16 | public static int RepairAllCost 17 | { 18 | get { return int.Parse(WoWScript.Execute("GetRepairAllCost()")[0]); } 19 | } 20 | 21 | public static void RepairAll() 22 | { 23 | WoWScript.ExecuteNoResults("RepairAllItems()"); 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /cleanPattern/LeaModifier.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace cleanPattern 4 | { 5 | public enum LeaType 6 | { 7 | Byte, 8 | Word, 9 | Dword 10 | } 11 | 12 | public class LeaModifier : IModifier 13 | { 14 | public LeaType Type { get; private set; } 15 | 16 | public LeaModifier() 17 | { 18 | Type = LeaType.Dword; 19 | } 20 | 21 | public LeaModifier(LeaType type) 22 | { 23 | Type = type; 24 | } 25 | 26 | public unsafe uint Apply(uint address) 27 | { 28 | switch (Type) 29 | { 30 | case LeaType.Byte: 31 | return *(byte*) (address); 32 | case LeaType.Word: 33 | return *(ushort*) (address); 34 | case LeaType.Dword: 35 | return *(uint*) (address); 36 | } 37 | throw new InvalidDataException("Unknown LeaType"); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /cleanCore/WoWCorpse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public class WoWCorpse : WoWObject 7 | { 8 | public WoWCorpse(IntPtr pointer) 9 | : base(pointer) 10 | { 11 | 12 | } 13 | 14 | public ulong OwnerGuid 15 | { 16 | get 17 | { 18 | return GetDescriptor((int) CorpseField.CORPSE_FIELD_OWNER); 19 | } 20 | } 21 | 22 | public uint DisplayId 23 | { 24 | get 25 | { 26 | return GetDescriptor((int) CorpseField.CORPSE_FIELD_DISPLAY_ID); 27 | } 28 | } 29 | 30 | public uint Flags 31 | { 32 | get 33 | { 34 | return GetDescriptor((int) CorpseField.CORPSE_FIELD_FLAGS); 35 | } 36 | } 37 | 38 | public uint DynamicFlags 39 | { 40 | get 41 | { 42 | return GetDescriptor((int) CorpseField.CORPSE_FIELD_DYNAMIC_FLAGS); 43 | } 44 | } 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /cleanCore/WoWDynamicObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public class WoWDynamicObject : WoWObject 7 | { 8 | public WoWDynamicObject(IntPtr pointer) 9 | : base(pointer) 10 | { 11 | 12 | } 13 | 14 | public uint SpellId 15 | { 16 | get 17 | { 18 | return GetDescriptor((int)DynamicObjectField.DYNAMICOBJECT_SPELLID); 19 | } 20 | } 21 | 22 | public ulong CasterGuid 23 | { 24 | get 25 | { 26 | return GetDescriptor((int) DynamicObjectField.DYNAMICOBJECT_CASTER); 27 | } 28 | } 29 | 30 | public uint CastTime 31 | { 32 | get 33 | { 34 | return GetDescriptor((int) DynamicObjectField.DYNAMICOBJECT_CASTTIME); 35 | } 36 | } 37 | 38 | public float Radius 39 | { 40 | get 41 | { 42 | return GetDescriptor((int) DynamicObjectField.DYNAMICOBJECT_RADIUS); 43 | } 44 | } 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /TeleportBook/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TeleportBook.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /cleanCore/D3D/Font.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using SlimDX; 3 | using SlimDX.Direct3D9; 4 | 5 | namespace cleanCore.D3D 6 | { 7 | 8 | public class Font : IResource 9 | { 10 | private SlimDX.Direct3D9.Font _font; 11 | 12 | public Font(int height, int width, string font) 13 | { 14 | _font = new SlimDX.Direct3D9.Font(Rendering.Device, height, width, FontWeight.Normal, 1, false, 15 | CharacterSet.Default, Precision.Default, FontQuality.Antialiased, 16 | PitchAndFamily.Default, font); 17 | 18 | Rendering.RegisterResource(this); 19 | } 20 | 21 | public void OnLostDevice() 22 | { 23 | if (_font.OnLostDevice() != ResultCode.Success) 24 | Debugger.Break(); 25 | } 26 | 27 | public void OnResetDevice() 28 | { 29 | if (_font.OnResetDevice() != ResultCode.Success) 30 | Debugger.Break(); 31 | } 32 | 33 | public void Release() 34 | { 35 | _font.Dispose(); 36 | _font = null; 37 | } 38 | 39 | public void Print(int x, int y, string text, Color4 color) 40 | { 41 | if (_font != null) 42 | _font.DrawString(null, text, x, y, color); 43 | } 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /cleanCore/WoWParty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | public static class WoWParty 8 | { 9 | 10 | public static int NumPartyMembers 11 | { 12 | get 13 | { 14 | int ret = 0; 15 | for (int i = 0; i < 5; i++) 16 | { 17 | if (GetPartyMemberGuid(i) != 0) 18 | ret++; 19 | } 20 | return ret; 21 | } 22 | } 23 | 24 | public static WoWObject GetPartyMember(int index) 25 | { 26 | return Manager.GetObjectByGuid(GetPartyMemberGuid(index)); 27 | } 28 | 29 | public static ulong GetPartyMemberGuid(int index) 30 | { 31 | return Helper.Magic.Read(new IntPtr(Offsets.PartyArray + (index*8))); 32 | } 33 | 34 | public static List Members 35 | { 36 | get 37 | { 38 | var ret = new List(3); 39 | for (int i = 0; i < 4; i++) 40 | { 41 | var unit = GetPartyMember(i) as WoWUnit; 42 | if (unit != null && unit.IsValid) 43 | ret.Add(unit); 44 | } 45 | return ret; 46 | } 47 | } 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011 Stefan Schake. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are 4 | permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of 7 | conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list 10 | of conditions and the following disclaimer in the documentation and/or other materials 11 | provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY STEFAN SCHAKE ``AS IS'' AND ANY EXPRESS OR IMPLIED 14 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 15 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OR 16 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 18 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 19 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 21 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | 23 | The views and conclusions contained in the software and documentation are those of the 24 | authors and should not be interpreted as representing official policies, either expressed 25 | or implied, of Stefan Schake. -------------------------------------------------------------------------------- /cleanCore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("cleanCore")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("cleanCore")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e6f26778-c195-435b-a2ef-5c31ecbcb289")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TeleportBook/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TeleportBook")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("TeleportBook")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("99f0b40d-6106-42e6-b877-b3cb8db90e83")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /cleanPattern/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("cleanPattern")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("cleanPattern")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9a9cf521-d407-4db6-8703-f59c607619ab")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /cleanCore/WoWContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | public class WoWContainer : WoWItem 8 | { 9 | public WoWContainer(IntPtr pointer) 10 | : base(pointer) 11 | { 12 | 13 | } 14 | 15 | public uint Slots 16 | { 17 | get 18 | { 19 | return GetDescriptor((int) ContainerField.CONTAINER_FIELD_NUM_SLOTS); 20 | } 21 | } 22 | 23 | public ulong GetItemGuid(int index) 24 | { 25 | if (index > 35 || index >= Slots || index < 0) 26 | return 0; 27 | 28 | return GetDescriptor((int) ContainerField.CONTAINER_FIELD_SLOT_1 + (index*8)); 29 | } 30 | 31 | public WoWItem GetItem(int index) 32 | { 33 | return Manager.GetObjectByGuid(GetItemGuid(index)) as WoWItem; 34 | } 35 | 36 | public List Items 37 | { 38 | get 39 | { 40 | var ret = new List((int)Slots); 41 | for (int i = 0; i < Slots; i++) 42 | { 43 | var guid = GetItemGuid(i); 44 | if (guid != 0) 45 | { 46 | var obj = Manager.GetObjectByGuid(guid); 47 | if (obj == null || !obj.IsValid || !obj.IsItem) 48 | continue; 49 | ret.Add(obj as WoWItem); 50 | } 51 | } 52 | return ret; 53 | } 54 | } 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /cleanCore/WoWGameObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public class WoWGameObject : WoWObject 7 | { 8 | public WoWGameObject(IntPtr pointer) 9 | : base(pointer) 10 | { 11 | 12 | } 13 | 14 | public uint DisplayId 15 | { 16 | get 17 | { 18 | return GetDescriptor((int) GameObjectField.GAMEOBJECT_DISPLAYID); 19 | } 20 | } 21 | 22 | public uint Flags 23 | { 24 | get 25 | { 26 | return GetDescriptor((int) GameObjectField.GAMEOBJECT_FLAGS); 27 | } 28 | } 29 | 30 | public uint Level 31 | { 32 | get 33 | { 34 | return GetDescriptor((int) GameObjectField.GAMEOBJECT_LEVEL); 35 | } 36 | } 37 | 38 | public uint Faction 39 | { 40 | get 41 | { 42 | return GetDescriptor((int) GameObjectField.GAMEOBJECT_FACTION); 43 | } 44 | } 45 | 46 | public bool Locked 47 | { 48 | get 49 | { 50 | return (Flags & (uint)GameObjectFlags.Locked) > 0; 51 | } 52 | } 53 | 54 | public bool InUse 55 | { 56 | get 57 | { 58 | return (Flags & (uint) GameObjectFlags.InUse) > 0; 59 | } 60 | } 61 | 62 | public bool IsTransport 63 | { 64 | get 65 | { 66 | return (Flags & (uint)GameObjectFlags.Transport) > 0; 67 | } 68 | } 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /cleanCore/UI/Inventory.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace cleanCore.UI 4 | { 5 | 6 | public class Item 7 | { 8 | public int Bag { get; private set; } 9 | public int Slot { get; private set; } 10 | 11 | public Item(int bag, int slot) 12 | { 13 | Bag = bag; 14 | Slot = slot; 15 | } 16 | } 17 | 18 | public class Bag 19 | { 20 | public int Id { get; private set; } 21 | public int Slots { get; private set; } 22 | public int FreeSlots { get; private set; } 23 | 24 | public Bag(int id) 25 | { 26 | Id = id; 27 | Slots = int.Parse(WoWScript.Execute("GetContainerNumSlots(" + id + ")")[0]); 28 | FreeSlots = int.Parse(WoWScript.Execute("GetContainerNumFreeSlots(" + id + ")")[0]); 29 | } 30 | 31 | public void UseItem(int slot) 32 | { 33 | WoWScript.ExecuteNoResults("UseContainerItem(" + Id + ", " + slot + ")"); 34 | } 35 | } 36 | 37 | public static class Inventory 38 | { 39 | 40 | public static int FreeSlots 41 | { 42 | get 43 | { 44 | int slots = 0; 45 | for (int i = 0; i < 5; i++) 46 | { 47 | var ret = WoWScript.Execute("GetContainerNumFreeSlots(" + i + ")"); 48 | if (ret.Count > 0) 49 | slots += int.Parse(ret[0]); 50 | } 51 | return slots; 52 | } 53 | } 54 | 55 | public static List Bags 56 | { 57 | get 58 | { 59 | var ret = new List(5); 60 | for (int i = 0; i < 5; i++) 61 | ret.Add(new Bag(i)); 62 | return ret; 63 | } 64 | } 65 | 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /cleanCore/Location.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | [StructLayout(LayoutKind.Sequential)] 8 | public struct Location 9 | { 10 | public float X; 11 | public float Y; 12 | public float Z; 13 | 14 | public Location(float x, float y, float z) 15 | { 16 | X = x; 17 | Y = y; 18 | Z = z; 19 | } 20 | 21 | public double DistanceTo(Location loc) 22 | { 23 | return Math.Sqrt(Math.Pow(X - loc.X, 2) + Math.Pow(Y - loc.Y, 2) + Math.Pow(Z - loc.Z, 2)); 24 | } 25 | 26 | public double Distance2D(Location loc) 27 | { 28 | return Math.Sqrt(Math.Pow(X - loc.X, 2) + Math.Pow(Y - loc.Y, 2)); 29 | } 30 | 31 | public double Length 32 | { 33 | get { return Math.Sqrt(Math.Pow(X, 2) + Math.Pow(Y, 2) + Math.Pow(Z, 2)); } 34 | } 35 | 36 | public Location Normalize() 37 | { 38 | var len = Length; 39 | return new Location((float)(X / len), (float)(Y / len), (float)(Z / len)); 40 | } 41 | 42 | public float Angle 43 | { 44 | get 45 | { 46 | return (float)Math.Atan2(Y, X); 47 | } 48 | } 49 | 50 | public override bool Equals(object obj) 51 | { 52 | if (obj == null || GetType() != obj.GetType()) 53 | return false; 54 | 55 | var loc = (Location) obj; 56 | if (loc.X != X || loc.Y != Y || loc.Z != Z) 57 | return false; 58 | return true; 59 | } 60 | 61 | public override int GetHashCode() 62 | { 63 | return X.GetHashCode() | Y.GetHashCode() | Z.GetHashCode(); 64 | } 65 | 66 | public override string ToString() 67 | { 68 | return "[" + (int) X + ", " + (int) Y + ", " + (int) Z + "]"; 69 | } 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /cleanCore/Helper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.InteropServices; 3 | using WhiteMagic; 4 | 5 | namespace cleanCore 6 | { 7 | 8 | public static class Helper 9 | { 10 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 11 | private delegate uint PerformanceCounterDelegate(); 12 | private static PerformanceCounterDelegate _performanceCounter; 13 | 14 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 15 | private delegate bool CastSpellDelegate(int spellId, int unk, ulong targetGuid, int unk1, int unk2); 16 | private static CastSpellDelegate _castSpell; 17 | 18 | public static Magic Magic = new Magic(); 19 | public static bool InCombat { get; private set; } 20 | 21 | public static void Initialize() 22 | { 23 | _performanceCounter = Magic.RegisterDelegate(Offsets.PerformanceCounter); 24 | _castSpell = Magic.RegisterDelegate(Offsets.CastSpell); 25 | 26 | Events.Register("PLAYER_REGEN_DISABLED", SetInCombat); 27 | Events.Register("PLAYER_REGEN_ENABLED", UnsetInCombat); 28 | } 29 | 30 | public static void CastSpell(int spellId, WoWObject target) 31 | { 32 | target.Select(); 33 | WoWScript.ExecuteNoResults("CastSpellByID(" + spellId + ")"); 34 | } 35 | 36 | private static void SetInCombat(string ev, List args) 37 | { 38 | InCombat = true; 39 | } 40 | 41 | private static void UnsetInCombat(string ev, List args) 42 | { 43 | InCombat = false; 44 | } 45 | 46 | public static void ResetHardwareAction() 47 | { 48 | Magic.Write(Offsets.LastHardwareAction, PerformanceCount); 49 | } 50 | 51 | public static uint PerformanceCount 52 | { 53 | get 54 | { 55 | return _performanceCounter(); 56 | } 57 | } 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /cleanCore/WoWScript.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace cleanCore 7 | { 8 | 9 | public static class WoWScript 10 | { 11 | 12 | private static string PopError(IntPtr state) 13 | { 14 | var p = LuaInterface.ToLString(state, 1, 0); 15 | if (p == IntPtr.Zero) 16 | return "Unknown Error"; 17 | LuaInterface.Pop(state, 1); 18 | return Marshal.PtrToStringAnsi(p); 19 | } 20 | 21 | public static void ExecuteNoResults(string query) 22 | { 23 | ExecuteInternal(query, false); 24 | } 25 | 26 | public static List Execute(string query) 27 | { 28 | return ExecuteInternal(query, true); 29 | } 30 | 31 | private static List ExecuteInternal(string query, bool withResults) 32 | { 33 | if (withResults) 34 | query = "return " + query; 35 | var state = LuaInterface.LuaState; 36 | int top = LuaInterface.GetTop(state); 37 | 38 | var data = Encoding.ASCII.GetBytes(query); 39 | var memory = Marshal.AllocHGlobal(data.Length + 1); 40 | try 41 | { 42 | Marshal.Copy(data, 0, memory, data.Length); 43 | Marshal.WriteByte(memory + data.Length, 0); 44 | 45 | if (LuaInterface.LoadBuffer(state, memory, data.Length, "cleanCore") > 0) 46 | return new List {PopError(state)}; 47 | 48 | if (LuaInterface.PCall(state, 0, withResults ? (int)LuaInterface.LuaConstant.MultRet : 0, 0) > 0) 49 | return new List {PopError(state)}; 50 | 51 | int returnValueCount = LuaInterface.GetTop(state) - top; 52 | var ret = new List(returnValueCount); 53 | for (int i = 1; i <= returnValueCount; i++) 54 | ret.Add(LuaInterface.StackObjectToString(state, i)); 55 | LuaInterface.Pop(state, returnValueCount); 56 | return ret; 57 | } 58 | finally 59 | { 60 | Marshal.FreeHGlobal(memory); 61 | } 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /cleanPattern/Pattern.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Globalization; 4 | using System.IO; 5 | using System.Linq; 6 | 7 | namespace cleanPattern 8 | { 9 | public class Pattern 10 | { 11 | public string Name { get; private set; } 12 | public byte[] Bytes { get; private set; } 13 | public bool[] Mask { get; private set; } 14 | public List Modifiers = new List(); 15 | 16 | private unsafe bool DataCompare(long offset) 17 | { 18 | return !Mask.Where((t, i) => t && Bytes[i] != *(byte*) (offset + i)).Any(); 19 | } 20 | 21 | private uint FindStart() 22 | { 23 | var mainModule = Process.GetCurrentProcess().MainModule; 24 | 25 | var start = mainModule.BaseAddress.ToInt32(); 26 | var size = mainModule.ModuleMemorySize; 27 | for (uint i = 0; i < size; i++) 28 | { 29 | if (DataCompare(start + i)) 30 | return (uint)(start + i); 31 | } 32 | throw new InvalidDataException("Pattern not found"); 33 | } 34 | 35 | public uint Find() 36 | { 37 | var start = FindStart(); 38 | foreach (var mod in Modifiers) 39 | start = mod.Apply(start); 40 | return start; 41 | } 42 | 43 | public static Pattern FromTextstyle(string name, string pattern) 44 | { 45 | var ret = new Pattern {Name = name}; 46 | var split = pattern.Split(' '); 47 | int index = 0; 48 | ret.Bytes = new byte[split.Length]; 49 | ret.Mask = new bool[split.Length]; 50 | foreach (var token in split) 51 | { 52 | if (token.Length > 2) 53 | throw new InvalidDataException("Invalid token: " + token); 54 | if (token.Contains("?")) 55 | ret.Mask[index++] = false; 56 | else 57 | { 58 | byte data = byte.Parse(token, NumberStyles.HexNumber); 59 | ret.Bytes[index] = data; 60 | ret.Mask[index] = true; 61 | index++; 62 | } 63 | } 64 | return ret; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /cleanCore/WoWItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | public class WoWItem : WoWObject 8 | { 9 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 10 | private delegate void UseItemDelegate(IntPtr thisObj, ref ulong guid, int unkZero); 11 | private static UseItemDelegate _useItem; 12 | 13 | public WoWItem(IntPtr pointer) 14 | : base(pointer) 15 | { 16 | 17 | } 18 | 19 | public ulong OwnerGuid 20 | { 21 | get 22 | { 23 | return GetDescriptor((int) ItemField.ITEM_FIELD_OWNER); 24 | } 25 | } 26 | 27 | public ulong CreatorGuid 28 | { 29 | get 30 | { 31 | return GetDescriptor((int) ItemField.ITEM_FIELD_CREATOR); 32 | } 33 | } 34 | 35 | public uint StackCount 36 | { 37 | get 38 | { 39 | return GetDescriptor((int) ItemField.ITEM_FIELD_STACK_COUNT); 40 | } 41 | } 42 | 43 | public ItemFlags Flags 44 | { 45 | get 46 | { 47 | return (ItemFlags)GetDescriptor((int) ItemField.ITEM_FIELD_FLAGS); 48 | } 49 | } 50 | 51 | public uint RandomPropertiesId 52 | { 53 | get 54 | { 55 | return GetDescriptor((int) ItemField.ITEM_FIELD_RANDOM_PROPERTIES_ID); 56 | } 57 | } 58 | 59 | public uint Durability 60 | { 61 | get 62 | { 63 | return GetDescriptor((int) ItemField.ITEM_FIELD_DURABILITY); 64 | } 65 | } 66 | 67 | public uint MaxDurability 68 | { 69 | get 70 | { 71 | return GetDescriptor((int) ItemField.ITEM_FIELD_MAXDURABILITY); 72 | } 73 | } 74 | 75 | public void Use() 76 | { 77 | Use(Manager.LocalPlayer); 78 | } 79 | 80 | public void Use(WoWObject target) 81 | { 82 | var guid = target.Guid; 83 | if (_useItem == null) 84 | _useItem = Helper.Magic.RegisterDelegate(Offsets.UseItem); 85 | _useItem(Manager.LocalPlayer.Pointer, ref guid, 0); 86 | } 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /cleanPattern/cleanPattern.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {29464482-6061-4C6C-ACBE-B7340D0CE164} 9 | Library 10 | Properties 11 | cleanPattern 12 | cleanPattern 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | true 25 | x86 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | 32 | 33 | prompt 34 | 4 35 | true 36 | x86 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 56 | -------------------------------------------------------------------------------- /cleanCore/D3D/Rendering.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Runtime.InteropServices; 5 | using SlimDX; 6 | using SlimDX.Direct3D9; 7 | 8 | namespace cleanCore.D3D 9 | { 10 | 11 | [StructLayout(LayoutKind.Sequential)] 12 | public struct PositionColored 13 | { 14 | public static readonly VertexFormat FVF = VertexFormat.Position | VertexFormat.Diffuse; 15 | public static readonly int Stride = Vector3.SizeInBytes + sizeof(int); 16 | 17 | public Vector3 Position; 18 | public int Color; 19 | 20 | public PositionColored(Vector3 pos, int col) 21 | { 22 | Position = pos; 23 | Color = col; 24 | } 25 | } 26 | 27 | public static class Rendering 28 | { 29 | private static readonly List _resources = new List(); 30 | private static IntPtr _usedDevicePointer = IntPtr.Zero; 31 | 32 | public static Device Device { get; private set; } 33 | 34 | public static void Initialize(IntPtr devicePointer) 35 | { 36 | if (_usedDevicePointer != devicePointer) 37 | { 38 | Debug.WriteLine("Rendering: Device initialized on " + devicePointer); 39 | Device = Device.FromPointer(devicePointer); 40 | _usedDevicePointer = devicePointer; 41 | } 42 | } 43 | 44 | public static void RegisterResource(IResource source) 45 | { 46 | _resources.Add(source); 47 | } 48 | 49 | public static void DrawLine(Location from, Location to, Color4 color) 50 | { 51 | var vertices = new PositionColored[2]; 52 | vertices[0] = new PositionColored(from.ToVector3(), color.ToArgb()); 53 | vertices[1] = new PositionColored(to.ToVector3(), color.ToArgb()); 54 | Device.DrawUserPrimitives(PrimitiveType.LineList, 1, vertices); 55 | } 56 | 57 | public static void OnLostDevice() 58 | { 59 | foreach (var resource in _resources) 60 | resource.OnLostDevice(); 61 | } 62 | 63 | public static void OnResetDevice() 64 | { 65 | foreach (var resource in _resources) 66 | resource.OnResetDevice(); 67 | } 68 | 69 | public static void Pulse() 70 | { 71 | if (!IsInitialized) 72 | return; 73 | } 74 | 75 | public static bool IsInitialized 76 | { 77 | get 78 | { 79 | return Device != null; 80 | } 81 | } 82 | } 83 | 84 | } -------------------------------------------------------------------------------- /cleanCore/D3D/Direct3DAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace cleanCore.D3D 5 | { 6 | 7 | public static class Direct3DAPI 8 | { 9 | public const uint SDKVersion = 32; 10 | 11 | public const int BeginSceneOffset = 39; 12 | public const int EndSceneOffset = 42; 13 | public const int ResetOffset = 16; 14 | public const int ResetExOffset = 132; 15 | 16 | [DllImport("d3d9.dll")] 17 | public static extern IntPtr Direct3DCreate9(uint sdkVersion); 18 | 19 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 20 | public delegate void D3DRelease(IntPtr instance); 21 | 22 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 23 | public delegate int Direct3D9CreateDevice(IntPtr instance, uint adapter, uint deviceType, 24 | IntPtr focusWindow, 25 | uint behaviorFlags, 26 | [In] ref PresentParameters presentationParameters, 27 | [Out] out IntPtr returnedDeviceInterface); 28 | 29 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 30 | public delegate int Direct3D9Reset(IntPtr presentationParameters); 31 | 32 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 33 | public delegate int Direct3D9ResetEx(IntPtr presentationParameters, IntPtr displayModeEx); 34 | 35 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 36 | public delegate int Direct3D9EndScene(IntPtr device); 37 | 38 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 39 | public delegate int Direct3D9BeginScene(IntPtr device); 40 | 41 | [StructLayout(LayoutKind.Sequential)] 42 | public struct PresentParameters 43 | { 44 | public readonly uint BackBufferWidth; 45 | public readonly uint BackBufferHeight; 46 | public uint BackBufferFormat; 47 | public readonly uint BackBufferCount; 48 | public readonly uint MultiSampleType; 49 | public readonly uint MultiSampleQuality; 50 | public uint SwapEffect; 51 | public readonly IntPtr hDeviceWindow; 52 | [MarshalAs(UnmanagedType.Bool)] 53 | public bool Windowed; 54 | [MarshalAs(UnmanagedType.Bool)] 55 | public readonly bool EnableAutoDepthStencil; 56 | public readonly uint AutoDepthStencilFormat; 57 | public readonly uint Flags; 58 | public readonly uint FullScreen_RefreshRateInHz; 59 | public readonly uint PresentationInterval; 60 | } 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /cleanCore/AuctionHouse/WoWAuction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore.AuctionHouse 4 | { 5 | 6 | public class WoWAuction 7 | { 8 | public IntPtr Pointer { get; private set; } 9 | 10 | public bool IsValid 11 | { 12 | get { return Pointer != IntPtr.Zero; } 13 | } 14 | 15 | public uint ExpireTime 16 | { 17 | get { return Helper.Magic.Read((uint)Pointer + Offsets.AuctionHouse.ExpireOffset); } 18 | } 19 | 20 | public TimeSpan TimeLeft 21 | { 22 | get { return TimeSpan.FromSeconds(ExpireTime - Helper.PerformanceCount); } 23 | } 24 | 25 | public WoWAuction(AuctionListType type, int index) 26 | { 27 | uint listBase = Offsets.AuctionHouse.ListBase; 28 | uint listCount = Offsets.AuctionHouse.ListCount; 29 | switch (type) 30 | { 31 | case AuctionListType.Bidder: 32 | listCount = Offsets.AuctionHouse.BidderCount; 33 | listBase = Offsets.AuctionHouse.BidderBase; 34 | break; 35 | 36 | case AuctionListType.Owner: 37 | listCount = Offsets.AuctionHouse.OwnerCount; 38 | listBase = Offsets.AuctionHouse.OwnerBase; 39 | break; 40 | } 41 | 42 | var count = Helper.Magic.Read(listCount); 43 | if (count <= index) 44 | Pointer = IntPtr.Zero; 45 | else 46 | { 47 | var b = Helper.Magic.Read(listBase); 48 | Pointer = new IntPtr(Helper.Magic.Read((uint) (b + (Offsets.AuctionHouse.AuctionSize*index)))); 49 | } 50 | } 51 | 52 | public static int GetAuctionCount(AuctionListType type) 53 | { 54 | switch (type) 55 | { 56 | case AuctionListType.Bidder: 57 | return Helper.Magic.Read(Offsets.AuctionHouse.BidderCount); 58 | case AuctionListType.List: 59 | return Helper.Magic.Read(Offsets.AuctionHouse.ListCount); 60 | case AuctionListType.Owner: 61 | return Helper.Magic.Read(Offsets.AuctionHouse.OwnerCount); 62 | default: 63 | return 0; 64 | } 65 | } 66 | 67 | public static int BidderCount 68 | { 69 | get { return GetAuctionCount(AuctionListType.Bidder); } 70 | } 71 | 72 | public static int ListCount 73 | { 74 | get { return GetAuctionCount(AuctionListType.List); } 75 | } 76 | 77 | public static int OwnerCount 78 | { 79 | get { return GetAuctionCount(AuctionListType.Owner); } 80 | } 81 | } 82 | 83 | } -------------------------------------------------------------------------------- /cleanCore/D3D/Pulse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using WhiteMagic.Internals; 4 | 5 | namespace cleanCore.D3D 6 | { 7 | 8 | public static class Pulse 9 | { 10 | private static Direct3DAPI.Direct3D9EndScene _endSceneDelegate; 11 | private static Detour _endSceneHook; 12 | 13 | private static readonly object _frameLock = new object(); 14 | public static IntPtr EndScenePointer = IntPtr.Zero; 15 | public static IntPtr ResetPointer = IntPtr.Zero; 16 | public static IntPtr ResetExPointer = IntPtr.Zero; 17 | 18 | public static event EventHandler OnFrame; 19 | 20 | private static int EndSceneHook(IntPtr device) 21 | { 22 | lock (_frameLock) 23 | { 24 | Manager.Pulse(); 25 | Events.Pulse(); 26 | 27 | if (OnFrame != null) 28 | OnFrame(null, new EventArgs()); 29 | } 30 | 31 | return (int)_endSceneHook.CallOriginal(device); 32 | } 33 | 34 | public static void Initialize() 35 | { 36 | var window = new Form(); 37 | IntPtr direct3D = Direct3DAPI.Direct3DCreate9(Direct3DAPI.SDKVersion); 38 | if (direct3D == IntPtr.Zero) 39 | throw new Exception("Direct3DCreate9 failed (SDK Version: " + Direct3DAPI.SDKVersion + ")"); 40 | var pp = new Direct3DAPI.PresentParameters { Windowed = true, SwapEffect = 1, BackBufferFormat = 0 }; 41 | var createDevice = Helper.Magic.RegisterDelegate(Helper.Magic.GetObjectVtableFunction(direct3D, 16)); 42 | IntPtr device; 43 | if (createDevice(direct3D, 0, 1, window.Handle, 0x20, ref pp, out device) < 0) 44 | throw new Exception("Failed to create device"); 45 | 46 | EndScenePointer = Helper.Magic.GetObjectVtableFunction(device, Direct3DAPI.EndSceneOffset); 47 | ResetPointer = Helper.Magic.GetObjectVtableFunction(device, Direct3DAPI.ResetOffset); 48 | ResetExPointer = Helper.Magic.GetObjectVtableFunction(device, Direct3DAPI.ResetExOffset); 49 | 50 | var deviceRelease = Helper.Magic.RegisterDelegate(Helper.Magic.GetObjectVtableFunction(device, 2)); 51 | var release = Helper.Magic.RegisterDelegate(Helper.Magic.GetObjectVtableFunction(direct3D, 2)); 52 | 53 | deviceRelease(device); 54 | release(direct3D); 55 | window.Dispose(); 56 | 57 | // TODO: replace this with a VTable hook 58 | _endSceneDelegate = Helper.Magic.RegisterDelegate(EndScenePointer); 59 | _endSceneHook = Helper.Magic.Detours.CreateAndApply(_endSceneDelegate, 60 | new Direct3DAPI.Direct3D9EndScene(EndSceneHook), 61 | "EndScene"); 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /TeleportBook/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TeleportBook.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TeleportBook.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /cleanCore/WoWLocalPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | public class WoWLocalPlayer : WoWPlayer 8 | { 9 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 10 | public delegate int ClickToMoveDelegate( 11 | IntPtr thisPointer, int clickType, ref ulong interactGuid, ref Location clickLocation, float precision); 12 | public static ClickToMoveDelegate ClickToMoveFunction; 13 | 14 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 15 | private delegate void SetFacingDelegate(IntPtr thisObj, uint time, float facing); 16 | private static SetFacingDelegate _setFacing; 17 | 18 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 19 | private delegate bool IsClickMovingDelegate(IntPtr thisObj); 20 | private static IsClickMovingDelegate _isClickMoving; 21 | 22 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 23 | private delegate void StopCTMDelegate(IntPtr thisObj); 24 | private static StopCTMDelegate _stopCTM; 25 | 26 | public new static void Initialize() 27 | { 28 | WoWObject.Initialize(); 29 | 30 | ClickToMoveFunction = Helper.Magic.RegisterDelegate(Offsets.ClickToMove); 31 | _setFacing = Helper.Magic.RegisterDelegate(Offsets.SetFacing); 32 | _isClickMoving = Helper.Magic.RegisterDelegate(Offsets.IsClickMoving); 33 | _stopCTM = Helper.Magic.RegisterDelegate(Offsets.StopCTM); 34 | } 35 | 36 | public WoWLocalPlayer(IntPtr pointer) 37 | : base(pointer) 38 | { 39 | 40 | } 41 | 42 | public void ClickToMove(Location target) 43 | { 44 | Helper.ResetHardwareAction(); 45 | ulong guid = 0; 46 | ClickToMoveFunction(Pointer, 0x4, ref guid, ref target, 0.1f); 47 | } 48 | 49 | public void StopCTM() 50 | { 51 | _stopCTM(Pointer); 52 | } 53 | 54 | public void LookAt(Location loc) 55 | { 56 | var local = Location; 57 | var diffVector = new Location(loc.X - local.X, loc.Y - local.Y, loc.Z - local.Z); 58 | SetFacing(diffVector.Angle); 59 | } 60 | 61 | public void SetFacing(float angle) 62 | { 63 | const float pi2 = (float)(Math.PI * 2); 64 | if (angle < 0.0f) 65 | angle += pi2; 66 | if (angle > pi2) 67 | angle -= pi2; 68 | _setFacing(Pointer, Helper.PerformanceCount, angle); 69 | } 70 | 71 | public bool IsClickMoving 72 | { 73 | get { return _isClickMoving(Pointer); } 74 | } 75 | 76 | public Location Corpse 77 | { 78 | get 79 | { 80 | return Helper.Magic.ReadStruct(new IntPtr(Offsets.CorpsePosition)); 81 | } 82 | } 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /TeleportBook/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows.Forms; 4 | using cleanCore; 5 | using WhiteMagic.Internals; 6 | 7 | namespace TeleportBook 8 | { 9 | public partial class Form1 : Form 10 | { 11 | public BindingList Items = new BindingList(); 12 | private readonly Detour _ctmDetour; 13 | 14 | public Form1() 15 | { 16 | InitializeComponent(); 17 | dataGridView1.DataSource = Items; 18 | _ctmDetour = Helper.Magic.Detours.Create(WoWLocalPlayer.ClickToMoveFunction, new WoWLocalPlayer.ClickToMoveDelegate(HandleClickToMove), 19 | "CTMTeleport"); 20 | } 21 | 22 | private int HandleClickToMove(IntPtr thisPointer, int clickType, ref ulong interactGuid, ref Location clickLocation, float precision) 23 | { 24 | if (Teleporter.Destination != null) 25 | return 0; 26 | 27 | if (clickType == 4) 28 | { 29 | Teleporter.SetDestination(clickLocation); 30 | return 0; 31 | } 32 | 33 | return (int)_ctmDetour.CallOriginal(thisPointer, clickType, interactGuid, clickLocation, precision); 34 | } 35 | 36 | private void button1_Click(object sender, EventArgs e) 37 | { 38 | if (Manager.LocalPlayer == null) 39 | return; 40 | 41 | var loc = Manager.LocalPlayer.Location; 42 | Items.Add(new BookItem { Name = "Player", X = loc.X, Y = loc.Y, Z = loc.Z }); 43 | } 44 | 45 | private void button2_Click(object sender, EventArgs e) 46 | { 47 | if (Manager.LocalPlayer == null || Manager.LocalPlayer.TargetGuid == 0 || Manager.LocalPlayer.Target == null) 48 | return; 49 | 50 | var loc = Manager.LocalPlayer.Target.Location; 51 | Items.Add(new BookItem{Name = Manager.LocalPlayer.Target.Name, X = loc.X, Y = loc.Y, Z = loc.Z}); 52 | } 53 | 54 | private void button3_Click(object sender, EventArgs e) 55 | { 56 | if (dataGridView1.SelectedRows.Count <= 0) 57 | return; 58 | 59 | if (Teleporter.Destination != null) 60 | return; 61 | 62 | var row = dataGridView1.SelectedRows[0]; 63 | if (row.DataBoundItem != null) 64 | { 65 | var bookitem = (BookItem) row.DataBoundItem; 66 | Teleporter.SetDestination(new Location(bookitem.X, bookitem.Y, bookitem.Z)); 67 | } 68 | } 69 | 70 | private void checkBox1_CheckedChanged(object sender, EventArgs e) 71 | { 72 | if (checkBox1.Checked) 73 | { 74 | _ctmDetour.Apply(); 75 | } 76 | else 77 | _ctmDetour.Remove(); 78 | } 79 | } 80 | 81 | public class BookItem 82 | { 83 | public string Name { get; set; } 84 | public float X { get; set; } 85 | public float Y { get; set; } 86 | public float Z { get; set; } 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /cleanCore/WoWWorld.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public enum TracelineResult 7 | { 8 | Collided, 9 | NoCollision 10 | } 11 | 12 | public static class WoWWorld 13 | { 14 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 15 | private delegate bool TracelineDelegate( 16 | ref Location start, ref Location end, out Location result, ref float distanceTravelled, uint flags, 17 | uint zero); 18 | private static TracelineDelegate _traceline; 19 | 20 | public static void Initialize() 21 | { 22 | _traceline = Helper.Magic.RegisterDelegate(Offsets.Traceline); 23 | } 24 | 25 | public static TracelineResult Traceline(Location start, Location end, uint flags) 26 | { 27 | float dist = 1.0f; 28 | Location result; 29 | return _traceline(ref start, ref end, out result, ref dist, flags, 0) 30 | ? TracelineResult.Collided 31 | : TracelineResult.NoCollision; 32 | } 33 | 34 | public static TracelineResult Traceline(Location start, Location end) 35 | { 36 | return Traceline(start, end, 0x120171); 37 | } 38 | 39 | public static TracelineResult LineOfSightTest(Location start, Location end) 40 | { 41 | start.Z += 2; 42 | end.Z += 2; 43 | return Traceline(start, end, 0x1000024); 44 | } 45 | 46 | public static uint CurrentMapId 47 | { 48 | get { return Helper.Magic.Read(Offsets.CurrentMapId); } 49 | } 50 | 51 | public static string CurrentMap 52 | { 53 | get 54 | { 55 | // we should do this properly using Map.dbc 56 | // this can presumably also be used for phases, but its rather useless because its our current zone, and we need to know all phases beforehand 57 | switch (CurrentMapId) 58 | { 59 | case 0: 60 | return "Azeroth"; 61 | case 1: 62 | return "Kalimdor"; 63 | case 571: 64 | return "Northrend"; 65 | case 530: 66 | return "Expansion01"; 67 | case 34: 68 | return "StormwindJail"; 69 | case 43: 70 | return "WailingCaverns"; 71 | case 47: 72 | return "RazorfenKraulInstance"; 73 | case 48: 74 | return "Blackfathom"; 75 | case 70: 76 | return "Uldaman"; 77 | case 90: 78 | return "GnomeragonInstance"; 79 | case 109: 80 | return "SunkenTemple"; 81 | case 129: 82 | return "RazorfenDowns"; 83 | case 189: 84 | return "MonasteryInstances"; 85 | case 209: 86 | return "TanarisInstance"; 87 | case 389: 88 | return "OrgrimmarInstance"; 89 | } 90 | return null; 91 | } 92 | } 93 | 94 | } 95 | 96 | } -------------------------------------------------------------------------------- /cleanCore/Constants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public enum UnitReaction 7 | { 8 | ExceptionallyHostile, 9 | VeryHostile, 10 | Hostile, 11 | Neutral, 12 | Friendly, 13 | VeryFriendly, 14 | ExceptionallyFriendly, 15 | Exalted 16 | } 17 | 18 | public enum WoWClass 19 | { 20 | Warrior = 1, 21 | Paladin, 22 | Hunter, 23 | Rogue, 24 | Priest, 25 | DeathKnight, 26 | Shaman, 27 | Mage, 28 | Warlock, 29 | Druid = 11 30 | } 31 | 32 | public enum WoWRace 33 | { 34 | Human = 1, 35 | Orc, 36 | Dwarf, 37 | NightElf, 38 | Undead, 39 | Tauren, 40 | Gnome, 41 | Troll, 42 | Goblin, 43 | BloodElf, 44 | Draenei, 45 | FelOrc, 46 | Naga, 47 | Broken, 48 | Skeleton, 49 | Vrykul, 50 | Tuskarr, 51 | ForestTroll, 52 | Taunka, 53 | NorthrendSkeleton, 54 | IceTroll, 55 | Worgen, 56 | Gilnean 57 | } 58 | 59 | [Flags] 60 | public enum WoWObjectType 61 | { 62 | Object = 0x1, 63 | Item = 0x2, 64 | Container = 0x4, 65 | Unit = 0x8, 66 | Player = 0x10, 67 | GameObject = 0x20, 68 | DynamicObject = 0x40, 69 | Corpse = 0x80, 70 | AiGroup = 0x100, 71 | AreaTrigger = 0x200, 72 | } 73 | 74 | [Flags] 75 | public enum GameObjectFlags : ushort 76 | { 77 | None = 0x00000000, 78 | InUse = 0x00000001, 79 | Locked = 0x00000002, 80 | InteractionCondition = 0x00000004, 81 | Transport = 0x00000008, 82 | Unknown1 = 0x00000010, 83 | NeverDespawn = 0x00000020, 84 | Triggered = 0x00000040, 85 | Unknown2 = 0x00000080, 86 | Unknown3 = 0x00000100, 87 | Damaged = 0x00000200, 88 | Destroyed = 0x00000400 89 | } 90 | 91 | [Flags] 92 | public enum ItemFlags : uint 93 | { 94 | None = 0x00000000, 95 | Unknown1 = 0x00000001, 96 | Conjured = 0x00000002, 97 | Openable = 0x00000004, 98 | Heroic = 0x00000008, 99 | Deprecated = 0x00000010, 100 | Indestructible = 0x00000020, 101 | Consumable = 0x00000040, 102 | NoEquipCooldown = 0x00000080, 103 | Unknown2 = 0x00000100, 104 | Wrapper = 0x00000200, 105 | Unknown3 = 0x00000400, 106 | PartyLoot = 0x00000800, 107 | Refundable = 0x00001000, 108 | Charter = 0x00002000, 109 | Unknown4 = 0x00004000, 110 | Unknown5 = 0x00008000, 111 | Unknown6 = 0x00010000, 112 | Unknown7 = 0x00020000, 113 | Prospectable = 0x00040000, 114 | UniqueEquip = 0x00080000, 115 | Unknown8 = 0x00100000, 116 | UsableInArena = 0x00200000, 117 | Throwable = 0x00400000, 118 | UsableWhenShapeshifted = 0x00800000, 119 | Unknown9 = 0x01000000, 120 | SmartLoot = 0x02000000, 121 | UnusableInArena = 0x04000000, 122 | BindToAccount = 0x08000000, 123 | TriggeredCast = 0x10000000, 124 | Millable = 0x20000000, 125 | Unknown10 = 0x40000000, 126 | Unknown11 = 0x80000000, 127 | } 128 | 129 | } -------------------------------------------------------------------------------- /cleanCore.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cleanCore", "cleanCore\cleanCore.csproj", "{4FD0CCE8-D493-4DF1-A308-A1385DD98245}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cleanPattern", "cleanPattern\cleanPattern.csproj", "{29464482-6061-4C6C-ACBE-B7340D0CE164}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeleportBook", "TeleportBook\TeleportBook.csproj", "{1DF16C03-F40D-4329-AD8F-F65A3B043E3E}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B66EC9B4-7992-446E-9E1F-749778E9635F}" 11 | ProjectSection(SolutionItems) = preProject 12 | LICENSE = LICENSE 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Debug|Mixed Platforms = Debug|Mixed Platforms 19 | Debug|x86 = Debug|x86 20 | Release|Any CPU = Release|Any CPU 21 | Release|Mixed Platforms = Release|Mixed Platforms 22 | Release|x86 = Release|x86 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 28 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 29 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Debug|x86.ActiveCfg = Debug|Any CPU 30 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 33 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Release|Mixed Platforms.Build.0 = Release|Any CPU 34 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245}.Release|x86.ActiveCfg = Release|Any CPU 35 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 38 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 39 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Debug|x86.ActiveCfg = Debug|Any CPU 40 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 43 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Release|Mixed Platforms.Build.0 = Release|Any CPU 44 | {29464482-6061-4C6C-ACBE-B7340D0CE164}.Release|x86.ActiveCfg = Release|Any CPU 45 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Debug|Any CPU.ActiveCfg = Debug|x86 46 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 47 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Debug|Mixed Platforms.Build.0 = Debug|x86 48 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Debug|x86.ActiveCfg = Debug|x86 49 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Debug|x86.Build.0 = Debug|x86 50 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Release|Any CPU.ActiveCfg = Release|x86 51 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Release|Mixed Platforms.ActiveCfg = Release|x86 52 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Release|Mixed Platforms.Build.0 = Release|x86 53 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Release|x86.ActiveCfg = Release|x86 54 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E}.Release|x86.Build.0 = Release|x86 55 | EndGlobalSection 56 | GlobalSection(SolutionProperties) = preSolution 57 | HideSolutionNode = FALSE 58 | EndGlobalSection 59 | EndGlobal 60 | -------------------------------------------------------------------------------- /cleanCore/Events.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using WhiteMagic.Internals; 5 | 6 | namespace cleanCore 7 | { 8 | 9 | public static class Events 10 | { 11 | private const int RegisterCheckWait = 500; /*ms*/ 12 | 13 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 14 | private delegate int LuaFunctionDelegate(IntPtr luaState); 15 | 16 | private static DateTime _lastRegisterCheck = DateTime.Now - TimeSpan.FromMilliseconds(RegisterCheckWait); 17 | private static Detour _eventDetour; 18 | private static readonly Dictionary> _eventHandler = new Dictionary>(); 19 | 20 | public delegate void EventHandler(string eventName, List args); 21 | 22 | public static void Initialize() 23 | { 24 | var eventVictim = Helper.Magic.RegisterDelegate(Offsets.EventVictim); 25 | _eventDetour = Helper.Magic.Detours.CreateAndApply(eventVictim, new LuaFunctionDelegate(HandleVictimCall), "EventVictim"); 26 | } 27 | 28 | public static void Pulse() 29 | { 30 | if ((DateTime.Now - _lastRegisterCheck).TotalMilliseconds >= RegisterCheckWait) 31 | { 32 | _lastRegisterCheck = DateTime.Now; 33 | if (!ListenerExists) 34 | ExecuteIngameListener(); 35 | } 36 | } 37 | 38 | public static void Register(string name, EventHandler handler) 39 | { 40 | if (_eventHandler.ContainsKey(name)) 41 | _eventHandler[name].Add(handler); 42 | else 43 | _eventHandler.Add(name, new List {handler}); 44 | } 45 | 46 | public static void Remove(string name, EventHandler handler) 47 | { 48 | if (_eventHandler.ContainsKey(name)) 49 | _eventHandler[name].Remove(handler); 50 | } 51 | 52 | private static void HandleEvent(List args) 53 | { 54 | string eventName = args[0]; 55 | args.RemoveAt(0); 56 | if (_eventHandler.ContainsKey(eventName)) 57 | { 58 | foreach (var handler in _eventHandler[eventName]) 59 | handler(eventName, args); 60 | } 61 | } 62 | 63 | private static int HandleVictimCall(IntPtr luaState) 64 | { 65 | int top = LuaInterface.GetTop(luaState); 66 | if (top > 0) 67 | { 68 | var args = new List(top); 69 | for (int i = 1; i <= top; i++) 70 | args.Add(LuaInterface.StackObjectToString(luaState, i)); 71 | LuaInterface.Pop(luaState, top); 72 | HandleEvent(args); 73 | } 74 | else 75 | { 76 | // legal call 77 | return (int)_eventDetour.CallOriginal(luaState); 78 | } 79 | 80 | return 0; 81 | } 82 | 83 | private static bool ListenerExists 84 | { 85 | get 86 | { 87 | const string checkCommand = "evcFrame == nil"; 88 | var ret = WoWScript.Execute(checkCommand); 89 | return ret[0] == "false"; 90 | } 91 | } 92 | 93 | private static void ExecuteIngameListener() 94 | { 95 | const string command = 96 | "local frame = CreateFrame('Frame', 'evcFrame'); frame:RegisterAllEvents(); frame:SetScript('OnEvent', function(self, event, ...) GetBillingTimeRested(event, ...); end);"; 97 | WoWScript.ExecuteNoResults(command); 98 | } 99 | } 100 | 101 | } -------------------------------------------------------------------------------- /TeleportBook/TeleportBook.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {1DF16C03-F40D-4329-AD8F-F65A3B043E3E} 9 | WinExe 10 | Properties 11 | TeleportBook 12 | TeleportBook 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | ..\Externals\WhiteMagic.dll 42 | 43 | 44 | 45 | 46 | Form 47 | 48 | 49 | Form1.cs 50 | 51 | 52 | 53 | 54 | Form1.cs 55 | 56 | 57 | ResXFileCodeGenerator 58 | Resources.Designer.cs 59 | Designer 60 | 61 | 62 | True 63 | Resources.resx 64 | 65 | 66 | SettingsSingleFileGenerator 67 | Settings.Designer.cs 68 | 69 | 70 | True 71 | Settings.settings 72 | True 73 | 74 | 75 | 76 | 77 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245} 78 | cleanCore 79 | 80 | 81 | 82 | 89 | -------------------------------------------------------------------------------- /cleanCore/WoWPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace cleanCore 4 | { 5 | 6 | public class WoWPlayer : WoWUnit 7 | { 8 | public WoWPlayer(IntPtr pointer) 9 | : base(pointer) 10 | { 11 | 12 | } 13 | 14 | public uint Experience 15 | { 16 | get 17 | { 18 | return GetDescriptor((int)PlayerField.PLAYER_XP); 19 | } 20 | } 21 | 22 | public uint NextLevelExperience 23 | { 24 | get 25 | { 26 | return GetDescriptor((int)PlayerField.PLAYER_NEXT_LEVEL_XP); 27 | } 28 | } 29 | 30 | public uint GuildRank 31 | { 32 | get 33 | { 34 | return GetDescriptor((int) PlayerField.PLAYER_GUILDRANK); 35 | } 36 | } 37 | 38 | public uint GuildLevel 39 | { 40 | get 41 | { 42 | return GetDescriptor((int) PlayerField.PLAYER_GUILDLEVEL); 43 | } 44 | } 45 | 46 | public float BlockPercentage 47 | { 48 | get 49 | { 50 | return GetDescriptor((int) PlayerField.PLAYER_BLOCK_PERCENTAGE); 51 | } 52 | } 53 | 54 | public float DodgePercentage 55 | { 56 | get 57 | { 58 | return GetDescriptor((int) PlayerField.PLAYER_DODGE_PERCENTAGE); 59 | } 60 | } 61 | 62 | public float ParryPercentage 63 | { 64 | get 65 | { 66 | return GetDescriptor((int) PlayerField.PLAYER_PARRY_PERCENTAGE); 67 | } 68 | } 69 | 70 | public uint Expertise 71 | { 72 | get 73 | { 74 | return GetDescriptor((int) PlayerField.PLAYER_EXPERTISE); 75 | } 76 | } 77 | 78 | public uint OffhandExpertise 79 | { 80 | get 81 | { 82 | return GetDescriptor((int) PlayerField.PLAYER_OFFHAND_EXPERTISE); 83 | } 84 | } 85 | 86 | public float CritPercentage 87 | { 88 | get 89 | { 90 | return GetDescriptor((int) PlayerField.PLAYER_CRIT_PERCENTAGE); 91 | } 92 | } 93 | 94 | public float RangedCritPercentage 95 | { 96 | get 97 | { 98 | return GetDescriptor((int) PlayerField.PLAYER_RANGED_CRIT_PERCENTAGE); 99 | } 100 | } 101 | 102 | public float OffhandCritPercentage 103 | { 104 | get 105 | { 106 | return GetDescriptor((int) PlayerField.PLAYER_OFFHAND_CRIT_PERCENTAGE); 107 | } 108 | } 109 | 110 | public uint Mastery 111 | { 112 | get 113 | { 114 | return GetDescriptor((int) PlayerField.PLAYER_MASTERY); 115 | } 116 | } 117 | 118 | public uint RestedExperience 119 | { 120 | get 121 | { 122 | return GetDescriptor((int) PlayerField.PLAYER_REST_STATE_EXPERIENCE); 123 | } 124 | } 125 | 126 | public ulong Coinage 127 | { 128 | get 129 | { 130 | return GetDescriptor((int) PlayerField.PLAYER_FIELD_COINAGE); 131 | } 132 | } 133 | 134 | public uint PlayerFlags 135 | { 136 | get { return GetDescriptor((int) PlayerField.PLAYER_FLAGS); } 137 | } 138 | 139 | public bool IsGhost 140 | { 141 | get { return (PlayerFlags & (1 << 4)) > 0; } 142 | } 143 | 144 | } 145 | 146 | } -------------------------------------------------------------------------------- /cleanCore/cleanCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {4FD0CCE8-D493-4DF1-A308-A1385DD98245} 9 | Library 10 | Properties 11 | cleanCore 12 | cleanCore 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | true 25 | x86 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | 32 | 33 | prompt 34 | 4 35 | true 36 | x86 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ..\Externals\WhiteMagic.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | {29464482-6061-4C6C-ACBE-B7340D0CE164} 85 | cleanPattern 86 | 87 | 88 | 89 | 90 | 97 | -------------------------------------------------------------------------------- /cleanCore/LuaInterface.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace cleanCore 6 | { 7 | 8 | internal static class LuaInterface 9 | { 10 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 11 | public delegate int LuaGetTopDelegate(IntPtr luaState); 12 | public static LuaGetTopDelegate GetTop; 13 | 14 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 15 | public delegate void LuaSetTopDelegate(IntPtr luaState, int index); 16 | public static LuaSetTopDelegate SetTop; 17 | 18 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 19 | public delegate int LuaTypeDelegate(IntPtr luaState, int index); 20 | public static LuaTypeDelegate Type; 21 | 22 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 23 | public delegate IntPtr LuaToLStringDelegate(IntPtr luaState, int index, int zero); 24 | public static LuaToLStringDelegate ToLString; 25 | 26 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 27 | public delegate int LuaToBooleanDelegate(IntPtr luaState, int index); 28 | public static LuaToBooleanDelegate ToBoolean; 29 | 30 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 31 | public delegate double LuaToNumberDelegate(IntPtr luaState, int index); 32 | public static LuaToNumberDelegate ToNumber; 33 | 34 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 35 | public delegate int LuaPCallDelegate(IntPtr luaState, int nargs, int nresults, int errfunc); 36 | public static LuaPCallDelegate PCall; 37 | 38 | [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 39 | public delegate int LuaLoadBufferDelegate( 40 | IntPtr luaState, IntPtr buffer, int bufferLength, 41 | [MarshalAs(UnmanagedType.LPStr)] string chunkName); 42 | public static LuaLoadBufferDelegate LoadBuffer; 43 | 44 | public static void Pop(IntPtr state, int n) 45 | { 46 | SetTop(state, -(n) - 1); 47 | } 48 | 49 | public enum LuaConstant 50 | { 51 | MultRet = -1, 52 | TypeNil = 0, 53 | TypeBoolean = 1, 54 | TypeNumber = 3, 55 | TypeString = 4 56 | } 57 | 58 | public static IntPtr LuaState 59 | { 60 | get 61 | { 62 | return Helper.Magic.Read(Offsets.LuaState); 63 | } 64 | } 65 | 66 | public static void Initialize() 67 | { 68 | GetTop = Helper.Magic.RegisterDelegate(Offsets.LuaGetTop); 69 | SetTop = Helper.Magic.RegisterDelegate(Offsets.LuaSetTop); 70 | Type = Helper.Magic.RegisterDelegate(Offsets.LuaType); 71 | ToLString = Helper.Magic.RegisterDelegate(Offsets.LuaToLString); 72 | ToBoolean = Helper.Magic.RegisterDelegate(Offsets.LuaToBoolean); 73 | ToNumber = Helper.Magic.RegisterDelegate(Offsets.LuaToNumber); 74 | PCall = Helper.Magic.RegisterDelegate(Offsets.LuaPCall); 75 | LoadBuffer = Helper.Magic.RegisterDelegate(Offsets.LuaLoadBuffer); 76 | } 77 | 78 | public static string StackObjectToString(IntPtr state, int index) 79 | { 80 | var ltype = (LuaConstant)Type(state, index); 81 | 82 | switch (ltype) 83 | { 84 | case LuaConstant.TypeNil: 85 | return "nil"; 86 | 87 | case LuaConstant.TypeBoolean: 88 | return ToBoolean(state, index) > 0 ? "true" : "false"; 89 | 90 | case LuaConstant.TypeNumber: 91 | return ToNumber(state, index).ToString(CultureInfo.InvariantCulture); 92 | 93 | case LuaConstant.TypeString: 94 | return Marshal.PtrToStringAnsi(ToLString(state, index, 0)); 95 | 96 | default: 97 | return ""; 98 | } 99 | } 100 | } 101 | 102 | } -------------------------------------------------------------------------------- /TeleportBook/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace TeleportBook 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.dataGridView1 = new System.Windows.Forms.DataGridView(); 32 | this.button1 = new System.Windows.Forms.Button(); 33 | this.button2 = new System.Windows.Forms.Button(); 34 | this.button3 = new System.Windows.Forms.Button(); 35 | this.checkBox1 = new System.Windows.Forms.CheckBox(); 36 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); 37 | this.SuspendLayout(); 38 | // 39 | // dataGridView1 40 | // 41 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 42 | this.dataGridView1.Location = new System.Drawing.Point(12, 12); 43 | this.dataGridView1.Name = "dataGridView1"; 44 | this.dataGridView1.Size = new System.Drawing.Size(407, 251); 45 | this.dataGridView1.TabIndex = 1; 46 | // 47 | // button1 48 | // 49 | this.button1.Location = new System.Drawing.Point(425, 12); 50 | this.button1.Name = "button1"; 51 | this.button1.Size = new System.Drawing.Size(91, 23); 52 | this.button1.TabIndex = 2; 53 | this.button1.Text = "Add Player"; 54 | this.button1.UseVisualStyleBackColor = true; 55 | this.button1.Click += new System.EventHandler(this.button1_Click); 56 | // 57 | // button2 58 | // 59 | this.button2.Location = new System.Drawing.Point(425, 41); 60 | this.button2.Name = "button2"; 61 | this.button2.Size = new System.Drawing.Size(91, 23); 62 | this.button2.TabIndex = 3; 63 | this.button2.Text = "Add Target"; 64 | this.button2.UseVisualStyleBackColor = true; 65 | this.button2.Click += new System.EventHandler(this.button2_Click); 66 | // 67 | // button3 68 | // 69 | this.button3.Location = new System.Drawing.Point(425, 240); 70 | this.button3.Name = "button3"; 71 | this.button3.Size = new System.Drawing.Size(91, 23); 72 | this.button3.TabIndex = 4; 73 | this.button3.Text = "Teleport!"; 74 | this.button3.UseVisualStyleBackColor = true; 75 | this.button3.Click += new System.EventHandler(this.button3_Click); 76 | // 77 | // checkBox1 78 | // 79 | this.checkBox1.AutoSize = true; 80 | this.checkBox1.Location = new System.Drawing.Point(425, 70); 81 | this.checkBox1.Name = "checkBox1"; 82 | this.checkBox1.Size = new System.Drawing.Size(91, 17); 83 | this.checkBox1.TabIndex = 5; 84 | this.checkBox1.Text = "CTM Teleport"; 85 | this.checkBox1.UseVisualStyleBackColor = true; 86 | this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); 87 | // 88 | // Form1 89 | // 90 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 91 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 92 | this.ClientSize = new System.Drawing.Size(522, 273); 93 | this.Controls.Add(this.checkBox1); 94 | this.Controls.Add(this.button3); 95 | this.Controls.Add(this.button2); 96 | this.Controls.Add(this.button1); 97 | this.Controls.Add(this.dataGridView1); 98 | this.Name = "Form1"; 99 | this.Text = "Teleport Book"; 100 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); 101 | this.ResumeLayout(false); 102 | this.PerformLayout(); 103 | 104 | } 105 | 106 | #endregion 107 | 108 | private System.Windows.Forms.DataGridView dataGridView1; 109 | private System.Windows.Forms.Button button1; 110 | private System.Windows.Forms.Button button2; 111 | private System.Windows.Forms.Button button3; 112 | private System.Windows.Forms.CheckBox checkBox1; 113 | } 114 | } 115 | 116 | -------------------------------------------------------------------------------- /cleanCore/Manager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Linq; 5 | 6 | namespace cleanCore 7 | { 8 | 9 | public static class Manager 10 | { 11 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 12 | private delegate uint EnumVisibleObjectsDelegate(IntPtr callback, int filter); 13 | private static EnumVisibleObjectsDelegate _enumVisibleObjects; 14 | 15 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 16 | private delegate int EnumVisibleObjectsCallback(ulong guid, uint filter); 17 | private static IntPtr _ourCallback; 18 | 19 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 20 | private delegate IntPtr GetObjectByGuidDelegate(ulong guid, int filter); 21 | private static GetObjectByGuidDelegate _getObjectByGuid; 22 | 23 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 24 | private delegate ulong GetLocalPlayerDelegate(); 25 | private static GetLocalPlayerDelegate _getLocalPlayer; 26 | 27 | private static readonly EnumVisibleObjectsCallback _callback = Callback; 28 | private static readonly Dictionary _objects = new Dictionary(); 29 | 30 | public static WoWLocalPlayer LocalPlayer { get; private set; } 31 | public static List Objects { get; private set; } 32 | 33 | private unsafe static IntPtr CurMgr 34 | { 35 | get 36 | { 37 | uint singleton = *(uint*)Offsets.Teleport.Singleton; 38 | if (singleton == 0) 39 | return IntPtr.Zero; 40 | uint* ret = *(uint**)(singleton + Offsets.Teleport.CurMgrOffset); 41 | return new IntPtr(ret); 42 | } 43 | } 44 | 45 | public static unsafe void SetHeartbeatTime(uint next) 46 | { 47 | *(uint*)(GetGlobalMovement() + Offsets.Teleport.GlobalMovementHeartbeat) = next; 48 | } 49 | 50 | private static unsafe uint GetGlobalMovement() 51 | { 52 | return *(uint*)((uint)CurMgr + Offsets.Teleport.CurMgrGlobalMovement); 53 | } 54 | 55 | public static void Initialize() 56 | { 57 | _enumVisibleObjects = Helper.Magic.RegisterDelegate(Offsets.EnumVisibleObjects); 58 | _getObjectByGuid = Helper.Magic.RegisterDelegate(Offsets.GetObjectByGuid); 59 | _getLocalPlayer = Helper.Magic.RegisterDelegate(Offsets.GetLocalPlayerGuid); 60 | _ourCallback = Marshal.GetFunctionPointerForDelegate(_callback); 61 | } 62 | 63 | public static WoWObject GetObjectByGuid(ulong guid) 64 | { 65 | if (_objects.ContainsKey(guid)) 66 | return _objects[guid]; 67 | return null; 68 | } 69 | 70 | public static bool IsInGame 71 | { 72 | get 73 | { 74 | return LocalPlayer != null; 75 | } 76 | } 77 | 78 | public static void Pulse() 79 | { 80 | var localPlayerGuid = _getLocalPlayer(); 81 | if (localPlayerGuid == 0) 82 | return; 83 | var localPlayerPointer = _getObjectByGuid(localPlayerGuid, -1); 84 | if (localPlayerPointer == IntPtr.Zero) 85 | return; 86 | LocalPlayer = new WoWLocalPlayer(localPlayerPointer); 87 | 88 | foreach (var obj in _objects.Values) 89 | obj.Pointer = IntPtr.Zero; 90 | 91 | _enumVisibleObjects(_ourCallback, 0); 92 | 93 | foreach (var pair in _objects.Where(p => p.Value.Pointer == IntPtr.Zero).ToList()) 94 | _objects.Remove(pair.Key); 95 | 96 | Objects = _objects.Values.ToList(); 97 | } 98 | 99 | private static int Callback(ulong guid, uint filter) 100 | { 101 | var pointer = _getObjectByGuid(guid, -1); 102 | if (pointer == IntPtr.Zero) 103 | return 1; 104 | 105 | if (_objects.ContainsKey(guid)) 106 | _objects[guid].Pointer = pointer; 107 | else 108 | { 109 | var obj = new WoWObject(pointer); 110 | var type = obj.Type; 111 | 112 | if (type.HasFlag(WoWObjectType.Player)) 113 | _objects.Add(guid, new WoWPlayer(pointer)); 114 | else if (type.HasFlag(WoWObjectType.Unit)) 115 | _objects.Add(guid, new WoWUnit(pointer)); 116 | else if (type.HasFlag(WoWObjectType.Container)) 117 | _objects.Add(guid, new WoWContainer(pointer)); 118 | else if (type.HasFlag(WoWObjectType.Item)) 119 | _objects.Add(guid, new WoWItem(pointer)); 120 | else if (type.HasFlag(WoWObjectType.Corpse)) 121 | _objects.Add(guid, new WoWCorpse(pointer)); 122 | else if (type.HasFlag(WoWObjectType.GameObject)) 123 | _objects.Add(guid, new WoWGameObject(pointer)); 124 | else if (type.HasFlag(WoWObjectType.DynamicObject)) 125 | _objects.Add(guid, new WoWDynamicObject(pointer)); 126 | else 127 | _objects.Add(guid, obj); 128 | } 129 | return 1; 130 | } 131 | } 132 | 133 | } -------------------------------------------------------------------------------- /TeleportBook/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /TeleportBook/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /cleanCore/Teleporter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using WhiteMagic.Internals; 4 | 5 | namespace cleanCore 6 | { 7 | 8 | public static class Teleporter 9 | { 10 | private const int StepTimeWait = 25; /*ms*/ 11 | 12 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 13 | private delegate uint SendMovementPacketDelegate( 14 | IntPtr instance, uint timestamp, uint opcode, uint zero, uint zero2, uint zero3, uint zero4, uint ff); 15 | private static SendMovementPacketDelegate _sendMovementPacket; 16 | 17 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 18 | private delegate void SendSplineMoveDone(IntPtr instance, uint timestamp, uint unknown); 19 | private static SendSplineMoveDone _sendSplineMoveDone; 20 | 21 | private static Detour _sendSplineMoveDoneDetour; 22 | private static Detour _sendMovementPacketDetour; 23 | private static uint _timeAdvance; 24 | private static DateTime _lastFrame; 25 | private static bool _firstTeleport = true; 26 | public static Location? Destination { get; private set; } 27 | 28 | public static void Initialize() 29 | { 30 | _sendMovementPacket = Helper.Magic.RegisterDelegate(Offsets.Teleport.SendMovementPacket); 31 | _sendSplineMoveDone = Helper.Magic.RegisterDelegate(Offsets.Teleport.SendMoveSplineDone); 32 | _sendSplineMoveDoneDetour = Helper.Magic.Detours.Create(_sendSplineMoveDone, 33 | new SendSplineMoveDone(HandleSendSplineMoveDone), 34 | "TeleporterSendSplineMoveDone"); 35 | _sendMovementPacketDetour = Helper.Magic.Detours.Create(_sendMovementPacket, 36 | new SendMovementPacketDelegate( 37 | HandleSendMovementPacket), 38 | "TeleporterSendMovementPacket"); 39 | } 40 | 41 | private static void HandleSendSplineMoveDone(IntPtr instance, uint timestamp, uint unknown) 42 | { 43 | _sendSplineMoveDoneDetour.CallOriginal(new object[] { instance, timestamp + _timeAdvance, unknown }); 44 | } 45 | 46 | private static uint HandleSendMovementPacket(IntPtr instance, uint timestamp, uint opcode, uint zero, uint zero2, uint zero3, uint zero4, uint ff) 47 | { 48 | var result = (uint) 49 | _sendMovementPacketDetour.CallOriginal(new object[] 50 | { 51 | instance, timestamp + _timeAdvance, opcode, 52 | zero, zero2, 53 | zero3, zero4, ff 54 | }); 55 | if (instance == Manager.LocalPlayer.Pointer) 56 | Manager.SetHeartbeatTime(timestamp + 500); 57 | 58 | return result; 59 | } 60 | 61 | public static void ClearDestination() 62 | { 63 | Destination = null; 64 | } 65 | 66 | public static void SetDestination(Location dest) 67 | { 68 | if (_firstTeleport) 69 | { 70 | _sendMovementPacketDetour.Apply(); 71 | _sendSplineMoveDoneDetour.Apply(); 72 | _firstTeleport = false; 73 | } 74 | _lastFrame = DateTime.Now - TimeSpan.FromMilliseconds(StepTimeWait); 75 | Destination = dest; 76 | } 77 | 78 | public static bool Pulse() 79 | { 80 | if (Destination == null) 81 | return false; 82 | 83 | if (Manager.LocalPlayer == null) 84 | return false; 85 | 86 | if ((_lastFrame + TimeSpan.FromMilliseconds(StepTimeWait)) > DateTime.Now) 87 | return true; 88 | 89 | _lastFrame = DateTime.Now; 90 | 91 | if (TeleportStep(Destination.Value)) 92 | { 93 | ClearDestination(); 94 | return true; 95 | } 96 | 97 | return false; 98 | } 99 | 100 | private static void AdvanceTime(uint amount) 101 | { 102 | _timeAdvance += amount; 103 | } 104 | 105 | private static void SendMovementPacket(uint timestamp, uint opcode, uint hidden) 106 | { 107 | if (Manager.LocalPlayer != null) 108 | { 109 | _sendMovementPacket(Manager.LocalPlayer.Pointer, timestamp, opcode, hidden, 0, 0, 0, 0xFF); 110 | } 111 | } 112 | 113 | private static float CalculateMaxMovement(uint ms, float limit) 114 | { 115 | return limit / 500 * ms; 116 | } 117 | 118 | private static bool TeleportStep(Location dest) 119 | { 120 | var local = Manager.LocalPlayer.Location; 121 | var direction = new Location(dest.X - local.X, dest.Y - local.Y, dest.Z - local.Z); 122 | 123 | var distance = direction.Length; 124 | if (distance > 3.2f) 125 | { 126 | var normal = direction.Normalize(); 127 | var scalar = CalculateMaxMovement(450, 3.2f); 128 | direction = new Location(normal.X * scalar, normal.Y * scalar, normal.Z * scalar); 129 | } 130 | else if (distance < 0.5f) 131 | return true; 132 | 133 | MovePlayer(direction.X, direction.Y, direction.Z); 134 | return false; 135 | } 136 | 137 | private static void MovePlayer(float x, float y, float z) 138 | { 139 | if (Manager.LocalPlayer == null) 140 | return; 141 | 142 | uint lastTime = Helper.PerformanceCount; 143 | SendMovementPacket(lastTime, Offsets.Teleport.OpcodeStart, 0); 144 | 145 | var local = Manager.LocalPlayer.Location; 146 | local.X += x; 147 | local.Y += y; 148 | local.Z += z; 149 | Manager.LocalPlayer.SetLocation(local); 150 | 151 | AdvanceTime(450); 152 | SendMovementPacket(lastTime, Offsets.Teleport.OpcodeStop, 0); 153 | } 154 | } 155 | } -------------------------------------------------------------------------------- /cleanCore/WoWObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | public class WoWObject 8 | { 9 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 10 | private delegate IntPtr GetObjectNameDelegate(IntPtr thisPointer); 11 | private readonly GetObjectNameDelegate _getObjectName; 12 | 13 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 14 | private delegate void GetObjectLocationDelegate(IntPtr thisPointer, out Location loc); 15 | private readonly GetObjectLocationDelegate _getObjectLocation; 16 | 17 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 18 | private delegate void InteractDelegate(IntPtr thisPointer); 19 | private readonly InteractDelegate _interact; 20 | 21 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 22 | private delegate IntPtr GetBagDelegate(IntPtr thisObj); 23 | private readonly GetBagDelegate _getBag; 24 | 25 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 26 | private delegate void SelectObjectDelegate(ulong guid); 27 | private static SelectObjectDelegate _selectObject; 28 | 29 | public IntPtr Pointer { get; set; } 30 | 31 | public static void Initialize() 32 | { 33 | _selectObject = Helper.Magic.RegisterDelegate(Offsets.SelectObject); 34 | } 35 | 36 | public WoWObject(IntPtr pointer) 37 | { 38 | Pointer = pointer; 39 | 40 | if (IsValid) 41 | { 42 | _getBag = RegisterVirtualFunction(Offsets.GetBag); 43 | _getObjectName = RegisterVirtualFunction(Offsets.GetObjectName); 44 | _getObjectLocation = RegisterVirtualFunction(Offsets.GetObjectLocation); 45 | _interact = RegisterVirtualFunction(Offsets.Interact); 46 | } 47 | } 48 | 49 | protected T RegisterVirtualFunction(uint offset) where T : class 50 | { 51 | var pointer = Helper.Magic.GetObjectVtableFunction(Pointer, offset / 4); 52 | if (pointer == IntPtr.Zero) 53 | return null; 54 | return Helper.Magic.RegisterDelegate(pointer); 55 | } 56 | 57 | public WoWBag GetBag() 58 | { 59 | var ptr = _getBag(Pointer); 60 | if (ptr == IntPtr.Zero) 61 | return null; 62 | return new WoWBag(ptr); 63 | } 64 | 65 | public void Select() 66 | { 67 | _selectObject(Guid); 68 | } 69 | 70 | public void Interact() 71 | { 72 | _interact(Pointer); 73 | } 74 | 75 | public string Name 76 | { 77 | get 78 | { 79 | var pointer = _getObjectName(Pointer); 80 | if (pointer == IntPtr.Zero) 81 | return "UNKNOWN"; 82 | return Marshal.PtrToStringAnsi(pointer); 83 | } 84 | } 85 | 86 | public Location Location 87 | { 88 | get 89 | { 90 | Location ret; 91 | _getObjectLocation(Pointer, out ret); 92 | return ret; 93 | } 94 | } 95 | 96 | public bool InLoS 97 | { 98 | get { return WoWWorld.LineOfSightTest(Location, Manager.LocalPlayer.Location) == TracelineResult.NoCollision; } 99 | } 100 | 101 | public bool IsValid 102 | { 103 | get 104 | { 105 | return Pointer != IntPtr.Zero; 106 | } 107 | } 108 | 109 | public WoWObjectType Type 110 | { 111 | get 112 | { 113 | return (WoWObjectType)GetDescriptor((int)ObjectField.OBJECT_FIELD_TYPE); 114 | } 115 | } 116 | 117 | public ulong Guid 118 | { 119 | get 120 | { 121 | return GetDescriptor((int) ObjectField.OBJECT_FIELD_GUID); 122 | } 123 | } 124 | 125 | public ulong GuildId 126 | { 127 | get 128 | { 129 | return GetDescriptor((int) ObjectField.OBJECT_FIELD_DATA); 130 | } 131 | } 132 | 133 | public uint Data 134 | { 135 | get 136 | { 137 | return GetDescriptor((int) ObjectField.OBJECT_FIELD_ENTRY); 138 | } 139 | } 140 | 141 | public float Distance 142 | { 143 | get 144 | { 145 | var local = Manager.LocalPlayer; 146 | if (local == null || !local.IsValid) 147 | return float.NaN; 148 | return (float)local.Location.DistanceTo(Location); 149 | } 150 | } 151 | 152 | protected unsafe T GetDescriptor(int offset) 153 | 154 | { 155 | uint descriptorArray = *(uint*) (Pointer + Offsets.DescriptorOffset); 156 | int size = Marshal.SizeOf(typeof (T)); 157 | object ret = null; 158 | switch (size) 159 | { 160 | case 1: 161 | ret = *(byte*) (descriptorArray + offset); 162 | break; 163 | 164 | case 2: 165 | ret = *(short*) (descriptorArray + offset); 166 | break; 167 | 168 | case 4: 169 | ret = *(uint*) (descriptorArray + offset); 170 | break; 171 | 172 | case 8: 173 | ret = *(ulong*) (descriptorArray + offset); 174 | break; 175 | } 176 | return (T) ret; 177 | } 178 | 179 | public bool IsContainer { get { return Type.HasFlag(WoWObjectType.Container); } } 180 | public bool IsCorpse { get { return Type.HasFlag(WoWObjectType.Corpse); } } 181 | public bool IsGameObject { get { return Type.HasFlag(WoWObjectType.GameObject); } } 182 | public bool IsDynamicObject { get { return Type.HasFlag(WoWObjectType.DynamicObject); } } 183 | public bool IsUnit { get { return Type.HasFlag(WoWObjectType.Unit); } } 184 | public bool IsPlayer { get { return Type.HasFlag(WoWObjectType.Player); } } 185 | public bool IsItem { get { return Type.HasFlag(WoWObjectType.Item); } } 186 | 187 | public override string ToString() 188 | { 189 | return "[\"" + Name + "\", Distance = " + (int) Distance + ", Type = " + Type + "]"; 190 | } 191 | } 192 | 193 | } -------------------------------------------------------------------------------- /cleanCore/WoWUnit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace cleanCore 5 | { 6 | 7 | public class WoWUnit : WoWObject 8 | { 9 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 10 | private delegate bool HasAuraDelegate(IntPtr thisObj, int spellId); 11 | private static HasAuraDelegate _hasAura; 12 | 13 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 14 | private delegate int UnitReactionDelegate(IntPtr thisObj, IntPtr unitToCompare); 15 | private static UnitReactionDelegate _unitReaction; 16 | 17 | public WoWUnit(IntPtr pointer) 18 | : base(pointer) 19 | { 20 | 21 | } 22 | 23 | public UnitReaction Reaction 24 | { 25 | get 26 | { 27 | if (_unitReaction == null) 28 | _unitReaction = Helper.Magic.RegisterDelegate(Offsets.UnitReaction); 29 | return (UnitReaction) _unitReaction(Pointer, Manager.LocalPlayer.Pointer); 30 | } 31 | } 32 | 33 | public bool IsFriendly 34 | { 35 | get { return (int) Reaction > (int) UnitReaction.Neutral; } 36 | } 37 | 38 | public bool IsNeutral 39 | { 40 | get { return Reaction == UnitReaction.Neutral; } 41 | } 42 | 43 | public bool IsHostile 44 | { 45 | get { return (int) Reaction < (int) UnitReaction.Neutral; } 46 | } 47 | 48 | public bool HasAura(int spellId) 49 | { 50 | if (_hasAura == null) 51 | _hasAura = Helper.Magic.RegisterDelegate(Offsets.HasAuraBySpellId); 52 | return _hasAura(Pointer, spellId); 53 | } 54 | 55 | private unsafe uint MovementData 56 | { 57 | get 58 | { 59 | return *(uint*)((uint)Pointer + Offsets.Teleport.UnitMovementData); 60 | } 61 | } 62 | 63 | public void SetLocation(Location newLoc) 64 | { 65 | var loc = new Location { X = newLoc.X, Y = newLoc.Y, Z = newLoc.Z }; 66 | Helper.Magic.WriteStruct(new IntPtr(MovementData + Offsets.Teleport.MovementDataPosition), loc); 67 | } 68 | 69 | public ulong TargetGuid 70 | { 71 | get 72 | { 73 | return GetDescriptor((int) UnitField.UNIT_FIELD_TARGET); 74 | } 75 | } 76 | 77 | public WoWObject Target 78 | { 79 | get 80 | { 81 | return Manager.GetObjectByGuid(TargetGuid); 82 | } 83 | } 84 | 85 | public bool IsDead 86 | { 87 | get { return Health <= 0; } 88 | } 89 | 90 | public WoWRace Race 91 | { 92 | get { return (WoWRace) GetDescriptor((int) UnitField.UNIT_FIELD_BYTES_0); } 93 | } 94 | 95 | public WoWClass Class 96 | { 97 | get { return (WoWClass)GetDescriptor((int) UnitField.UNIT_FIELD_BYTES_0 + 1); } 98 | } 99 | 100 | public bool IsLootable 101 | { 102 | get { return (DynamicFlags & 1) != 0; } 103 | } 104 | 105 | public bool IsTapped 106 | { 107 | get { return (DynamicFlags & 4) != 0; } 108 | } 109 | 110 | public bool IsTappedByMe 111 | { 112 | get { return (DynamicFlags & 8) != 0; } 113 | } 114 | 115 | public uint Health 116 | { 117 | get 118 | { 119 | return GetDescriptor((int) UnitField.UNIT_FIELD_HEALTH); 120 | } 121 | } 122 | 123 | public uint MaxHealth 124 | { 125 | get 126 | { 127 | return GetDescriptor((int) UnitField.UNIT_FIELD_MAXHEALTH); 128 | } 129 | } 130 | 131 | public double HealthPercentage 132 | { 133 | get 134 | { 135 | return (Health/(double) MaxHealth)*100; 136 | } 137 | } 138 | 139 | public uint Level 140 | { 141 | get 142 | { 143 | return GetDescriptor((int) UnitField.UNIT_FIELD_LEVEL); 144 | } 145 | } 146 | 147 | public uint Flags 148 | { 149 | get 150 | { 151 | return GetDescriptor((int) UnitField.UNIT_FIELD_FLAGS); 152 | } 153 | } 154 | 155 | public uint Flags2 156 | { 157 | get 158 | { 159 | return GetDescriptor((int) UnitField.UNIT_FIELD_FLAGS_2); 160 | } 161 | } 162 | 163 | public uint NpcFlags 164 | { 165 | get 166 | { 167 | return GetDescriptor((int) UnitField.UNIT_NPC_FLAGS); 168 | } 169 | } 170 | 171 | public uint DynamicFlags 172 | { 173 | get 174 | { 175 | return GetDescriptor((int) UnitField.UNIT_DYNAMIC_FLAGS); 176 | } 177 | } 178 | 179 | public uint Faction 180 | { 181 | get 182 | { 183 | return GetDescriptor((int) UnitField.UNIT_FIELD_FACTIONTEMPLATE); 184 | } 185 | } 186 | 187 | public uint BaseAttackTime 188 | { 189 | get 190 | { 191 | return GetDescriptor((int) UnitField.UNIT_FIELD_BASEATTACKTIME); 192 | } 193 | } 194 | 195 | public uint RangedAttackTime 196 | { 197 | get 198 | { 199 | return GetDescriptor((int) UnitField.UNIT_FIELD_RANGEDATTACKTIME); 200 | } 201 | } 202 | 203 | public float BoundingRadius 204 | { 205 | get 206 | { 207 | return GetDescriptor((int) UnitField.UNIT_FIELD_BOUNDINGRADIUS); 208 | } 209 | } 210 | 211 | public float CombatReach 212 | { 213 | get 214 | { 215 | return GetDescriptor((int) UnitField.UNIT_FIELD_COMBATREACH); 216 | } 217 | } 218 | 219 | public uint DisplayId 220 | { 221 | get 222 | { 223 | return GetDescriptor((int) UnitField.UNIT_FIELD_DISPLAYID); 224 | } 225 | } 226 | 227 | public uint MountDisplayId 228 | { 229 | get 230 | { 231 | return GetDescriptor((int) UnitField.UNIT_FIELD_MOUNTDISPLAYID); 232 | } 233 | } 234 | 235 | public uint NativeDisplayId 236 | { 237 | get 238 | { 239 | return GetDescriptor((int) UnitField.UNIT_FIELD_NATIVEDISPLAYID); 240 | } 241 | } 242 | 243 | public uint MinDamage 244 | { 245 | get 246 | { 247 | return GetDescriptor((int) UnitField.UNIT_FIELD_MINDAMAGE); 248 | } 249 | } 250 | 251 | public uint MaxDamage 252 | { 253 | get 254 | { 255 | return GetDescriptor((int) UnitField.UNIT_FIELD_MAXDAMAGE); 256 | } 257 | } 258 | 259 | public uint MinOffhandDamage 260 | { 261 | get 262 | { 263 | return GetDescriptor((int) UnitField.UNIT_FIELD_MINOFFHANDDAMAGE); 264 | } 265 | } 266 | 267 | public uint MaxOffhandDamage 268 | { 269 | get 270 | { 271 | return GetDescriptor((int) UnitField.UNIT_FIELD_MAXOFFHANDDAMAGE); 272 | } 273 | } 274 | 275 | public uint PetExperience 276 | { 277 | get 278 | { 279 | return GetDescriptor((int) UnitField.UNIT_FIELD_PETEXPERIENCE); 280 | } 281 | } 282 | 283 | public uint PetNextLevelExperience 284 | { 285 | get 286 | { 287 | return GetDescriptor((int) UnitField.UNIT_FIELD_PETNEXTLEVELEXP); 288 | } 289 | } 290 | 291 | public uint BaseMana 292 | { 293 | get 294 | { 295 | return GetDescriptor((int) UnitField.UNIT_FIELD_BASE_MANA); 296 | } 297 | } 298 | 299 | public uint BaseHealth 300 | { 301 | get 302 | { 303 | return GetDescriptor((int) UnitField.UNIT_FIELD_BASE_HEALTH); 304 | } 305 | } 306 | 307 | public uint AttackPower 308 | { 309 | get 310 | { 311 | return GetDescriptor((int) UnitField.UNIT_FIELD_ATTACK_POWER); 312 | } 313 | } 314 | 315 | public uint RangedAttackPower 316 | { 317 | get 318 | { 319 | return GetDescriptor((int) UnitField.UNIT_FIELD_RANGED_ATTACK_POWER); 320 | } 321 | } 322 | 323 | public uint MinRangedDamage 324 | { 325 | get 326 | { 327 | return GetDescriptor((int) UnitField.UNIT_FIELD_MINRANGEDDAMAGE); 328 | } 329 | } 330 | 331 | public uint MaxRangedDamage 332 | { 333 | get 334 | { 335 | return GetDescriptor((int) UnitField.UNIT_FIELD_MAXRANGEDDAMAGE); 336 | } 337 | } 338 | 339 | public uint MaxItemLevel 340 | { 341 | get 342 | { 343 | return GetDescriptor((int) UnitField.UNIT_FIELD_MAXITEMLEVEL); 344 | } 345 | } 346 | 347 | public uint Mana 348 | { 349 | get 350 | { 351 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER1); 352 | } 353 | } 354 | 355 | public uint Rage 356 | { 357 | get 358 | { 359 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER2); 360 | } 361 | } 362 | 363 | public uint Focus 364 | { 365 | get 366 | { 367 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER3); 368 | } 369 | } 370 | 371 | public uint Happiness 372 | { 373 | get 374 | { 375 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER4); 376 | } 377 | } 378 | 379 | public uint Runes 380 | { 381 | get 382 | { 383 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER5); 384 | } 385 | } 386 | 387 | public uint RunicPower 388 | { 389 | get 390 | { 391 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER6); 392 | } 393 | } 394 | 395 | public uint SoulShards 396 | { 397 | get 398 | { 399 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER7); 400 | } 401 | } 402 | 403 | public uint Eclipse 404 | { 405 | get 406 | { 407 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER8); 408 | } 409 | } 410 | 411 | public uint HolyPower 412 | { 413 | get 414 | { 415 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER9); 416 | } 417 | } 418 | 419 | public uint Alternate 420 | { 421 | get 422 | { 423 | return GetDescriptor((int) UnitField.UNIT_FIELD_POWER10); 424 | } 425 | } 426 | 427 | public uint MaxMana 428 | { 429 | get 430 | { 431 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER1); 432 | } 433 | } 434 | 435 | public uint MaxRage 436 | { 437 | get 438 | { 439 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER2); 440 | } 441 | } 442 | 443 | public uint MaxFocus 444 | { 445 | get 446 | { 447 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER3); 448 | } 449 | } 450 | 451 | public uint MaxHappiness 452 | { 453 | get 454 | { 455 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER4); 456 | } 457 | } 458 | 459 | public uint MaxRunes 460 | { 461 | get 462 | { 463 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER5); 464 | } 465 | } 466 | 467 | public uint MaxRunicPower 468 | { 469 | get 470 | { 471 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER6); 472 | } 473 | } 474 | 475 | public uint MaxSoulShards 476 | { 477 | get 478 | { 479 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER7); 480 | } 481 | } 482 | 483 | public uint MaxEclipse 484 | { 485 | get 486 | { 487 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER8); 488 | } 489 | } 490 | 491 | public uint MaxHolyPower 492 | { 493 | get 494 | { 495 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER9); 496 | } 497 | } 498 | 499 | public uint MaxAlternate 500 | { 501 | get 502 | { 503 | return GetDescriptor((int)UnitField.UNIT_FIELD_MAXPOWER10); 504 | } 505 | } 506 | 507 | public override string ToString() 508 | { 509 | return "[\"" + Name + "\", Distance = " + (int)Distance + ", Type = " + Type + ", React = " + Reaction + "]"; 510 | } 511 | } 512 | 513 | } -------------------------------------------------------------------------------- /Externals/WhiteMagic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WhiteMagic 5 | 6 | 7 | 8 | 9 | A manager class to handle memory patches. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Applies all the IMemoryOperations contained in this manager via their Apply() method. 26 | 27 | 28 | 29 | 30 | Removes all the IMemoryOperations contained in this manager via their Remove() method. 31 | 32 | 33 | 34 | 35 | Deletes all the IMemoryOperations contained in this manager. 36 | 37 | 38 | 39 | 40 | Deletes a specific IMemoryOperation contained in this manager, by name. 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Retrieves an IMemoryOperation by name. 52 | 53 | The name given to the IMemoryOperation 54 | 55 | 56 | 57 | 58 | Creates a new at the specified address. 59 | 60 | The address to begin the patch. 61 | The bytes to be written as the patch. 62 | The name of the patch. 63 | A patch object that exposes the required methods to apply and remove the patch. 64 | 65 | 66 | 67 | Creates a new at the specified address, and applies it. 68 | 69 | The address to begin the patch. 70 | The bytes to be written as the patch. 71 | The name of the patch. 72 | A patch object that exposes the required methods to apply and remove the patch. 73 | 74 | 75 | 76 | Contains methods, and information for a memory patch. 77 | 78 | 79 | 80 | 81 | Represents an operation in memory, be it a patch, detour, or anything else. 82 | 83 | 84 | 85 | 86 | Removes this IMemoryOperation from memory. (Reverts the bytes back to their originals.) 87 | 88 | 89 | 90 | 91 | 92 | Applies this IMemoryOperation to memory. (Writes new bytes to memory) 93 | 94 | 95 | 96 | 97 | 98 | Returns true if this IMemoryOperation is currently applied. 99 | 100 | 101 | 102 | 103 | Returns the name for this IMemoryOperation. 104 | 105 | 106 | 107 | 108 | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 109 | 110 | 2 111 | 112 | 113 | 114 | Removes this Patch from memory. (Reverts the bytes back to their originals.) 115 | 116 | 117 | 118 | 119 | 120 | Applies this Patch to memory. (Writes new bytes to memory) 121 | 122 | 123 | 124 | 125 | 126 | Allows an to attempt to free resources and perform other cleanup operations before the is reclaimed by garbage collection. 127 | 128 | 129 | 130 | 131 | Returns true if this Patch is currently applied. 132 | 133 | 134 | 135 | 136 | Returns the name for this Patch. 137 | 138 | 139 | 140 | 141 | A manager class to handle function detours, and hooks. 142 | 143 | 144 | 145 | 146 | Creates a new Detour. 147 | 148 | The original function to detour. (This delegate should already be registered via Magic.RegisterDelegate) 149 | The new function to be called. (This delegate should NOT be registered!) 150 | The name of the detour. 151 | A object containing the required methods to apply, remove, and call the original function. 152 | 153 | 154 | 155 | Creates and applies new Detour. 156 | 157 | The original function to detour. (This delegate should already be registered via Magic.RegisterDelegate) 158 | The new function to be called. (This delegate should NOT be registered!) 159 | The name of the detour. 160 | A object containing the required methods to apply, remove, and call the original function. 161 | 162 | 163 | 164 | Contains methods, and information for a detour, or hook. 165 | 166 | 167 | 168 | 169 | This var is not used within the detour itself. It is only here 170 | to keep a reference, to avoid the GC from collecting the delegate instance! 171 | 172 | 173 | 174 | 175 | Applies this Detour to memory. (Writes new bytes to memory) 176 | 177 | 178 | 179 | 180 | 181 | Removes this Detour from memory. (Reverts the bytes back to their originals.) 182 | 183 | 184 | 185 | 186 | 187 | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 188 | 189 | 2 190 | 191 | 192 | 193 | Calls the original function, and returns a return value. 194 | 195 | The arguments to pass. If it is a 'void' argument list, 196 | you MUST pass 'null'. 197 | An object containing the original functions return value. 198 | 199 | 200 | 201 | Allows an to attempt to free resources and perform other cleanup operations before the is reclaimed by garbage collection. 202 | 203 | 204 | 205 | 206 | Returns true if this Detour is currently applied. 207 | 208 | 209 | 210 | 211 | Returns the name for this Detour. 212 | 213 | 214 | 215 | 216 | A class to extract PE header information from modules or PE files. 217 | 218 | 219 | 220 | 221 | The handle, or base address, to the current PE file. 222 | 223 | 224 | 225 | 226 | Creates a new instance of the PeHeaderParser class, using the specified path to a PE file. 227 | 228 | 229 | 230 | 231 | 232 | Creates a new instance of the PeHeaderParser class, using the handle or base address, to the specified module. 233 | 234 | 235 | 236 | 237 | 238 | Retrieves the IMAGE_DOS_HEADER for this PE file. 239 | 240 | 241 | 242 | 243 | Retrieves the IMAGE_NT_HEADER for this PE file. (This includes and nested structs, etc) 244 | 245 | 246 | 247 | 248 | Contains constants ripped from WinNT.h 249 | 250 | 251 | 252 | 253 | A simplistic Win32 API wrapper class. 254 | 255 | 256 | 257 | 258 | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 259 | 260 | 2 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | Credits to Dominik, Patrick, Bobbysing, and whoever else I forgot, for most of the ripped code here! 281 | 282 | 283 | 284 | 285 | Loads a pattern file. 286 | 287 | The full path to the file to be loaded. (XML files only!) 288 | The start address to begin scanning from. 289 | The length of data to scan. 290 | 291 | 292 | 293 | Loads an XML pattern file, and scans a specific module. 294 | 295 | The full path to the file to be loaded. (XML files only!) 296 | The base address, or handle, to a module to scan. (Length/start will be calculated automatically) 297 | 298 | 299 | 300 | Loads an XML pattern file, and scans the entry assembly. (The first module in the modules list) 301 | 302 | The full path to the file to be loaded. (XML files only!) 303 | 304 | 305 | 306 | Retrieves an address from the found patterns stash. 307 | 308 | The name of the pattern, as per the XML file provided in the constructor of this class instance. 309 | 310 | 311 | 312 | 313 | An exception that is thrown when a struct, class, or delegate is missing proper attributes. 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | The main memory library class. Just instantiate this class, and everything else you need is contained within. 342 | Alternatively, you can use the Magic.Instance property, to grab a static instance of this class (singleton) 343 | 344 | I highly suggest tracking your own instances for fairly obvious reasons. 345 | 346 | 347 | 348 | 349 | Creates a new instance of the class. 350 | 351 | 352 | 353 | 354 | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 355 | 356 | 2 357 | 358 | 359 | 360 | Reads a specific number of bytes from memory. 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | Reads a specific number of bytes from memory. 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | Reads a "T" from memory, using consecutive reading. 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | Reads a "T" from memory, using consecutive reading. 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | Reads a struct from memory. The struct must be attributed properly! 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | Writes a set of bytes to memory. 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | Writes a set of bytes to memory. 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | Writes a generic datatype to memory. (Note; only base datatypes are supported [int,float,uint,byte,sbyte,double,etc]) 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | Writes a generic datatype to memory. (Note; only base datatypes are supported [int,float,uint,byte,sbyte,double,etc]) 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | Writes a struct to memory. 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | Writes a struct to memory. 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | Retrieves a function pointer, to an objects virtual function table. 453 | 454 | The pointer to the object. 455 | The nth function to retrieve. 456 | 457 | 458 | 459 | 460 | Registers a function into a delegate. Note: The delegate must provide a proper function signature! 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | Registers a function into a delegate. Note: The delegate must provide a proper function signature! 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | Win32 LoadLibrary 477 | 478 | 479 | 480 | 481 | 482 | 483 | Win32 FreeLibrary 484 | 485 | 486 | 487 | 488 | 489 | 490 | Win32 GetProcAddress 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | Loads a library, and gets a procedure address. 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | Retrieves a static instance of the class. (A singleton) 507 | 508 | 509 | 510 | 511 | Provides access to the DetourManager class, that allows you to create and remove 512 | detours and hooks for functions. (Or any other use you may find...) 513 | 514 | 515 | 516 | 517 | Provides access to the PatchManager class, which allows you to apply and remove patches. 518 | 519 | 520 | 521 | 522 | Provides access to the PatternsManager class, which allows you to load, and search for patterns in memory. 523 | 524 | 525 | 526 | 527 | -------------------------------------------------------------------------------- /cleanCore/Offsets.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using cleanCore.D3D; 5 | using cleanPattern; 6 | 7 | namespace cleanCore 8 | { 9 | 10 | public static class Offsets 11 | { 12 | public static event EventHandler OnOffsetsLoaded; 13 | 14 | public static int DescriptorOffset = 0x8; 15 | 16 | public static uint EnumVisibleObjects; 17 | public static uint GetObjectByGuid; 18 | public static uint GetLocalPlayerGuid; 19 | public static uint GetObjectName; 20 | public static uint IsLoading; 21 | public static uint GetObjectLocation; 22 | public static uint ClickToMove; 23 | public static uint PerformanceCounter; 24 | public static uint SelectObject; 25 | public static uint SetFacing; 26 | public static uint IsClickMoving; 27 | public static uint HasAuraBySpellId; 28 | public static uint CastSpell; 29 | public static uint Interact; 30 | public static uint UseItem; 31 | public static uint GetBag; 32 | public static uint StopCTM; 33 | public static uint Traceline; 34 | public static uint UnitReaction; 35 | 36 | public static uint EventVictim; 37 | public static uint LuaSetTop; 38 | public static uint LuaGetTop; 39 | public static uint LuaState; 40 | public static uint LuaLoadBuffer; 41 | public static uint LuaPCall; 42 | public static uint LuaType; 43 | public static uint LuaToNumber; 44 | public static uint LuaToLString; 45 | public static uint LuaToBoolean; 46 | 47 | public static uint PartyArray; 48 | public static uint CorpsePosition; 49 | public static uint LastHardwareAction; 50 | 51 | public static uint CurrentMapId; 52 | 53 | public static class AuctionHouse 54 | { 55 | public static uint ListBase; 56 | public static uint ListCount; 57 | public static uint OwnerBase; 58 | public static uint OwnerCount; 59 | public static uint BidderBase; 60 | public static uint BidderCount; 61 | public static uint AuctionSize; 62 | public static uint ExpireOffset; 63 | } 64 | 65 | public static class Teleport 66 | { 67 | public static uint OpcodeStart; 68 | public static uint OpcodeStop; 69 | public static uint SendMovementPacket; 70 | public static uint SendMoveSplineDone; 71 | public static uint UnitMovementData; 72 | public static uint MovementDataPosition; 73 | public static uint Singleton; 74 | public static uint CurMgrOffset; 75 | public static uint CurMgrGlobalMovement; 76 | public static uint GlobalMovementHeartbeat; 77 | } 78 | 79 | public static void Initialize() 80 | { 81 | var path = Assembly.GetExecutingAssembly().Location; 82 | path = path.Substring(0, path.LastIndexOf('\\') + 1); 83 | 84 | using (var log = new StreamWriter(path + "Offsets.log")) 85 | { 86 | 87 | { 88 | var p = Pattern.FromTextstyle("EnumVisibleObjects", 89 | "55 8b ec a1 ?? ?? ?? ?? 64 8b 0d ?? ?? ?? ?? 53 56 57 8b 3c 81 8b 87 ?? ?? ?? ?? 05 ?? ?? ?? ?? 8b 40 ?? a8 ??"); 90 | EnumVisibleObjects = p.Find(); 91 | log.WriteLine("EnumVisibleObjects: 0x" + EnumVisibleObjects.ToString("X")); 92 | } 93 | 94 | { 95 | var p = Pattern.FromTextstyle("GetObjectByGuid", 96 | "55 8b ec 64 8b 0d ?? ?? ?? ?? a1 ?? ?? ?? ?? 8b 14 81 8b 8a ?? ?? ?? ?? 83 ec ?? 85 c9 74 ?? 8b 45 ?? 8b 55 ?? 56 8b f0"); 97 | GetObjectByGuid = p.Find(); 98 | log.WriteLine("GetObjectByGuid: 0x" + GetObjectByGuid.ToString("X")); 99 | } 100 | 101 | { 102 | var p = Pattern.FromTextstyle("GetLocalPlayerGuid", 103 | "64 8b 0d ?? ?? ?? ?? a1 ?? ?? ?? ?? 8b 14 81 8b 8a ?? ?? ?? ?? 85 c9 75 ?? 33 c0 33 d2 c3 8b 81 ?? ?? ?? ?? 8b 91 ?? ?? ?? ?? c3"); 104 | GetLocalPlayerGuid = p.Find(); 105 | log.WriteLine("GetLocalPlayerGuid: 0x" + GetLocalPlayerGuid.ToString("X")); 106 | } 107 | 108 | { 109 | var p = Pattern.FromTextstyle("GetObjectName", 110 | "dd 5c 24 ?? d9 45 ?? dd 5c 24 ?? d9 45 ?? dd 1c 24 50 8b 06 8b 90 ?? ?? ?? ?? 51 8b ce ff d2 50 8b 45 ?? 50"); 111 | p.Modifiers.Add(new AddModifier(22)); 112 | p.Modifiers.Add(new LeaModifier()); 113 | GetObjectName = p.Find(); 114 | log.WriteLine("GetObjectName: 0x" + GetObjectName.ToString("X")); 115 | } 116 | 117 | { 118 | var p = Pattern.FromTextstyle("IsLoading", 119 | "52 8d 85 ?? ?? ?? ?? 50 e8 ?? ?? ?? ?? 83 c4 ?? 85 c0 8d 4d ?? a3 ?? ?? ?? ?? 0f 95 c3"); 120 | p.Modifiers.Add(new AddModifier(22)); 121 | p.Modifiers.Add(new LeaModifier()); 122 | IsLoading = p.Find(); 123 | log.WriteLine("IsLoading: 0x" + IsLoading.ToString("X")); 124 | } 125 | 126 | { 127 | var p = Pattern.FromTextstyle("GetObjectLocation", 128 | "85 c0 0f 84 ?? ?? ?? ?? 8b 06 8b 50 ?? 8d 4d ?? 51 8b ce ff d2 d9 45 ?? 8b 46 ??"); 129 | p.Modifiers.Add(new AddModifier(12)); 130 | p.Modifiers.Add(new LeaModifier(LeaType.Byte)); 131 | GetObjectLocation = p.Find(); 132 | log.WriteLine("GetObjectLocation: 0x" + GetObjectLocation.ToString("X")); 133 | } 134 | 135 | { 136 | var p = Pattern.FromTextstyle("LuaState", 137 | "8b 35 ?? ?? ?? ?? 57 8b f9 8b 47 ?? 85 c0 7e ?? 83 c0 ?? 89 47 ?? 75 ?? 8b 47 ?? 50 68 ?? ?? ?? ?? 56 e8 ?? ?? ?? ?? d9 ee 83 c4"); 138 | p.Modifiers.Add(new AddModifier(2)); 139 | p.Modifiers.Add(new LeaModifier()); 140 | LuaState = p.Find(); 141 | log.WriteLine("LuaState: 0x" + LuaState.ToString("X")); 142 | } 143 | 144 | { 145 | var p = Pattern.FromTextstyle("FrameScript_GetTop", 146 | "55 8b ec 8b 4d ?? 8b 41 ?? 2b 41 ?? c1 f8 ?? 5d c3"); 147 | LuaGetTop = p.Find(); 148 | log.WriteLine("LuaGetTop: 0x" + LuaGetTop.ToString("X")); 149 | } 150 | 151 | { 152 | var p = Pattern.FromTextstyle("FrameScript_LoadBuffer", 153 | "55 8b ec 8b 4d ?? 8b 45 ?? 83 ec ?? 83 f9 ?? 72 ?? 80 38 ?? 75 ?? 80 78 ?? ?? 75 ?? 80 78 ?? ?? 75 ?? 83 c0 ?? 83 e9"); 154 | LuaLoadBuffer = p.Find(); 155 | log.WriteLine("LuaLoadBuffer: 0x" + LuaLoadBuffer.ToString("X")); 156 | } 157 | 158 | { 159 | var p = Pattern.FromTextstyle("FrameScript_PCall", 160 | "55 8b ec 8b 45 ?? 83 ec ?? 56 8b 75 ?? 85 c0 75 ?? 33 c9 eb ?? 8b ce e8 ?? ?? ?? ?? 2b 46 ?? 8b c8 8b 45 ?? 40 c1 e0"); 161 | LuaPCall = p.Find(); 162 | log.WriteLine("LuaPCall: 0x" + LuaPCall.ToString("X")); 163 | } 164 | 165 | { 166 | var p = Pattern.FromTextstyle("FrameScript_Type", 167 | "55 8b ec 8b 45 ?? 8b 4d ?? e8 ?? ?? ?? ?? 3d ?? ?? ?? ?? 75 ?? 83 c8 ?? 5d c3 8b 40 ?? 5d c3"); 168 | LuaType = p.Find(); 169 | log.WriteLine("LuaType: 0x" + LuaType.ToString("X")); 170 | } 171 | 172 | { 173 | var p = Pattern.FromTextstyle("FrameScript_ToNumber", 174 | "55 8b ec 8b 45 ?? 8b 4d ?? 83 ec ?? e8 ?? ?? ?? ?? 83 78 ?? ?? 74 ?? 8d 4d ?? 51 50 e8 ?? ?? ?? ?? 83 c4 ?? 85 c0 75 ?? d9 ee 8b e5 5d c3 dd 00 8b e5 5d c3"); 175 | LuaToNumber = p.Find(); 176 | log.WriteLine("LuaToNumber: 0x" + LuaToNumber.ToString("X")); 177 | } 178 | 179 | { 180 | var p = Pattern.FromTextstyle("FrameScript_ToLString", 181 | "55 8b ec 56 8b 75 ?? 57 8b 7d ?? 8b c7 8b ce e8 ?? ?? ?? ?? 83 78 ?? ?? 74 ?? 50 56 e8 ?? ?? ?? ?? 83 c4 ?? 85 c0 75 ?? 8b 45 ?? 85 c0 74 ?? c7 00 ?? ?? ?? ?? 5f 33 c0 5e 5d c3"); 182 | LuaToLString = p.Find(); 183 | log.WriteLine("LuaToLString: 0x" + LuaToLString.ToString("X")); 184 | } 185 | 186 | { 187 | var p = Pattern.FromTextstyle("FrameScript_ToBoolean", 188 | "55 8b ec 8b 45 ?? 8b 4d ?? e8 ?? ?? ?? ?? 8b 48 ?? 85 c9 74 ?? 83 f9 ?? 75 ?? 83 38 ?? 74 ?? b8 ?? ?? ?? ?? 5d c3"); 189 | LuaToBoolean = p.Find(); 190 | log.WriteLine("LuaToBoolean: 0x" + LuaToBoolean.ToString("X")); 191 | } 192 | 193 | { 194 | var p = Pattern.FromTextstyle("FrameScript__SetTop", 195 | "55 8b ec 8b 4d ?? 8b 45 ?? 85 c9 7c ?? c1 e1 ?? 8b d1 8b 48 ?? 03 ca 39 48 ?? 73 ?? 57 8d 49 ?? 8b 48 ?? 8d 79 ?? 89 78 ?? 8b 3d ?? ?? ?? ?? 89 79 ?? c7 41"); 196 | LuaSetTop = p.Find(); 197 | log.WriteLine("LuaSetTop: 0x" + LuaSetTop.ToString("X")); 198 | } 199 | 200 | { 201 | var p = Pattern.FromTextstyle("PartyArray", 202 | "55 8b ec 51 8b 0d ?? ?? ?? ?? 33 c0 0b 0d ?? ?? ?? ?? 74 ?? b8 ?? ?? ?? ?? 8b 15 ?? ?? ?? ?? 0b 15 ?? ?? ?? ?? 74 ?? 40 8b 0d ?? ?? ?? ?? 0b 0d ?? ?? ?? ?? 74 ?? 40"); 203 | p.Modifiers.Add(new AddModifier(6)); 204 | p.Modifiers.Add(new LeaModifier()); 205 | PartyArray = p.Find(); 206 | log.WriteLine("PartyArray: 0x" + PartyArray.ToString("X")); 207 | } 208 | 209 | { 210 | var p = Pattern.FromTextstyle("lua_GetBillingTimeRested", 211 | "55 8b ec 51 e8 ?? ?? ?? ?? 8b 80 ?? ?? ?? ?? 89 45 ?? db 45 ?? 85 c0 7d ?? dc 05 ?? ?? ?? ??"); 212 | EventVictim = p.Find(); 213 | log.WriteLine("EventVictim: 0x" + EventVictim.ToString("X")); 214 | } 215 | 216 | { 217 | var p = Pattern.FromTextstyle("CorpsePosition", 218 | "8b 75 ?? 89 35 ?? ?? ?? ?? 8b 08 89 0d ?? ?? ?? ?? 8b 50 ?? 8b 4d ?? 89 15 ?? ?? ?? ?? 8b 40 ?? a3 ?? ?? ?? ?? 8b 45 ?? 89 0d ?? ?? ?? ?? 33 c9 3b c1 74 ?? 99 81 ca"); 219 | p.Modifiers.Add(new AddModifier(13)); 220 | p.Modifiers.Add(new LeaModifier()); 221 | CorpsePosition = p.Find(); 222 | log.WriteLine("CorpsePosition: 0x" + CorpsePosition.ToString("X")); 223 | } 224 | 225 | { 226 | var p = Pattern.FromTextstyle("CGPlayer_C__ClickToMove", 227 | "55 8b ec 83 ec ?? 53 56 8b f1 8b 46 ?? 8b 08 57 3b 0d ?? ?? ?? ?? 75 ?? 8b 50 ?? 3b 15 ?? ?? ?? ?? 75 ?? a1 ?? ?? ?? ?? 83 f8 ?? 74 ?? 33 ff 83 f8 ?? 75 ?? 57 68"); 228 | ClickToMove = p.Find(); 229 | log.WriteLine("ClickToMove: 0x" + ClickToMove.ToString("X")); 230 | } 231 | 232 | { 233 | var p = Pattern.FromTextstyle("PerformanceCounter", 234 | "8d 8d ?? ?? ?? ?? 51 68 ?? ?? ?? ?? ff 15 ?? ?? ?? ?? 85 c0 0f 84 ?? ?? ?? ?? e8 ?? ?? ?? ?? 50 8d 95 ?? ?? ?? ?? 52 68 ?? ?? ?? ?? 8d 95 ?? ?? ?? ?? e8 ?? ?? ?? ?? 8d 85 ?? ?? ?? ?? 68 ?? ?? ?? ?? 50 e8 ?? ?? ?? ?? 83 c4"); 235 | p.Modifiers.Add(new AddModifier(27)); 236 | uint relStart = p.Find() - 1; 237 | p.Modifiers.Add(new LeaModifier()); 238 | uint offset = p.Find(); 239 | PerformanceCounter = offset + relStart + 5; 240 | log.WriteLine("PerformanceCounter: 0x" + PerformanceCounter.ToString("X")); 241 | } 242 | 243 | { 244 | var p = Pattern.FromTextstyle("LastHardwareAction", 245 | "8b 1d ?? ?? ?? ?? 57 8d be ?? ?? ?? ?? 7e ?? 8b 86 ?? ?? ?? ?? 8b 80 ?? ?? ?? ?? 85 c0 74 ?? f7 40 ?? ?? ?? ?? ?? 74 ?? 8b ce e8 ?? ?? ?? ?? 85 c0 75 ??"); 246 | p.Modifiers.Add(new AddModifier(2)); 247 | p.Modifiers.Add(new LeaModifier()); 248 | LastHardwareAction = p.Find(); 249 | log.WriteLine("LastHardwareAction: 0x" + LastHardwareAction.ToString("X")); 250 | } 251 | 252 | { 253 | var p = Pattern.FromTextstyle("SelectObject", 254 | "55 8b ec 81 ec ?? ?? ?? ?? e8 ?? ?? ?? ?? 85 c0 74 ?? 80 3d ?? ?? ?? ?? ?? 75 ?? 33 c0"); 255 | SelectObject = p.Find(); 256 | log.WriteLine("SelectObject: 0x" + SelectObject.ToString("X")); 257 | } 258 | 259 | { 260 | var p = Pattern.FromTextstyle("SetFacing", 261 | "55 8b ec 56 8b f1 56 e8 ?? ?? ?? ?? 8b c8 e8 ?? ?? ?? ?? 85 c0 74 ?? d9 45 ?? 83 0d ?? ?? ?? ?? ?? 51 8b 8e ?? ?? ?? ?? d9 1c 24 e8 ?? ?? ?? ?? 8b 45 ?? 51 d9 1c 24 50 8b ce e8 ?? ?? ?? ?? 83 25"); 262 | SetFacing = p.Find(); 263 | log.WriteLine("SetFacing: 0x" + SetFacing.ToString("X")); 264 | } 265 | 266 | { 267 | var p = Pattern.FromTextstyle("lua_GetInstanceInfo", 268 | "8b 1d ?? ?? ?? ?? 3b d8 56 0f 8c ?? ?? ?? ?? 3b 1d ?? ?? ?? ?? 0f 8f ?? ?? ?? ?? 8b 15 ?? ?? ?? ?? 8b cb 2b c8 8b 34 8a"); 269 | p.Modifiers.Add(new AddModifier(2)); 270 | p.Modifiers.Add(new LeaModifier()); 271 | CurrentMapId = p.Find(); 272 | log.WriteLine("CurrentMapId: 0x" + CurrentMapId.ToString("X")); 273 | } 274 | 275 | { 276 | var p = Pattern.FromTextstyle("GetNumAuctionItems", 277 | "8b 0d ?? ?? ?? ?? db 05 ?? ?? ?? ?? 85 c9 7d ?? dc 05 ?? ?? ?? ?? 83 ec ?? dd 1c 24 56 e8"); 278 | p.Modifiers.Add(new AddModifier(2)); 279 | p.Modifiers.Add(new LeaModifier()); 280 | AuctionHouse.ListCount = p.Find(); 281 | AuctionHouse.ListBase = AuctionHouse.ListCount + 4; 282 | AuctionHouse.OwnerCount = AuctionHouse.ListBase + 12; 283 | AuctionHouse.OwnerBase = AuctionHouse.OwnerCount + 4; 284 | AuctionHouse.BidderCount = AuctionHouse.OwnerBase + 12; 285 | AuctionHouse.BidderBase = AuctionHouse.BidderCount + 4; 286 | log.WriteLine("AuctionHouse:"); 287 | log.WriteLine("\tListCount: 0x" + AuctionHouse.ListCount.ToString("X")); 288 | log.WriteLine("\tListBase: 0x" + AuctionHouse.ListBase.ToString("X")); 289 | log.WriteLine("\tOwnerCount: 0x" + AuctionHouse.OwnerBase.ToString("X")); 290 | log.WriteLine("\tOwnerBase: 0x" + AuctionHouse.OwnerCount.ToString("X")); 291 | log.WriteLine("\tBidderCount: 0x" + AuctionHouse.BidderBase.ToString("X")); 292 | log.WriteLine("\tBidderBase: 0x" + AuctionHouse.BidderCount.ToString("X")); 293 | } 294 | 295 | { 296 | var p = Pattern.FromTextstyle("AuctionSize", 297 | "69 f6 ?? ?? ?? ?? 03 35 ?? ?? ?? ?? eb ?? 68 ?? ?? ?? ?? 57 e8 ?? ?? ?? ?? 83 c4"); 298 | p.Modifiers.Add(new AddModifier(2)); 299 | p.Modifiers.Add(new LeaModifier()); 300 | AuctionHouse.AuctionSize = p.Find(); 301 | log.WriteLine("\tAuctionSize: 0x" + AuctionHouse.AuctionSize.ToString("X")); 302 | } 303 | 304 | { 305 | var p = Pattern.FromTextstyle("ExpireOffset", "8b 8e ?? ?? ?? ?? 8b f8 2b c1 78 ?? d9 e8 83 ec"); 306 | p.Modifiers.Add(new AddModifier(2)); 307 | p.Modifiers.Add(new LeaModifier()); 308 | AuctionHouse.ExpireOffset = p.Find(); 309 | log.WriteLine("\tExpireOffset: 0x" + AuctionHouse.ExpireOffset.ToString("X")); 310 | } 311 | 312 | { 313 | var p = Pattern.FromTextstyle("OpcodeStop", "05 ?? ?? ?? ?? 5b 5d c2 ?? ?? b8"); 314 | p.Modifiers.Add(new AddModifier(11)); 315 | p.Modifiers.Add(new LeaModifier()); 316 | Teleport.OpcodeStop = p.Find(); 317 | log.WriteLine("Teleport:"); 318 | log.WriteLine("\tOpcodeStop: 0x" + Teleport.OpcodeStop.ToString("X")); 319 | } 320 | 321 | { 322 | var p = Pattern.FromTextstyle("OpcodeStart", "33 5d ?? f6 c3 ?? 74 ?? f6 c2 ?? 74 ?? b8"); 323 | p.Modifiers.Add(new AddModifier(14)); 324 | p.Modifiers.Add(new LeaModifier()); 325 | Teleport.OpcodeStart = p.Find(); 326 | log.WriteLine("\tOpcodeStart: 0x" + Teleport.OpcodeStart.ToString("X")); 327 | } 328 | 329 | { 330 | var p = Pattern.FromTextstyle("CGUnit_C__WriteMovementPacketWithTransport", 331 | "55 8b ec 83 ec ?? 53 56 8b f1 8b 06 8b 50 ?? 57 33 ff c7 45 ?? ?? ?? ?? ?? 89 7d"); 332 | Teleport.SendMovementPacket = p.Find(); 333 | log.WriteLine("\tSendMovementPacket: 0x" + Teleport.SendMovementPacket.ToString("X")); 334 | } 335 | 336 | { 337 | var p = Pattern.FromTextstyle("CGUnit_C__Send_CMSG_MOVE_SPLINE_DONE", 338 | "55 8b ec 83 ec ?? d9 ee 53 56 57 8b 7d ?? 33 db"); 339 | Teleport.SendMoveSplineDone = p.Find(); 340 | log.WriteLine("\tSendMoveSplineDone: 0x" + Teleport.SendMoveSplineDone.ToString("X")); 341 | } 342 | 343 | { 344 | var p = Pattern.FromTextstyle("UnitMovementInfo", 345 | "8b 89 ?? ?? ?? ?? 8b 51 ?? 8b 45 ?? 89 10 8b 51 ?? 8b 49"); 346 | p.Modifiers.Add(new AddModifier(2)); 347 | p.Modifiers.Add(new LeaModifier()); 348 | Teleport.UnitMovementData = p.Find(); 349 | log.WriteLine("\tUnitMovementData: 0x" + Teleport.UnitMovementData.ToString("X")); 350 | } 351 | 352 | { 353 | var p = Pattern.FromTextstyle("MovementDataPosition", 354 | "8b 51 ?? 8b 45 ?? 89 10 8b 51 ?? 8b 49 ?? 89 50 ?? 89 48 ?? 5d"); 355 | p.Modifiers.Add(new AddModifier(2)); 356 | p.Modifiers.Add(new LeaModifier(LeaType.Byte)); 357 | Teleport.MovementDataPosition = p.Find(); 358 | log.WriteLine("\tMovementDataPosition: 0x" + Teleport.MovementDataPosition.ToString("X")); 359 | } 360 | 361 | { 362 | var p = Pattern.FromTextstyle("MovementHeartbeat", "8d 8f ?? ?? ?? ?? a8 ?? 75 ?? 85 c0 75 ?? 8b c1"); 363 | p.Modifiers.Add(new AddModifier(2)); 364 | p.Modifiers.Add(new LeaModifier()); 365 | Teleport.GlobalMovementHeartbeat = p.Find(); 366 | log.WriteLine("\tGlobalMovementHeartbeat: 0x" + Teleport.GlobalMovementHeartbeat.ToString("X")); 367 | } 368 | 369 | { 370 | var p = Pattern.FromTextstyle("GlobalMovement", 371 | "64 8b 0d ?? ?? ?? ?? 8b 14 81 8b 82 ?? ?? ?? ?? 85 c0 74 ?? 8b 4d ?? 89 88 ?? ?? ?? ??"); 372 | p.Modifiers.Add(new AddModifier(25)); 373 | p.Modifiers.Add(new LeaModifier()); 374 | Teleport.CurMgrGlobalMovement = p.Find(); 375 | log.WriteLine("\tCurMgrGlobalMovement: 0x" + Teleport.CurMgrGlobalMovement.ToString("X")); 376 | } 377 | 378 | { 379 | var p = Pattern.FromTextstyle("Singleton2", 380 | "8b 15 ?? ?? ?? ?? 89 82 ?? ?? ?? ?? 89 81 ?? ?? ?? ?? 8b 0d ?? ?? ?? ?? 89 88 ?? ?? ?? ?? c7 81 ?? ?? ?? ?? ?? ?? ?? ?? c7 81 ?? ?? ?? ?? ?? ?? ?? ?? 8b 88"); 381 | p.Modifiers.Add(new AddModifier(2)); 382 | p.Modifiers.Add(new LeaModifier()); 383 | Teleport.Singleton = p.Find(); 384 | p.Modifiers.Clear(); 385 | p.Modifiers.Add(new AddModifier(8)); 386 | p.Modifiers.Add(new LeaModifier()); 387 | Teleport.CurMgrOffset = p.Find(); 388 | log.WriteLine("\tSingleton: 0x" + Teleport.Singleton.ToString("X")); 389 | log.WriteLine("\tCurMgrOffset: 0x" + Teleport.CurMgrOffset.ToString("X")); 390 | } 391 | 392 | { 393 | var p = Pattern.FromTextstyle("CGPlayer_C__IsClickMoving", 394 | "8b 41 ?? 8b 08 3b 0d ?? ?? ?? ?? 75 ?? 8b 50 ?? 3b 15 ?? ?? ?? ?? 75 ?? 83 3d ?? ?? ?? ?? ?? 74 ?? b8"); 395 | IsClickMoving = p.Find(); 396 | log.WriteLine("IsClickMoving: 0x" + IsClickMoving.ToString("X")); 397 | } 398 | 399 | { 400 | var p = Pattern.FromTextstyle("CGUnit_C__HasAuraBySpellId", 401 | "55 8b ec 53 56 57 8b f1 33 ff e8 ?? ?? ?? ?? 85 c0 76 ?? 8b 5d ?? 33 d2"); 402 | HasAuraBySpellId = p.Find(); 403 | log.WriteLine("HasAuraBySpellId: 0x" + HasAuraBySpellId.ToString("X")); 404 | } 405 | 406 | { 407 | var p = Pattern.FromTextstyle("Spell_C_CastSpell", 408 | "55 8b ec e8 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 6a ?? 52 50 e8 ?? ?? ?? ?? 8b 4d ?? 8b 55"); 409 | CastSpell = p.Find(); 410 | log.WriteLine("CastSpell: 0x" + CastSpell.ToString("X")); 411 | } 412 | 413 | { 414 | var p = Pattern.FromTextstyle("Interact", 415 | "8b 82 ?? ?? ?? ?? 8b ce ff d0 5f 5e b8 ?? ?? ?? ?? 5b 5d c3"); 416 | p.Modifiers.Add(new AddModifier(2)); 417 | p.Modifiers.Add(new LeaModifier()); 418 | Interact = p.Find(); 419 | log.WriteLine("Interact: 0x" + Interact.ToString("X")); 420 | } 421 | 422 | { 423 | var p = Pattern.FromTextstyle("UseItem", 424 | "55 8b ec 83 ec ?? 57 8b f9 8b 47 ?? 0f bf 48 ?? c1 e9 ?? f6 c1 ?? 0f 85 ?? ?? ?? ?? f6 87 ?? ?? ?? ?? ?? 0f 85"); 425 | UseItem = p.Find(); 426 | log.WriteLine("UseItem: 0x" + UseItem.ToString("X")); 427 | } 428 | 429 | { 430 | var p = Pattern.FromTextstyle("CGPlayer_C__AutoEquipItem", 431 | "8b 42 ?? 8b ce ff d0 85 c0 74 ?? 8b 16 8b 42 ?? 53 8b ce ff d0"); 432 | p.Modifiers.Add(new AddModifier(2)); 433 | p.Modifiers.Add(new LeaModifier(LeaType.Byte)); 434 | GetBag = p.Find(); 435 | log.WriteLine("GetBag: 0x" + GetBag.ToString("X")); 436 | } 437 | 438 | { 439 | var p = Pattern.FromTextstyle("CGPlayer_C__ClickToMoveStop", 440 | "a1 ?? ?? ?? ?? 83 c0 ?? 56 8b f1 83 f8 ?? 0f 87 ?? ?? ?? ?? ff 24 85 ?? ?? ?? ?? 8b 0d"); 441 | StopCTM = p.Find(); 442 | log.WriteLine("StopCTM: 0x" + StopCTM.ToString("X")); 443 | } 444 | 445 | { 446 | var p = Pattern.FromTextstyle("TracelineWrapper", 447 | "55 8b ec a1 ?? ?? ?? ?? 8b 0c 85 ?? ?? ?? ?? 85 c9 75 ?? 32 c0 5d c3 8b 55 ?? 8b 45 ?? 52 8b 55 ?? 50 8b 45 ?? 52"); 448 | Traceline = p.Find(); 449 | log.WriteLine("Traceline: 0x" + Traceline.ToString("X")); 450 | } 451 | 452 | { 453 | var p = Pattern.FromTextstyle("CGUnit_C__UnitReaction", 454 | "55 8b ec 83 ec 14 53 57 8b 7d 08 8b d9 85 ff 75 ?? 8d 47 01 5f 5b 8b e5 5d c2 04 00 3b fb 75 ??"); 455 | UnitReaction = p.Find(); 456 | log.WriteLine("UnitReaction: 0x" + UnitReaction.ToString("X")); 457 | } 458 | 459 | WoWLocalPlayer.Initialize(); 460 | LuaInterface.Initialize(); 461 | Manager.Initialize(); 462 | Helper.Initialize(); 463 | Pulse.Initialize(); 464 | Events.Initialize(); 465 | Teleporter.Initialize(); 466 | WoWWorld.Initialize(); 467 | 468 | log.Flush(); 469 | } 470 | 471 | if (OnOffsetsLoaded != null) 472 | OnOffsetsLoaded(null, new EventArgs()); 473 | } 474 | } 475 | 476 | } -------------------------------------------------------------------------------- /cleanCore/Descriptors.cs: -------------------------------------------------------------------------------- 1 | // Version: 4.0.3 Build number: 13329 Build date: Nov 17 2010 2 | 3 | 4 | 5 | namespace cleanCore 6 | { 7 | // Descriptors: 0x00C144D0 8 | public enum ObjectField : uint 9 | { 10 | OBJECT_FIELD_GUID = 0x0, 11 | OBJECT_FIELD_TYPE = 0x8, 12 | OBJECT_FIELD_ENTRY = 0xC, 13 | OBJECT_FIELD_SCALE_X = 0x10, 14 | OBJECT_FIELD_DATA = 0x14, 15 | OBJECT_FIELD_PADDING = 0x1C, 16 | OBJECT_END = 0x20 17 | } 18 | 19 | // Descriptors: 0x00C148D0 20 | public enum UnitField : uint 21 | { 22 | UNIT_FIELD_CHARM = ObjectField.OBJECT_END + 0x0, 23 | UNIT_FIELD_SUMMON = ObjectField.OBJECT_END + 0x8, 24 | UNIT_FIELD_CRITTER = ObjectField.OBJECT_END + 0x10, 25 | UNIT_FIELD_CHARMEDBY = ObjectField.OBJECT_END + 0x18, 26 | UNIT_FIELD_SUMMONEDBY = ObjectField.OBJECT_END + 0x20, 27 | UNIT_FIELD_CREATEDBY = ObjectField.OBJECT_END + 0x28, 28 | UNIT_FIELD_TARGET = ObjectField.OBJECT_END + 0x30, 29 | UNIT_FIELD_CHANNEL_OBJECT = ObjectField.OBJECT_END + 0x38, 30 | UNIT_CHANNEL_SPELL = ObjectField.OBJECT_END + 0x40, 31 | UNIT_FIELD_BYTES_0 = ObjectField.OBJECT_END + 0x44, 32 | UNIT_FIELD_HEALTH = ObjectField.OBJECT_END + 0x48, 33 | UNIT_FIELD_POWER1 = ObjectField.OBJECT_END + 0x4C, 34 | UNIT_FIELD_POWER2 = ObjectField.OBJECT_END + 0x50, 35 | UNIT_FIELD_POWER3 = ObjectField.OBJECT_END + 0x54, 36 | UNIT_FIELD_POWER4 = ObjectField.OBJECT_END + 0x58, 37 | UNIT_FIELD_POWER5 = ObjectField.OBJECT_END + 0x5C, 38 | UNIT_FIELD_POWER6 = ObjectField.OBJECT_END + 0x60, 39 | UNIT_FIELD_POWER7 = ObjectField.OBJECT_END + 0x64, 40 | UNIT_FIELD_POWER8 = ObjectField.OBJECT_END + 0x68, 41 | UNIT_FIELD_POWER9 = ObjectField.OBJECT_END + 0x6C, 42 | UNIT_FIELD_POWER10 = ObjectField.OBJECT_END + 0x70, 43 | UNIT_FIELD_POWER11 = ObjectField.OBJECT_END + 0x74, 44 | UNIT_FIELD_MAXHEALTH = ObjectField.OBJECT_END + 0x78, 45 | UNIT_FIELD_MAXPOWER1 = ObjectField.OBJECT_END + 0x7C, 46 | UNIT_FIELD_MAXPOWER2 = ObjectField.OBJECT_END + 0x80, 47 | UNIT_FIELD_MAXPOWER3 = ObjectField.OBJECT_END + 0x84, 48 | UNIT_FIELD_MAXPOWER4 = ObjectField.OBJECT_END + 0x88, 49 | UNIT_FIELD_MAXPOWER5 = ObjectField.OBJECT_END + 0x8C, 50 | UNIT_FIELD_MAXPOWER6 = ObjectField.OBJECT_END + 0x90, 51 | UNIT_FIELD_MAXPOWER7 = ObjectField.OBJECT_END + 0x94, 52 | UNIT_FIELD_MAXPOWER8 = ObjectField.OBJECT_END + 0x98, 53 | UNIT_FIELD_MAXPOWER9 = ObjectField.OBJECT_END + 0x9C, 54 | UNIT_FIELD_MAXPOWER10 = ObjectField.OBJECT_END + 0xA0, 55 | UNIT_FIELD_MAXPOWER11 = ObjectField.OBJECT_END + 0xA4, 56 | UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = ObjectField.OBJECT_END + 0xA8, 57 | UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = ObjectField.OBJECT_END + 0xD4, 58 | UNIT_FIELD_LEVEL = ObjectField.OBJECT_END + 0x100, 59 | UNIT_FIELD_FACTIONTEMPLATE = ObjectField.OBJECT_END + 0x104, 60 | UNIT_VIRTUAL_ITEM_SLOT_ID = ObjectField.OBJECT_END + 0x108, 61 | UNIT_FIELD_FLAGS = ObjectField.OBJECT_END + 0x114, 62 | UNIT_FIELD_FLAGS_2 = ObjectField.OBJECT_END + 0x118, 63 | UNIT_FIELD_AURASTATE = ObjectField.OBJECT_END + 0x11C, 64 | UNIT_FIELD_BASEATTACKTIME = ObjectField.OBJECT_END + 0x120, 65 | UNIT_FIELD_RANGEDATTACKTIME = ObjectField.OBJECT_END + 0x128, 66 | UNIT_FIELD_BOUNDINGRADIUS = ObjectField.OBJECT_END + 0x12C, 67 | UNIT_FIELD_COMBATREACH = ObjectField.OBJECT_END + 0x130, 68 | UNIT_FIELD_DISPLAYID = ObjectField.OBJECT_END + 0x134, 69 | UNIT_FIELD_NATIVEDISPLAYID = ObjectField.OBJECT_END + 0x138, 70 | UNIT_FIELD_MOUNTDISPLAYID = ObjectField.OBJECT_END + 0x13C, 71 | UNIT_FIELD_MINDAMAGE = ObjectField.OBJECT_END + 0x140, 72 | UNIT_FIELD_MAXDAMAGE = ObjectField.OBJECT_END + 0x144, 73 | UNIT_FIELD_MINOFFHANDDAMAGE = ObjectField.OBJECT_END + 0x148, 74 | UNIT_FIELD_MAXOFFHANDDAMAGE = ObjectField.OBJECT_END + 0x14C, 75 | UNIT_FIELD_BYTES_1 = ObjectField.OBJECT_END + 0x150, 76 | UNIT_FIELD_PETNUMBER = ObjectField.OBJECT_END + 0x154, 77 | UNIT_FIELD_PET_NAME_TIMESTAMP = ObjectField.OBJECT_END + 0x158, 78 | UNIT_FIELD_PETEXPERIENCE = ObjectField.OBJECT_END + 0x15C, 79 | UNIT_FIELD_PETNEXTLEVELEXP = ObjectField.OBJECT_END + 0x160, 80 | UNIT_DYNAMIC_FLAGS = ObjectField.OBJECT_END + 0x164, 81 | UNIT_MOD_CAST_SPEED = ObjectField.OBJECT_END + 0x168, 82 | UNIT_CREATED_BY_SPELL = ObjectField.OBJECT_END + 0x16C, 83 | UNIT_NPC_FLAGS = ObjectField.OBJECT_END + 0x170, 84 | UNIT_NPC_EMOTESTATE = ObjectField.OBJECT_END + 0x174, 85 | UNIT_FIELD_STAT0 = ObjectField.OBJECT_END + 0x178, 86 | UNIT_FIELD_STAT1 = ObjectField.OBJECT_END + 0x17C, 87 | UNIT_FIELD_STAT2 = ObjectField.OBJECT_END + 0x180, 88 | UNIT_FIELD_STAT3 = ObjectField.OBJECT_END + 0x184, 89 | UNIT_FIELD_STAT4 = ObjectField.OBJECT_END + 0x188, 90 | UNIT_FIELD_POSSTAT0 = ObjectField.OBJECT_END + 0x18C, 91 | UNIT_FIELD_POSSTAT1 = ObjectField.OBJECT_END + 0x190, 92 | UNIT_FIELD_POSSTAT2 = ObjectField.OBJECT_END + 0x194, 93 | UNIT_FIELD_POSSTAT3 = ObjectField.OBJECT_END + 0x198, 94 | UNIT_FIELD_POSSTAT4 = ObjectField.OBJECT_END + 0x19C, 95 | UNIT_FIELD_NEGSTAT0 = ObjectField.OBJECT_END + 0x1A0, 96 | UNIT_FIELD_NEGSTAT1 = ObjectField.OBJECT_END + 0x1A4, 97 | UNIT_FIELD_NEGSTAT2 = ObjectField.OBJECT_END + 0x1A8, 98 | UNIT_FIELD_NEGSTAT3 = ObjectField.OBJECT_END + 0x1AC, 99 | UNIT_FIELD_NEGSTAT4 = ObjectField.OBJECT_END + 0x1B0, 100 | UNIT_FIELD_RESISTANCES = ObjectField.OBJECT_END + 0x1B4, 101 | UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = ObjectField.OBJECT_END + 0x1D0, 102 | UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = ObjectField.OBJECT_END + 0x1EC, 103 | UNIT_FIELD_BASE_MANA = ObjectField.OBJECT_END + 0x208, 104 | UNIT_FIELD_BASE_HEALTH = ObjectField.OBJECT_END + 0x20C, 105 | UNIT_FIELD_BYTES_2 = ObjectField.OBJECT_END + 0x210, 106 | UNIT_FIELD_ATTACK_POWER = ObjectField.OBJECT_END + 0x214, 107 | UNIT_FIELD_ATTACK_POWER_MOD_POS = ObjectField.OBJECT_END + 0x218, 108 | UNIT_FIELD_ATTACK_POWER_MOD_NEG = ObjectField.OBJECT_END + 0x21C, 109 | UNIT_FIELD_ATTACK_POWER_MULTIPLIER = ObjectField.OBJECT_END + 0x220, 110 | UNIT_FIELD_RANGED_ATTACK_POWER = ObjectField.OBJECT_END + 0x224, 111 | UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = ObjectField.OBJECT_END + 0x228, 112 | UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = ObjectField.OBJECT_END + 0x22C, 113 | UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = ObjectField.OBJECT_END + 0x230, 114 | UNIT_FIELD_MINRANGEDDAMAGE = ObjectField.OBJECT_END + 0x234, 115 | UNIT_FIELD_MAXRANGEDDAMAGE = ObjectField.OBJECT_END + 0x238, 116 | UNIT_FIELD_POWER_COST_MODIFIER = ObjectField.OBJECT_END + 0x23C, 117 | UNIT_FIELD_POWER_COST_MULTIPLIER = ObjectField.OBJECT_END + 0x258, 118 | UNIT_FIELD_MAXHEALTHMODIFIER = ObjectField.OBJECT_END + 0x274, 119 | UNIT_FIELD_HOVERHEIGHT = ObjectField.OBJECT_END + 0x278, 120 | UNIT_FIELD_MAXITEMLEVEL = ObjectField.OBJECT_END + 0x27C, 121 | UNIT_END = ObjectField.OBJECT_END + 0x280 122 | } 123 | 124 | // Descriptors: 0x00C14548 125 | public enum ItemField : uint 126 | { 127 | ITEM_FIELD_OWNER = ObjectField.OBJECT_END + 0x0, 128 | ITEM_FIELD_CONTAINED = ObjectField.OBJECT_END + 0x8, 129 | ITEM_FIELD_CREATOR = ObjectField.OBJECT_END + 0x10, 130 | ITEM_FIELD_GIFTCREATOR = ObjectField.OBJECT_END + 0x18, 131 | ITEM_FIELD_STACK_COUNT = ObjectField.OBJECT_END + 0x20, 132 | ITEM_FIELD_DURATION = ObjectField.OBJECT_END + 0x24, 133 | ITEM_FIELD_SPELL_CHARGES = ObjectField.OBJECT_END + 0x28, 134 | ITEM_FIELD_FLAGS = ObjectField.OBJECT_END + 0x3C, 135 | ITEM_FIELD_ENCHANTMENT_1_1 = ObjectField.OBJECT_END + 0x40, 136 | ITEM_FIELD_ENCHANTMENT_1_3 = ObjectField.OBJECT_END + 0x48, 137 | ITEM_FIELD_ENCHANTMENT_2_1 = ObjectField.OBJECT_END + 0x4C, 138 | ITEM_FIELD_ENCHANTMENT_2_3 = ObjectField.OBJECT_END + 0x54, 139 | ITEM_FIELD_ENCHANTMENT_3_1 = ObjectField.OBJECT_END + 0x58, 140 | ITEM_FIELD_ENCHANTMENT_3_3 = ObjectField.OBJECT_END + 0x60, 141 | ITEM_FIELD_ENCHANTMENT_4_1 = ObjectField.OBJECT_END + 0x64, 142 | ITEM_FIELD_ENCHANTMENT_4_3 = ObjectField.OBJECT_END + 0x6C, 143 | ITEM_FIELD_ENCHANTMENT_5_1 = ObjectField.OBJECT_END + 0x70, 144 | ITEM_FIELD_ENCHANTMENT_5_3 = ObjectField.OBJECT_END + 0x78, 145 | ITEM_FIELD_ENCHANTMENT_6_1 = ObjectField.OBJECT_END + 0x7C, 146 | ITEM_FIELD_ENCHANTMENT_6_3 = ObjectField.OBJECT_END + 0x84, 147 | ITEM_FIELD_ENCHANTMENT_7_1 = ObjectField.OBJECT_END + 0x88, 148 | ITEM_FIELD_ENCHANTMENT_7_3 = ObjectField.OBJECT_END + 0x90, 149 | ITEM_FIELD_ENCHANTMENT_8_1 = ObjectField.OBJECT_END + 0x94, 150 | ITEM_FIELD_ENCHANTMENT_8_3 = ObjectField.OBJECT_END + 0x9C, 151 | ITEM_FIELD_ENCHANTMENT_9_1 = ObjectField.OBJECT_END + 0xA0, 152 | ITEM_FIELD_ENCHANTMENT_9_3 = ObjectField.OBJECT_END + 0xA8, 153 | ITEM_FIELD_ENCHANTMENT_10_1 = ObjectField.OBJECT_END + 0xAC, 154 | ITEM_FIELD_ENCHANTMENT_10_3 = ObjectField.OBJECT_END + 0xB4, 155 | ITEM_FIELD_ENCHANTMENT_11_1 = ObjectField.OBJECT_END + 0xB8, 156 | ITEM_FIELD_ENCHANTMENT_11_3 = ObjectField.OBJECT_END + 0xC0, 157 | ITEM_FIELD_ENCHANTMENT_12_1 = ObjectField.OBJECT_END + 0xC4, 158 | ITEM_FIELD_ENCHANTMENT_12_3 = ObjectField.OBJECT_END + 0xCC, 159 | ITEM_FIELD_ENCHANTMENT_13_1 = ObjectField.OBJECT_END + 0xD0, 160 | ITEM_FIELD_ENCHANTMENT_13_3 = ObjectField.OBJECT_END + 0xD8, 161 | ITEM_FIELD_ENCHANTMENT_14_1 = ObjectField.OBJECT_END + 0xDC, 162 | ITEM_FIELD_ENCHANTMENT_14_3 = ObjectField.OBJECT_END + 0xE4, 163 | ITEM_FIELD_PROPERTY_SEED = ObjectField.OBJECT_END + 0xE8, 164 | ITEM_FIELD_RANDOM_PROPERTIES_ID = ObjectField.OBJECT_END + 0xEC, 165 | ITEM_FIELD_DURABILITY = ObjectField.OBJECT_END + 0xF0, 166 | ITEM_FIELD_MAXDURABILITY = ObjectField.OBJECT_END + 0xF4, 167 | ITEM_FIELD_CREATE_PLAYED_TIME = ObjectField.OBJECT_END + 0xF8, 168 | ITEM_FIELD_PAD = ObjectField.OBJECT_END + 0xFC, 169 | ITEM_END = ObjectField.OBJECT_END + 0x100 170 | } 171 | 172 | // Descriptors: 0x00C15090 173 | public enum PlayerField : uint 174 | { 175 | PLAYER_DUEL_ARBITER = UnitField.UNIT_END + 0x0, 176 | PLAYER_FLAGS = UnitField.UNIT_END + 0x8, 177 | PLAYER_GUILDRANK = UnitField.UNIT_END + 0xC, 178 | PLAYER_GUILDDELETE_DATE = UnitField.UNIT_END + 0x10, 179 | PLAYER_GUILDLEVEL = UnitField.UNIT_END + 0x14, 180 | PLAYER_BYTES = UnitField.UNIT_END + 0x18, 181 | PLAYER_BYTES_2 = UnitField.UNIT_END + 0x1C, 182 | PLAYER_BYTES_3 = UnitField.UNIT_END + 0x20, 183 | PLAYER_DUEL_TEAM = UnitField.UNIT_END + 0x24, 184 | PLAYER_GUILD_TIMESTAMP = UnitField.UNIT_END + 0x28, 185 | PLAYER_QUEST_LOG_1_1 = UnitField.UNIT_END + 0x2C, 186 | PLAYER_QUEST_LOG_1_2 = UnitField.UNIT_END + 0x30, 187 | PLAYER_QUEST_LOG_1_3 = UnitField.UNIT_END + 0x34, 188 | PLAYER_QUEST_LOG_1_4 = UnitField.UNIT_END + 0x3C, 189 | PLAYER_QUEST_LOG_2_1 = UnitField.UNIT_END + 0x40, 190 | PLAYER_QUEST_LOG_2_2 = UnitField.UNIT_END + 0x44, 191 | PLAYER_QUEST_LOG_2_3 = UnitField.UNIT_END + 0x48, 192 | PLAYER_QUEST_LOG_2_5 = UnitField.UNIT_END + 0x50, 193 | PLAYER_QUEST_LOG_3_1 = UnitField.UNIT_END + 0x54, 194 | PLAYER_QUEST_LOG_3_2 = UnitField.UNIT_END + 0x58, 195 | PLAYER_QUEST_LOG_3_3 = UnitField.UNIT_END + 0x5C, 196 | PLAYER_QUEST_LOG_3_5 = UnitField.UNIT_END + 0x64, 197 | PLAYER_QUEST_LOG_4_1 = UnitField.UNIT_END + 0x68, 198 | PLAYER_QUEST_LOG_4_2 = UnitField.UNIT_END + 0x6C, 199 | PLAYER_QUEST_LOG_4_3 = UnitField.UNIT_END + 0x70, 200 | PLAYER_QUEST_LOG_4_5 = UnitField.UNIT_END + 0x78, 201 | PLAYER_QUEST_LOG_5_1 = UnitField.UNIT_END + 0x7C, 202 | PLAYER_QUEST_LOG_5_2 = UnitField.UNIT_END + 0x80, 203 | PLAYER_QUEST_LOG_5_3 = UnitField.UNIT_END + 0x84, 204 | PLAYER_QUEST_LOG_5_5 = UnitField.UNIT_END + 0x8C, 205 | PLAYER_QUEST_LOG_6_1 = UnitField.UNIT_END + 0x90, 206 | PLAYER_QUEST_LOG_6_2 = UnitField.UNIT_END + 0x94, 207 | PLAYER_QUEST_LOG_6_3 = UnitField.UNIT_END + 0x98, 208 | PLAYER_QUEST_LOG_6_5 = UnitField.UNIT_END + 0xA0, 209 | PLAYER_QUEST_LOG_7_1 = UnitField.UNIT_END + 0xA4, 210 | PLAYER_QUEST_LOG_7_2 = UnitField.UNIT_END + 0xA8, 211 | PLAYER_QUEST_LOG_7_3 = UnitField.UNIT_END + 0xAC, 212 | PLAYER_QUEST_LOG_7_5 = UnitField.UNIT_END + 0xB4, 213 | PLAYER_QUEST_LOG_8_1 = UnitField.UNIT_END + 0xB8, 214 | PLAYER_QUEST_LOG_8_2 = UnitField.UNIT_END + 0xBC, 215 | PLAYER_QUEST_LOG_8_3 = UnitField.UNIT_END + 0xC0, 216 | PLAYER_QUEST_LOG_8_5 = UnitField.UNIT_END + 0xC8, 217 | PLAYER_QUEST_LOG_9_1 = UnitField.UNIT_END + 0xCC, 218 | PLAYER_QUEST_LOG_9_2 = UnitField.UNIT_END + 0xD0, 219 | PLAYER_QUEST_LOG_9_3 = UnitField.UNIT_END + 0xD4, 220 | PLAYER_QUEST_LOG_9_5 = UnitField.UNIT_END + 0xDC, 221 | PLAYER_QUEST_LOG_10_1 = UnitField.UNIT_END + 0xE0, 222 | PLAYER_QUEST_LOG_10_2 = UnitField.UNIT_END + 0xE4, 223 | PLAYER_QUEST_LOG_10_3 = UnitField.UNIT_END + 0xE8, 224 | PLAYER_QUEST_LOG_10_5 = UnitField.UNIT_END + 0xF0, 225 | PLAYER_QUEST_LOG_11_1 = UnitField.UNIT_END + 0xF4, 226 | PLAYER_QUEST_LOG_11_2 = UnitField.UNIT_END + 0xF8, 227 | PLAYER_QUEST_LOG_11_3 = UnitField.UNIT_END + 0xFC, 228 | PLAYER_QUEST_LOG_11_5 = UnitField.UNIT_END + 0x104, 229 | PLAYER_QUEST_LOG_12_1 = UnitField.UNIT_END + 0x108, 230 | PLAYER_QUEST_LOG_12_2 = UnitField.UNIT_END + 0x10C, 231 | PLAYER_QUEST_LOG_12_3 = UnitField.UNIT_END + 0x110, 232 | PLAYER_QUEST_LOG_12_5 = UnitField.UNIT_END + 0x118, 233 | PLAYER_QUEST_LOG_13_1 = UnitField.UNIT_END + 0x11C, 234 | PLAYER_QUEST_LOG_13_2 = UnitField.UNIT_END + 0x120, 235 | PLAYER_QUEST_LOG_13_3 = UnitField.UNIT_END + 0x124, 236 | PLAYER_QUEST_LOG_13_5 = UnitField.UNIT_END + 0x12C, 237 | PLAYER_QUEST_LOG_14_1 = UnitField.UNIT_END + 0x130, 238 | PLAYER_QUEST_LOG_14_2 = UnitField.UNIT_END + 0x134, 239 | PLAYER_QUEST_LOG_14_3 = UnitField.UNIT_END + 0x138, 240 | PLAYER_QUEST_LOG_14_5 = UnitField.UNIT_END + 0x140, 241 | PLAYER_QUEST_LOG_15_1 = UnitField.UNIT_END + 0x144, 242 | PLAYER_QUEST_LOG_15_2 = UnitField.UNIT_END + 0x148, 243 | PLAYER_QUEST_LOG_15_3 = UnitField.UNIT_END + 0x14C, 244 | PLAYER_QUEST_LOG_15_5 = UnitField.UNIT_END + 0x154, 245 | PLAYER_QUEST_LOG_16_1 = UnitField.UNIT_END + 0x158, 246 | PLAYER_QUEST_LOG_16_2 = UnitField.UNIT_END + 0x15C, 247 | PLAYER_QUEST_LOG_16_3 = UnitField.UNIT_END + 0x160, 248 | PLAYER_QUEST_LOG_16_5 = UnitField.UNIT_END + 0x168, 249 | PLAYER_QUEST_LOG_17_1 = UnitField.UNIT_END + 0x16C, 250 | PLAYER_QUEST_LOG_17_2 = UnitField.UNIT_END + 0x170, 251 | PLAYER_QUEST_LOG_17_3 = UnitField.UNIT_END + 0x174, 252 | PLAYER_QUEST_LOG_17_5 = UnitField.UNIT_END + 0x17C, 253 | PLAYER_QUEST_LOG_18_1 = UnitField.UNIT_END + 0x180, 254 | PLAYER_QUEST_LOG_18_2 = UnitField.UNIT_END + 0x184, 255 | PLAYER_QUEST_LOG_18_3 = UnitField.UNIT_END + 0x188, 256 | PLAYER_QUEST_LOG_18_5 = UnitField.UNIT_END + 0x190, 257 | PLAYER_QUEST_LOG_19_1 = UnitField.UNIT_END + 0x194, 258 | PLAYER_QUEST_LOG_19_2 = UnitField.UNIT_END + 0x198, 259 | PLAYER_QUEST_LOG_19_3 = UnitField.UNIT_END + 0x19C, 260 | PLAYER_QUEST_LOG_19_5 = UnitField.UNIT_END + 0x1A4, 261 | PLAYER_QUEST_LOG_20_1 = UnitField.UNIT_END + 0x1A8, 262 | PLAYER_QUEST_LOG_20_2 = UnitField.UNIT_END + 0x1AC, 263 | PLAYER_QUEST_LOG_20_3 = UnitField.UNIT_END + 0x1B0, 264 | PLAYER_QUEST_LOG_20_5 = UnitField.UNIT_END + 0x1B8, 265 | PLAYER_QUEST_LOG_21_1 = UnitField.UNIT_END + 0x1BC, 266 | PLAYER_QUEST_LOG_21_2 = UnitField.UNIT_END + 0x1C0, 267 | PLAYER_QUEST_LOG_21_3 = UnitField.UNIT_END + 0x1C4, 268 | PLAYER_QUEST_LOG_21_5 = UnitField.UNIT_END + 0x1CC, 269 | PLAYER_QUEST_LOG_22_1 = UnitField.UNIT_END + 0x1D0, 270 | PLAYER_QUEST_LOG_22_2 = UnitField.UNIT_END + 0x1D4, 271 | PLAYER_QUEST_LOG_22_3 = UnitField.UNIT_END + 0x1D8, 272 | PLAYER_QUEST_LOG_22_5 = UnitField.UNIT_END + 0x1E0, 273 | PLAYER_QUEST_LOG_23_1 = UnitField.UNIT_END + 0x1E4, 274 | PLAYER_QUEST_LOG_23_2 = UnitField.UNIT_END + 0x1E8, 275 | PLAYER_QUEST_LOG_23_3 = UnitField.UNIT_END + 0x1EC, 276 | PLAYER_QUEST_LOG_23_5 = UnitField.UNIT_END + 0x1F4, 277 | PLAYER_QUEST_LOG_24_1 = UnitField.UNIT_END + 0x1F8, 278 | PLAYER_QUEST_LOG_24_2 = UnitField.UNIT_END + 0x1FC, 279 | PLAYER_QUEST_LOG_24_3 = UnitField.UNIT_END + 0x200, 280 | PLAYER_QUEST_LOG_24_5 = UnitField.UNIT_END + 0x208, 281 | PLAYER_QUEST_LOG_25_1 = UnitField.UNIT_END + 0x20C, 282 | PLAYER_QUEST_LOG_25_2 = UnitField.UNIT_END + 0x210, 283 | PLAYER_QUEST_LOG_25_3 = UnitField.UNIT_END + 0x214, 284 | PLAYER_QUEST_LOG_25_5 = UnitField.UNIT_END + 0x21C, 285 | PLAYER_QUEST_LOG_26_1 = UnitField.UNIT_END + 0x220, 286 | PLAYER_QUEST_LOG_26_2 = UnitField.UNIT_END + 0x224, 287 | PLAYER_QUEST_LOG_26_3 = UnitField.UNIT_END + 0x228, 288 | PLAYER_QUEST_LOG_26_5 = UnitField.UNIT_END + 0x230, 289 | PLAYER_QUEST_LOG_27_1 = UnitField.UNIT_END + 0x234, 290 | PLAYER_QUEST_LOG_27_2 = UnitField.UNIT_END + 0x238, 291 | PLAYER_QUEST_LOG_27_3 = UnitField.UNIT_END + 0x23C, 292 | PLAYER_QUEST_LOG_27_5 = UnitField.UNIT_END + 0x244, 293 | PLAYER_QUEST_LOG_28_1 = UnitField.UNIT_END + 0x248, 294 | PLAYER_QUEST_LOG_28_2 = UnitField.UNIT_END + 0x24C, 295 | PLAYER_QUEST_LOG_28_3 = UnitField.UNIT_END + 0x250, 296 | PLAYER_QUEST_LOG_28_5 = UnitField.UNIT_END + 0x258, 297 | PLAYER_QUEST_LOG_29_1 = UnitField.UNIT_END + 0x25C, 298 | PLAYER_QUEST_LOG_29_2 = UnitField.UNIT_END + 0x260, 299 | PLAYER_QUEST_LOG_29_3 = UnitField.UNIT_END + 0x264, 300 | PLAYER_QUEST_LOG_29_5 = UnitField.UNIT_END + 0x26C, 301 | PLAYER_QUEST_LOG_30_1 = UnitField.UNIT_END + 0x270, 302 | PLAYER_QUEST_LOG_30_2 = UnitField.UNIT_END + 0x274, 303 | PLAYER_QUEST_LOG_30_3 = UnitField.UNIT_END + 0x278, 304 | PLAYER_QUEST_LOG_30_5 = UnitField.UNIT_END + 0x280, 305 | PLAYER_QUEST_LOG_31_1 = UnitField.UNIT_END + 0x284, 306 | PLAYER_QUEST_LOG_31_2 = UnitField.UNIT_END + 0x288, 307 | PLAYER_QUEST_LOG_31_3 = UnitField.UNIT_END + 0x28C, 308 | PLAYER_QUEST_LOG_31_5 = UnitField.UNIT_END + 0x294, 309 | PLAYER_QUEST_LOG_32_1 = UnitField.UNIT_END + 0x298, 310 | PLAYER_QUEST_LOG_32_2 = UnitField.UNIT_END + 0x29C, 311 | PLAYER_QUEST_LOG_32_3 = UnitField.UNIT_END + 0x2A0, 312 | PLAYER_QUEST_LOG_32_5 = UnitField.UNIT_END + 0x2A8, 313 | PLAYER_QUEST_LOG_33_1 = UnitField.UNIT_END + 0x2AC, 314 | PLAYER_QUEST_LOG_33_2 = UnitField.UNIT_END + 0x2B0, 315 | PLAYER_QUEST_LOG_33_3 = UnitField.UNIT_END + 0x2B4, 316 | PLAYER_QUEST_LOG_33_5 = UnitField.UNIT_END + 0x2BC, 317 | PLAYER_QUEST_LOG_34_1 = UnitField.UNIT_END + 0x2C0, 318 | PLAYER_QUEST_LOG_34_2 = UnitField.UNIT_END + 0x2C4, 319 | PLAYER_QUEST_LOG_34_3 = UnitField.UNIT_END + 0x2C8, 320 | PLAYER_QUEST_LOG_34_5 = UnitField.UNIT_END + 0x2D0, 321 | PLAYER_QUEST_LOG_35_1 = UnitField.UNIT_END + 0x2D4, 322 | PLAYER_QUEST_LOG_35_2 = UnitField.UNIT_END + 0x2D8, 323 | PLAYER_QUEST_LOG_35_3 = UnitField.UNIT_END + 0x2DC, 324 | PLAYER_QUEST_LOG_35_5 = UnitField.UNIT_END + 0x2E4, 325 | PLAYER_QUEST_LOG_36_1 = UnitField.UNIT_END + 0x2E8, 326 | PLAYER_QUEST_LOG_36_2 = UnitField.UNIT_END + 0x2EC, 327 | PLAYER_QUEST_LOG_36_3 = UnitField.UNIT_END + 0x2F0, 328 | PLAYER_QUEST_LOG_36_5 = UnitField.UNIT_END + 0x2F8, 329 | PLAYER_QUEST_LOG_37_1 = UnitField.UNIT_END + 0x2FC, 330 | PLAYER_QUEST_LOG_37_2 = UnitField.UNIT_END + 0x300, 331 | PLAYER_QUEST_LOG_37_3 = UnitField.UNIT_END + 0x304, 332 | PLAYER_QUEST_LOG_37_5 = UnitField.UNIT_END + 0x30C, 333 | PLAYER_QUEST_LOG_38_1 = UnitField.UNIT_END + 0x310, 334 | PLAYER_QUEST_LOG_38_2 = UnitField.UNIT_END + 0x314, 335 | PLAYER_QUEST_LOG_38_3 = UnitField.UNIT_END + 0x318, 336 | PLAYER_QUEST_LOG_38_5 = UnitField.UNIT_END + 0x320, 337 | PLAYER_QUEST_LOG_39_1 = UnitField.UNIT_END + 0x324, 338 | PLAYER_QUEST_LOG_39_2 = UnitField.UNIT_END + 0x328, 339 | PLAYER_QUEST_LOG_39_3 = UnitField.UNIT_END + 0x32C, 340 | PLAYER_QUEST_LOG_39_5 = UnitField.UNIT_END + 0x334, 341 | PLAYER_QUEST_LOG_40_1 = UnitField.UNIT_END + 0x338, 342 | PLAYER_QUEST_LOG_40_2 = UnitField.UNIT_END + 0x33C, 343 | PLAYER_QUEST_LOG_40_3 = UnitField.UNIT_END + 0x340, 344 | PLAYER_QUEST_LOG_40_5 = UnitField.UNIT_END + 0x348, 345 | PLAYER_QUEST_LOG_41_1 = UnitField.UNIT_END + 0x34C, 346 | PLAYER_QUEST_LOG_41_2 = UnitField.UNIT_END + 0x350, 347 | PLAYER_QUEST_LOG_41_3 = UnitField.UNIT_END + 0x354, 348 | PLAYER_QUEST_LOG_41_5 = UnitField.UNIT_END + 0x35C, 349 | PLAYER_QUEST_LOG_42_1 = UnitField.UNIT_END + 0x360, 350 | PLAYER_QUEST_LOG_42_2 = UnitField.UNIT_END + 0x364, 351 | PLAYER_QUEST_LOG_42_3 = UnitField.UNIT_END + 0x368, 352 | PLAYER_QUEST_LOG_42_5 = UnitField.UNIT_END + 0x370, 353 | PLAYER_QUEST_LOG_43_1 = UnitField.UNIT_END + 0x374, 354 | PLAYER_QUEST_LOG_43_2 = UnitField.UNIT_END + 0x378, 355 | PLAYER_QUEST_LOG_43_3 = UnitField.UNIT_END + 0x37C, 356 | PLAYER_QUEST_LOG_43_5 = UnitField.UNIT_END + 0x384, 357 | PLAYER_QUEST_LOG_44_1 = UnitField.UNIT_END + 0x388, 358 | PLAYER_QUEST_LOG_44_2 = UnitField.UNIT_END + 0x38C, 359 | PLAYER_QUEST_LOG_44_3 = UnitField.UNIT_END + 0x390, 360 | PLAYER_QUEST_LOG_44_5 = UnitField.UNIT_END + 0x398, 361 | PLAYER_QUEST_LOG_45_1 = UnitField.UNIT_END + 0x39C, 362 | PLAYER_QUEST_LOG_45_2 = UnitField.UNIT_END + 0x3A0, 363 | PLAYER_QUEST_LOG_45_3 = UnitField.UNIT_END + 0x3A4, 364 | PLAYER_QUEST_LOG_45_5 = UnitField.UNIT_END + 0x3AC, 365 | PLAYER_QUEST_LOG_46_1 = UnitField.UNIT_END + 0x3B0, 366 | PLAYER_QUEST_LOG_46_2 = UnitField.UNIT_END + 0x3B4, 367 | PLAYER_QUEST_LOG_46_3 = UnitField.UNIT_END + 0x3B8, 368 | PLAYER_QUEST_LOG_46_5 = UnitField.UNIT_END + 0x3C0, 369 | PLAYER_QUEST_LOG_47_1 = UnitField.UNIT_END + 0x3C4, 370 | PLAYER_QUEST_LOG_47_2 = UnitField.UNIT_END + 0x3C8, 371 | PLAYER_QUEST_LOG_47_3 = UnitField.UNIT_END + 0x3CC, 372 | PLAYER_QUEST_LOG_47_5 = UnitField.UNIT_END + 0x3D4, 373 | PLAYER_QUEST_LOG_48_1 = UnitField.UNIT_END + 0x3D8, 374 | PLAYER_QUEST_LOG_48_2 = UnitField.UNIT_END + 0x3DC, 375 | PLAYER_QUEST_LOG_48_3 = UnitField.UNIT_END + 0x3E0, 376 | PLAYER_QUEST_LOG_48_5 = UnitField.UNIT_END + 0x3E8, 377 | PLAYER_QUEST_LOG_49_1 = UnitField.UNIT_END + 0x3EC, 378 | PLAYER_QUEST_LOG_49_2 = UnitField.UNIT_END + 0x3F0, 379 | PLAYER_QUEST_LOG_49_3 = UnitField.UNIT_END + 0x3F4, 380 | PLAYER_QUEST_LOG_49_5 = UnitField.UNIT_END + 0x3FC, 381 | PLAYER_QUEST_LOG_50_1 = UnitField.UNIT_END + 0x400, 382 | PLAYER_QUEST_LOG_50_2 = UnitField.UNIT_END + 0x404, 383 | PLAYER_QUEST_LOG_50_3 = UnitField.UNIT_END + 0x408, 384 | PLAYER_QUEST_LOG_50_5 = UnitField.UNIT_END + 0x410, 385 | PLAYER_VISIBLE_ITEM_1_ENTRYID = UnitField.UNIT_END + 0x414, 386 | PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UnitField.UNIT_END + 0x418, 387 | PLAYER_VISIBLE_ITEM_2_ENTRYID = UnitField.UNIT_END + 0x41C, 388 | PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UnitField.UNIT_END + 0x420, 389 | PLAYER_VISIBLE_ITEM_3_ENTRYID = UnitField.UNIT_END + 0x424, 390 | PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UnitField.UNIT_END + 0x428, 391 | PLAYER_VISIBLE_ITEM_4_ENTRYID = UnitField.UNIT_END + 0x42C, 392 | PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UnitField.UNIT_END + 0x430, 393 | PLAYER_VISIBLE_ITEM_5_ENTRYID = UnitField.UNIT_END + 0x434, 394 | PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UnitField.UNIT_END + 0x438, 395 | PLAYER_VISIBLE_ITEM_6_ENTRYID = UnitField.UNIT_END + 0x43C, 396 | PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UnitField.UNIT_END + 0x440, 397 | PLAYER_VISIBLE_ITEM_7_ENTRYID = UnitField.UNIT_END + 0x444, 398 | PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UnitField.UNIT_END + 0x448, 399 | PLAYER_VISIBLE_ITEM_8_ENTRYID = UnitField.UNIT_END + 0x44C, 400 | PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UnitField.UNIT_END + 0x450, 401 | PLAYER_VISIBLE_ITEM_9_ENTRYID = UnitField.UNIT_END + 0x454, 402 | PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UnitField.UNIT_END + 0x458, 403 | PLAYER_VISIBLE_ITEM_10_ENTRYID = UnitField.UNIT_END + 0x45C, 404 | PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UnitField.UNIT_END + 0x460, 405 | PLAYER_VISIBLE_ITEM_11_ENTRYID = UnitField.UNIT_END + 0x464, 406 | PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UnitField.UNIT_END + 0x468, 407 | PLAYER_VISIBLE_ITEM_12_ENTRYID = UnitField.UNIT_END + 0x46C, 408 | PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UnitField.UNIT_END + 0x470, 409 | PLAYER_VISIBLE_ITEM_13_ENTRYID = UnitField.UNIT_END + 0x474, 410 | PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UnitField.UNIT_END + 0x478, 411 | PLAYER_VISIBLE_ITEM_14_ENTRYID = UnitField.UNIT_END + 0x47C, 412 | PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UnitField.UNIT_END + 0x480, 413 | PLAYER_VISIBLE_ITEM_15_ENTRYID = UnitField.UNIT_END + 0x484, 414 | PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UnitField.UNIT_END + 0x488, 415 | PLAYER_VISIBLE_ITEM_16_ENTRYID = UnitField.UNIT_END + 0x48C, 416 | PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UnitField.UNIT_END + 0x490, 417 | PLAYER_VISIBLE_ITEM_17_ENTRYID = UnitField.UNIT_END + 0x494, 418 | PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UnitField.UNIT_END + 0x498, 419 | PLAYER_VISIBLE_ITEM_18_ENTRYID = UnitField.UNIT_END + 0x49C, 420 | PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UnitField.UNIT_END + 0x4A0, 421 | PLAYER_VISIBLE_ITEM_19_ENTRYID = UnitField.UNIT_END + 0x4A4, 422 | PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UnitField.UNIT_END + 0x4A8, 423 | PLAYER_CHOSEN_TITLE = UnitField.UNIT_END + 0x4AC, 424 | PLAYER_FAKE_INEBRIATION = UnitField.UNIT_END + 0x4B0, 425 | PLAYER_FIELD_PAD_0 = UnitField.UNIT_END + 0x4B4, 426 | PLAYER_FIELD_INV_SLOT_HEAD = UnitField.UNIT_END + 0x4B8, 427 | PLAYER_FIELD_PACK_SLOT_1 = UnitField.UNIT_END + 0x570, 428 | PLAYER_FIELD_BANK_SLOT_1 = UnitField.UNIT_END + 0x5F0, 429 | PLAYER_FIELD_BANKBAG_SLOT_1 = UnitField.UNIT_END + 0x6D0, 430 | PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UnitField.UNIT_END + 0x708, 431 | PLAYER_FIELD_KEYRING_SLOT_1 = UnitField.UNIT_END + 0x768, 432 | PLAYER_FARSIGHT = UnitField.UNIT_END + 0x868, 433 | PLAYER__FIELD_KNOWN_TITLES = UnitField.UNIT_END + 0x870, 434 | PLAYER__FIELD_KNOWN_TITLES1 = UnitField.UNIT_END + 0x878, 435 | PLAYER__FIELD_KNOWN_TITLES2 = UnitField.UNIT_END + 0x880, 436 | PLAYER_XP = UnitField.UNIT_END + 0x888, 437 | PLAYER_NEXT_LEVEL_XP = UnitField.UNIT_END + 0x88C, 438 | PLAYER_SKILL_INFO_1_1 = UnitField.UNIT_END + 0x890, 439 | PLAYER_CHARACTER_POINTS = UnitField.UNIT_END + 0xE90, 440 | PLAYER_TRACK_CREATURES = UnitField.UNIT_END + 0xE94, 441 | PLAYER_TRACK_RESOURCES = UnitField.UNIT_END + 0xE98, 442 | PLAYER_BLOCK_PERCENTAGE = UnitField.UNIT_END + 0xE9C, 443 | PLAYER_DODGE_PERCENTAGE = UnitField.UNIT_END + 0xEA0, 444 | PLAYER_PARRY_PERCENTAGE = UnitField.UNIT_END + 0xEA4, 445 | PLAYER_EXPERTISE = UnitField.UNIT_END + 0xEA8, 446 | PLAYER_OFFHAND_EXPERTISE = UnitField.UNIT_END + 0xEAC, 447 | PLAYER_CRIT_PERCENTAGE = UnitField.UNIT_END + 0xEB0, 448 | PLAYER_RANGED_CRIT_PERCENTAGE = UnitField.UNIT_END + 0xEB4, 449 | PLAYER_OFFHAND_CRIT_PERCENTAGE = UnitField.UNIT_END + 0xEB8, 450 | PLAYER_SPELL_CRIT_PERCENTAGE1 = UnitField.UNIT_END + 0xEBC, 451 | PLAYER_SHIELD_BLOCK = UnitField.UNIT_END + 0xED8, 452 | PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UnitField.UNIT_END + 0xEDC, 453 | PLAYER_MASTERY = UnitField.UNIT_END + 0xEE0, 454 | PLAYER_EXPLORED_ZONES_1 = UnitField.UNIT_END + 0xEE4, 455 | PLAYER_REST_STATE_EXPERIENCE = UnitField.UNIT_END + 0x1124, 456 | PLAYER_FIELD_COINAGE = UnitField.UNIT_END + 0x1128, 457 | PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UnitField.UNIT_END + 0x1130, 458 | PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UnitField.UNIT_END + 0x114C, 459 | PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UnitField.UNIT_END + 0x1168, 460 | PLAYER_FIELD_MOD_HEALING_DONE_POS = UnitField.UNIT_END + 0x1184, 461 | PLAYER_FIELD_MOD_HEALING_PCT = UnitField.UNIT_END + 0x1188, 462 | PLAYER_FIELD_MOD_HEALING_DONE_PCT = UnitField.UNIT_END + 0x118C, 463 | PLAYER_FIELD_MOD_SPELL_POWER_PCT = UnitField.UNIT_END + 0x1190, 464 | PLAYER_FIELD_MOD_TARGET_RESISTANCE = UnitField.UNIT_END + 0x1194, 465 | PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UnitField.UNIT_END + 0x1198, 466 | PLAYER_FIELD_BYTES = UnitField.UNIT_END + 0x119C, 467 | PLAYER_SELF_RES_SPELL = UnitField.UNIT_END + 0x11A0, 468 | PLAYER_FIELD_PVP_MEDALS = UnitField.UNIT_END + 0x11A4, 469 | PLAYER_FIELD_BUYBACK_PRICE_1 = UnitField.UNIT_END + 0x11A8, 470 | PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UnitField.UNIT_END + 0x11D8, 471 | PLAYER_FIELD_KILLS = UnitField.UNIT_END + 0x1208, 472 | PLAYER_FIELD_LIFETIME_HONORBALE_KILLS = UnitField.UNIT_END + 0x120C, 473 | PLAYER_FIELD_BYTES2 = UnitField.UNIT_END + 0x1210, 474 | PLAYER_FIELD_WATCHED_FACTION_INDEX = UnitField.UNIT_END + 0x1214, 475 | PLAYER_FIELD_COMBAT_RATING_1 = UnitField.UNIT_END + 0x1218, 476 | PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UnitField.UNIT_END + 0x1280, 477 | PLAYER_FIELD_BATTLEGROUND_RATING = UnitField.UNIT_END + 0x12D4, 478 | PLAYER_FIELD_MAX_LEVEL = UnitField.UNIT_END + 0x12D8, 479 | PLAYER_FIELD_DAILY_QUESTS_1 = UnitField.UNIT_END + 0x12DC, 480 | PLAYER_RUNE_REGEN_1 = UnitField.UNIT_END + 0x1340, 481 | PLAYER_NO_REAGENT_COST_1 = UnitField.UNIT_END + 0x1350, 482 | PLAYER_FIELD_GLYPH_SLOTS_1 = UnitField.UNIT_END + 0x135C, 483 | PLAYER_FIELD_GLYPHS_1 = UnitField.UNIT_END + 0x1380, 484 | PLAYER_GLYPHS_ENABLED = UnitField.UNIT_END + 0x13A4, 485 | PLAYER_PET_SPELL_POWER = UnitField.UNIT_END + 0x13A8, 486 | PLAYER_FIELD_RESEARCHING_1 = UnitField.UNIT_END + 0x13AC, 487 | PLAYER_FIELD_RESERACH_SITE_1 = UnitField.UNIT_END + 0x13CC, 488 | PLAYER_PROFESSION_SKILL_LINE_1 = UnitField.UNIT_END + 0x13EC, 489 | PLAYER_FIELD_UI_HIT_MODIFIER = UnitField.UNIT_END + 0x13F4, 490 | PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = UnitField.UNIT_END + 0x13F8, 491 | PLAYER_FIELD_HOME_REALM_TIME_OFFSET = UnitField.UNIT_END + 0x13FC, 492 | PLAYER_END = UnitField.UNIT_END + 0x1400 493 | } 494 | 495 | // Descriptors: 0x00C14890 496 | public enum ContainerField : uint 497 | { 498 | CONTAINER_FIELD_NUM_SLOTS = ItemField.ITEM_END + 0x0, 499 | CONTAINER_ALIGN_PAD = ItemField.ITEM_END + 0x4, 500 | CONTAINER_FIELD_SLOT_1 = ItemField.ITEM_END + 0x8, 501 | CONTAINER_END = ItemField.ITEM_END + 0x128 502 | } 503 | 504 | // Descriptors: 0x00C16958 505 | public enum GameObjectField : uint 506 | { 507 | GAMEOBJECT_DISPLAYID = ObjectField.OBJECT_END + 0x8, 508 | GAMEOBJECT_FLAGS = ObjectField.OBJECT_END + 0xC, 509 | GAMEOBJECT_PARENTROTATION = ObjectField.OBJECT_END + 0x10, 510 | GAMEOBJECT_DYNAMIC = ObjectField.OBJECT_END + 0x20, 511 | GAMEOBJECT_FACTION = ObjectField.OBJECT_END + 0x24, 512 | GAMEOBJECT_LEVEL = ObjectField.OBJECT_END + 0x28, 513 | GAMEOBJECT_BYTES_1 = ObjectField.OBJECT_END + 0x2C, 514 | GAMEOBJECT_END = ObjectField.OBJECT_END + 0x30 515 | } 516 | 517 | // Descriptors: 0x00C169F8 518 | public enum DynamicObjectField : uint 519 | { 520 | DYNAMICOBJECT_CASTER = ObjectField.OBJECT_END + 0x0, 521 | DYNAMICOBJECT_BYTES = ObjectField.OBJECT_END + 0x8, 522 | DYNAMICOBJECT_SPELLID = ObjectField.OBJECT_END + 0xC, 523 | DYNAMICOBJECT_RADIUS = ObjectField.OBJECT_END + 0x10, 524 | DYNAMICOBJECT_CASTTIME = ObjectField.OBJECT_END + 0x14, 525 | DYNAMICOBJECT_END = ObjectField.OBJECT_END + 0x18 526 | } 527 | 528 | // Descriptors: 0x00C16A60 529 | public enum CorpseField : uint 530 | { 531 | CORPSE_FIELD_OWNER = ObjectField.OBJECT_END + 0x0, 532 | CORPSE_FIELD_PARTY = ObjectField.OBJECT_END + 0x8, 533 | CORPSE_FIELD_DISPLAY_ID = ObjectField.OBJECT_END + 0x10, 534 | CORPSE_FIELD_ITEM = ObjectField.OBJECT_END + 0x14, 535 | CORPSE_FIELD_BYTES_1 = ObjectField.OBJECT_END + 0x60, 536 | CORPSE_FIELD_BYTES_2 = ObjectField.OBJECT_END + 0x64, 537 | CORPSE_FIELD_FLAGS = ObjectField.OBJECT_END + 0x68, 538 | CORPSE_FIELD_DYNAMIC_FLAGS = ObjectField.OBJECT_END + 0x6C, 539 | CORPSE_END = ObjectField.OBJECT_END + 0x70 540 | } 541 | 542 | 543 | } 544 | --------------------------------------------------------------------------------