示例#1
0
 private void Refresh(BlackMagic w) {
     UInt64 PartyMember1GUID = 0;
     UInt64 PartyMember2GUID = 0;
     UInt64 PartyMember3GUID = 0;
     UInt64 PartyMember4GUID = 0;
     try {
         PartyMember1GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember1GUID);
         PartyMember2GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember2GUID);
         PartyMember3GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember3GUID);
         PartyMember4GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember4GUID);
     }
     catch {
         Program.WowPrinter.Print(ConstStrings.ReadError);
     }
     finally {
         if (PartyMember1GUID != 0) {
             Party.Add(PartyMember1GUID);
             if (PartyMember2GUID != 0) {
                 Party.Add(PartyMember2GUID);
                 if (PartyMember3GUID != 0) {
                     Party.Add(PartyMember3GUID);
                     if (PartyMember4GUID != 0) {
                         Party.Add(PartyMember4GUID);
                     }
                 }
             }
         }
     }
 }
示例#2
0
        static void Main(string[] args) {
            //Open the proccess
            wow = new BlackMagic();
            wow.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle(PROCESS_WINDOW_TITLE));
            //Setup Object Manager and First object base address
            ObjMgrAddr = wow.ReadUInt(wow.ReadUInt((uint)wow.MainModule.BaseAddress + (uint)Constants.Const.ObjectManager.CurMgrPointer) + (uint)Constants.Const.ObjectManager.CurMgrOffset);
            FirstObject = new GameObject(wow.ReadUInt(ObjMgrAddr + (uint)Constants.Const.ObjectManager.FirstObject));
            //Read TargetGUID from globals and find in the Object Manager
            //UInt64 CurrTargetGUID = wow.ReadUInt64((uint)wow.MainModule.BaseAddress + (uint)Const.Globals.CurrentTargetGUID);
            UInt64 CurrTargetGUID = wow.ReadUInt64((uint)wow.MainModule.BaseAddress + (uint)Constants.Const.Globals.CurrentTargetGUID);
            PlayerObject = new GameObject(wow.ReadUInt64((uint)wow.MainModule.BaseAddress + (uint)Constants.Const.Globals.PlayerGUID));
            TargetObject = new GameObject(CurrTargetGUID);
            PlayerObject.Wowclass = wow.ReadByte(PlayerObject.DescriptorArrayAddress + (uint)Const.descriptors.Class8);

            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Interval = 100;
            if (PlayerObject.Wowclass == 9) {
                Console.WriteLine("Initiate Affliction Warlock DPS BOT v1.0");
                aTimer.Elapsed += WarlockDPS.DpsEvent;
            }
            else if (PlayerObject.Wowclass == 11) {
                Console.WriteLine("Initiate Feral Druid DPS BOT v0.1");
                aTimer.Elapsed += DruidDPS.DpsEvent;
            }
            aTimer.AutoReset = true;
            aTimer.Enabled = true;
            while (true) {
                switch (Console.ReadLine()) {
                    case "stop":
                        Console.WriteLine("STOP");
                        aTimer.Elapsed -= DruidDPS.DpsEvent;
                        aTimer.Elapsed -= WarlockDPS.DpsEvent;
                        aTimer.Elapsed -= PrinterEvent;
                        break;
                    case "printer":
                        aTimer.Elapsed += PrinterEvent;
                        break;
                    case "start":
                        if (PlayerObject.Wowclass == 9) {
                            Console.WriteLine("Initiate Affliction Warlock DPS BOT v1.0");
                            aTimer.Elapsed += WarlockDPS.DpsEvent;
                        }
                        else if (PlayerObject.Wowclass == 11) {
                            Console.WriteLine("Initiate Feral Druid DPS BOT v0.1");
                            aTimer.Elapsed += DruidDPS.DpsEvent;
                        }
                        break;
                }
            }
        }
示例#3
0
 private void Refresh(BlackMagic w) {
     Raidmembercount = w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.RaidMembers.TotalNumber);
     RaidMembers.Clear();
     for (uint i = 0; i < Raidmembercount; i++) {
         uint tempaddr=w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.RaidMembers.FirstRaidMemberAddress + i*(uint)ConstOffsets.RaidMembers.NextRaidMemberAddres);
         RaidMembers.Add(w.ReadUInt64(tempaddr));
     }
 }
示例#4
0
        public void Refresh(BlackMagic w) {
            try {
                this.PlayerGUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PlayerGUID);
                this.TargetGUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.CurrentTargetGUID);
                this.FocusGUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.FocusTargetGUID);
                this.ComboPoints = w.ReadByte((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.ComboPoints);
                this.SpellIsPending = !(w.ReadByte((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.SpellIsPending) == 0);
                this.runes = w.ReadByte((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.Runes);
                this.Markers = new MarkerGUIDs(w.ReadBytes((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.Markers,64));
            }
            catch {

            }
        }
        public static Structs.PatternList FindPatternList(Structs.PatternList patternList)
        {
            Structs.PatternList newPatternList = new Structs.PatternList();
            newPatternList.processName = patternList.processName;
            uint baseModule = 0;

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

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

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

                        if (offset > 0)
                        {
                            // Dump offset
                            p.offset = offset.ToString("X");
                            p.offsetDec = offset;
                            p.offsetUsedAtDec = (uint)((int)dwCodeLoc + p.offsetLocation);
                            p.offsetUsedAt = ((int)dwCodeLoc + p.offsetLocation).ToString("X");
                            try
                            {
                                switch (p.type)
                                {
                                    case "int64":
                                        p.value = Convert.ToString(memread.ReadUInt64(p.offsetDec));
                                        break;
                                    case "int":
                                        p.value = Convert.ToString(memread.ReadInt(p.offsetDec));
                                        break;
                                    case "float":
                                        p.value = Convert.ToString(memread.ReadFloat(p.offsetDec));
                                        break;
                                    case "string":
                                        p.value = Convert.ToString(memread.ReadASCIIString(p.offsetDec, 30));
                                        break;
                                }
                            }
                            catch { p.value = "No Found"; }
                        }
                        else
                            p.offset = "No Found";

                    }
                    catch
                    { p.offset = "No Found"; }
                    newPatternList.Patterns.Add(p);
                }
                memread.Close();
            }
            else
            {
                MessageBox.Show("Process no found.");
            }
            return patternList;
        }
示例#6
0
 public GameObject(BlackMagic w, UIntPtr baddr) {
     try {
         this.BaseAddress = baddr;
         this.GUID = w.ReadUInt64((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalGUID);
         this.descriptorArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalDescriptorArray) + 0x10;
         this.BuffBigArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalBuffBigArray) + 0x4;
         this.BuffSmallArrayAddress = (UIntPtr)((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalBuffSmallArray);
         this.MovementArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalMovementArray);
         this.Unit = new WoWUnit();
     }
     catch {
         //Program.WowPrinter.Print(ConstStrings.GameObjectConstructorError);
         this.Unit = new WoWUnit();
     }
 }
示例#7
0
        public void Refresh(BlackMagic w, GameObject go) {
            try {
                this.WowClass = (WoWClass)w.ReadByte((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Class8);
                this.Shapeshift = (ShapeshiftForm)w.ReadByte((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.ShapeShift);
                this.Role = Role.Unknown;

                this.Level = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Level);
                this.Health = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Health);
                this.MaxHealth = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.MaxHealth);
                this.Power = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Power);
                this.MaxPower = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.MaxPower);
                this.SecondaryPower = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.SecondaryPower);
                this.MovingInfo = new MovementFlags(w.ReadByte((uint)go.MovementArrayAddress + (uint)ConstOffsets.Movements.IsMoving8));
                this.HolyPower = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.HolyPower);
                this.Faction = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Faction);
                this.TargetGUID = w.ReadUInt64((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.TargetGUID);
                //byte temp = w.ReadByte((uint)go.BuffSmallArrayAddress + (uint)ConstOffsets.Descriptors.IsinCombat);
                this.IsInCombat = (w.ReadByte((w.ReadUInt((uint)go.BaseAddress + (uint)ConstOffsets.Movements.IsinCombatOffset1)) + (uint)ConstOffsets.Movements.IsinCombatOffset2+2)& 0x8)!=0;
                this.position.X = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.X);
                this.position.Y = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Y);
                this.position.Z = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Z);

                this.CastingSpellID = w.ReadUInt((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.IsCasting);
                this.ChannelingSpellID = w.ReadUInt((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.ChanneledCasting);
                this.BalancePower = w.ReadInt((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.BalancePower);
                //this.BalanceStance = (BalanceFlag)(w.ReadByte((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.BalanceState) & 0x01);
                float temprot = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Rotation);

                if (temprot > Math.PI) {
                    this.Rotation = -(2 * Math.PI - temprot);
                }
                else {
                    this.Rotation = temprot;
                }
                this.RefreshBuffs(w, go);
            }
            catch {

            }

            //this.Position = new Vector3(x,y,z);
        }