コード例 #1
0
 public Lua(Magic.BlackMagic magic)
 {
     _magic  = magic;
     State   = GetState();
     LastArg = GetTop();
 }
コード例 #2
0
        internal static string Go(string prefixEnum, bool multiply)
        {
            try
            {
                // Open Process
                OpenFileDialog ChooseFile = new OpenFileDialog();
                ChooseFile.Filter = "Executable Wow (*.exe)|*.exe|All files (*.*)|*.*";
                ChooseFile.ShowDialog();
                if (ChooseFile.FileName == "")
                    return "";
                if (!File.Exists(ChooseFile.FileName))
                    return "Executable not found.";
                ProcessStartInfo processInfo = new ProcessStartInfo(@ChooseFile.FileName);
                Process myProcess = Process.Start(processInfo);
                Thread.Sleep(700);
                /*
                Process[] processesByNameList = Process.GetProcessesByName("Wow");
                if (processesByNameList.Length <= 0)
                    return "Process not found.";
                myProcess = processesByNameList[0];
                 */
                memory = new Magic.BlackMagic(myProcess.Id);
                if (!memory.IsProcessOpen)
                    return "Process not open.";

                // Check function
                uint dwStartFunc;
                dwStartFunc = memory.FindPattern("56 57 68 00 00 00 00 B8 06", "xxx????xx"); // Wow > 4.0.0
                if (dwStartFunc <= 0)
                    dwStartFunc = memory.FindPattern("56 57 68 00 00 00 00 B8 05", "xxx????xx"); // Wow < 4.0.0
                if (dwStartFunc <= 0)
                {
                    memory.Close();
                    myProcess.Kill();
                    myProcess.Close();
                    return "Descriptors function not found.";
                }

                // Get base adresse of all Field.
                uint s_objectDescriptors, s_unitDescriptors, s_itemDescriptors, s_playerDescriptors, s_containerDescriptors, s_gameobjectDescriptors, s_dynamicobjectDescriptors, s_corpseDescriptors;
                s_objectDescriptors = memory.ReadUInt(dwStartFunc + 0xD);
                s_itemDescriptors = memory.ReadUInt(dwStartFunc + 0x32);
                s_containerDescriptors = memory.ReadUInt(dwStartFunc + 0x57);
                s_unitDescriptors = memory.ReadUInt(dwStartFunc + 0x7C);
                s_playerDescriptors = memory.ReadUInt(dwStartFunc + 0xA1);
                s_gameobjectDescriptors = memory.ReadUInt(dwStartFunc + 0xC6);
                s_dynamicobjectDescriptors = memory.ReadUInt(dwStartFunc + 0xEB);
                s_corpseDescriptors = memory.ReadUInt(dwStartFunc + 0x110);
                if (s_objectDescriptors <= 0 || s_itemDescriptors <= 0 || s_containerDescriptors <= 0 || s_unitDescriptors <= 0 || s_playerDescriptors <= 0 || s_gameobjectDescriptors <= 0 || s_dynamicobjectDescriptors <= 0 || s_corpseDescriptors <= 0)
                {
                    memory.Close();
                    myProcess.Kill();
                    myProcess.Close();
                    return "Field not found.";
                }

                // Get Field
                string retVal = "";
                uint OBJECT_END = 0;
                uint UNIT_END = 0;
                uint ITEM_END = 0;
                uint PLAYER_END = 0;
                uint CONTAINER_END = 0;
                uint GAMEOBJECT_END = 0;
                uint DYNAMICOBJECT_END = 0;
                uint CORPSE_END = 0;

                retVal = retVal + DumpField("ObjectFields", "OBJECT", s_objectDescriptors, 0, out OBJECT_END, prefixEnum, multiply);
                retVal = retVal + DumpField("UnitFields", "UNIT", s_unitDescriptors, OBJECT_END, out UNIT_END, prefixEnum, multiply);
                UNIT_END = UNIT_END + OBJECT_END;
                retVal = retVal + DumpField("ItemFields", "ITEM", s_itemDescriptors, OBJECT_END, out ITEM_END, prefixEnum, multiply);
                ITEM_END = ITEM_END + OBJECT_END;
                retVal = retVal + DumpField("PlayerFields", "PLAYER", s_playerDescriptors, UNIT_END, out PLAYER_END, prefixEnum, multiply);
                PLAYER_END = PLAYER_END + UNIT_END;
                retVal = retVal + DumpField("ContainerFields", "CONTAINER", s_containerDescriptors, ITEM_END, out CONTAINER_END, prefixEnum, multiply);
                CONTAINER_END = CONTAINER_END + ITEM_END;
                retVal = retVal + DumpField("GameObjectFields", "GAMEOBJECT", s_gameobjectDescriptors, OBJECT_END, out GAMEOBJECT_END, prefixEnum, multiply);
                GAMEOBJECT_END = GAMEOBJECT_END + OBJECT_END;
                retVal = retVal + DumpField("DynamicObjectFields", "DYNAMICOBJECT", s_dynamicobjectDescriptors, OBJECT_END, out DYNAMICOBJECT_END, prefixEnum, multiply);
                DYNAMICOBJECT_END = DYNAMICOBJECT_END + OBJECT_END;
                retVal = retVal + DumpField("CorpseFields", "CORPSE", s_corpseDescriptors, OBJECT_END, out CORPSE_END, prefixEnum, multiply);
                CORPSE_END = CORPSE_END + OBJECT_END;

                // Dispose Process
                memory.Close();
                myProcess.Kill();
                myProcess.Close();
                // Return value
                return retVal;
            }
            catch (Exception e)
            {
                return e + Environment.NewLine + Environment.NewLine + " Exception caught.";
            }
        }
コード例 #3
0
        internal static string Go(string prefixEnum, bool multiply)
        {
            try
            {
                // Open Process
                OpenFileDialog ChooseFile = new OpenFileDialog();
                ChooseFile.Filter = "Executable Wow (*.exe)|*.exe|All files (*.*)|*.*";
                ChooseFile.ShowDialog();
                if (ChooseFile.FileName == "")
                {
                    return("");
                }
                if (!File.Exists(ChooseFile.FileName))
                {
                    return("Executable not found.");
                }
                ProcessStartInfo processInfo = new ProcessStartInfo(@ChooseFile.FileName);
                Process          myProcess   = Process.Start(processInfo);
                Thread.Sleep(700);

                /*
                 * Process[] processesByNameList = Process.GetProcessesByName("Wow");
                 * if (processesByNameList.Length <= 0)
                 *  return "Process not found.";
                 * myProcess = processesByNameList[0];
                 */
                memory = new Magic.BlackMagic(myProcess.Id);
                if (!memory.IsProcessOpen)
                {
                    return("Process not open.");
                }

                // Check function
                uint dwStartFunc;
                dwStartFunc = memory.FindPattern("56 57 68 00 00 00 00 B8 06", "xxx????xx"); // Wow > 4.0.0
                if (dwStartFunc <= 0)
                {
                    dwStartFunc = memory.FindPattern("56 57 68 00 00 00 00 B8 05", "xxx????xx"); // Wow < 4.0.0
                }
                if (dwStartFunc <= 0)
                {
                    memory.Close();
                    myProcess.Kill();
                    myProcess.Close();
                    return("Descriptors function not found.");
                }

                // Get base adresse of all Field.
                uint s_objectDescriptors, s_unitDescriptors, s_itemDescriptors, s_playerDescriptors, s_containerDescriptors, s_gameobjectDescriptors, s_dynamicobjectDescriptors, s_corpseDescriptors;
                s_objectDescriptors        = memory.ReadUInt(dwStartFunc + 0xD);
                s_itemDescriptors          = memory.ReadUInt(dwStartFunc + 0x32);
                s_containerDescriptors     = memory.ReadUInt(dwStartFunc + 0x57);
                s_unitDescriptors          = memory.ReadUInt(dwStartFunc + 0x7C);
                s_playerDescriptors        = memory.ReadUInt(dwStartFunc + 0xA1);
                s_gameobjectDescriptors    = memory.ReadUInt(dwStartFunc + 0xC6);
                s_dynamicobjectDescriptors = memory.ReadUInt(dwStartFunc + 0xEB);
                s_corpseDescriptors        = memory.ReadUInt(dwStartFunc + 0x110);
                if (s_objectDescriptors <= 0 || s_itemDescriptors <= 0 || s_containerDescriptors <= 0 || s_unitDescriptors <= 0 || s_playerDescriptors <= 0 || s_gameobjectDescriptors <= 0 || s_dynamicobjectDescriptors <= 0 || s_corpseDescriptors <= 0)
                {
                    memory.Close();
                    myProcess.Kill();
                    myProcess.Close();
                    return("Field not found.");
                }

                // Get Field
                string retVal            = "";
                uint   OBJECT_END        = 0;
                uint   UNIT_END          = 0;
                uint   ITEM_END          = 0;
                uint   PLAYER_END        = 0;
                uint   CONTAINER_END     = 0;
                uint   GAMEOBJECT_END    = 0;
                uint   DYNAMICOBJECT_END = 0;
                uint   CORPSE_END        = 0;

                retVal            = retVal + DumpField("ObjectFields", "OBJECT", s_objectDescriptors, 0, out OBJECT_END, prefixEnum, multiply);
                retVal            = retVal + DumpField("UnitFields", "UNIT", s_unitDescriptors, OBJECT_END, out UNIT_END, prefixEnum, multiply);
                UNIT_END          = UNIT_END + OBJECT_END;
                retVal            = retVal + DumpField("ItemFields", "ITEM", s_itemDescriptors, OBJECT_END, out ITEM_END, prefixEnum, multiply);
                ITEM_END          = ITEM_END + OBJECT_END;
                retVal            = retVal + DumpField("PlayerFields", "PLAYER", s_playerDescriptors, UNIT_END, out PLAYER_END, prefixEnum, multiply);
                PLAYER_END        = PLAYER_END + UNIT_END;
                retVal            = retVal + DumpField("ContainerFields", "CONTAINER", s_containerDescriptors, ITEM_END, out CONTAINER_END, prefixEnum, multiply);
                CONTAINER_END     = CONTAINER_END + ITEM_END;
                retVal            = retVal + DumpField("GameObjectFields", "GAMEOBJECT", s_gameobjectDescriptors, OBJECT_END, out GAMEOBJECT_END, prefixEnum, multiply);
                GAMEOBJECT_END    = GAMEOBJECT_END + OBJECT_END;
                retVal            = retVal + DumpField("DynamicObjectFields", "DYNAMICOBJECT", s_dynamicobjectDescriptors, OBJECT_END, out DYNAMICOBJECT_END, prefixEnum, multiply);
                DYNAMICOBJECT_END = DYNAMICOBJECT_END + OBJECT_END;
                retVal            = retVal + DumpField("CorpseFields", "CORPSE", s_corpseDescriptors, OBJECT_END, out CORPSE_END, prefixEnum, multiply);
                CORPSE_END        = CORPSE_END + OBJECT_END;

                // Dispose Process
                memory.Close();
                myProcess.Kill();
                myProcess.Close();
                // Return value
                return(retVal);
            }
            catch (Exception e)
            {
                return(e + Environment.NewLine + Environment.NewLine + " Exception caught.");
            }
        }
コード例 #4
0
        internal static string Go(string prefixEnum = "", bool multiply = true, bool upper = true, bool remLocal = true)
        {
            try
            {
                var p = Process.GetProcessesByName("WoW");
                if (p.Length <= 0)
                {
                    p = Process.GetProcessesByName("WowT");
                }
                if (p.Length <= 0)
                {
                    p = Process.GetProcessesByName("WowB");
                }
                if (p.Length <= 0)
                {
                    return("Wow process not found.");
                }
                _memory = new Magic.BlackMagic(p[0].Id);
                if (!_memory.IsProcessOpen)
                {
                    return("Process not open.");
                }

                // Check function
                /* 2F8F51 */
                uint dwStartFunc = _memory.FindPattern("53 56 57 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00 00 6A 00 5B 53 6A",
                                                       "xxxx????x????x????x????x????x????x????x????x????x????x????x????x????x????x????x????x?xxx");
                if (dwStartFunc <= 0)
                {
                    _memory.Close();
                    return("Descriptors function not found.");
                }

                /*uint baseObjectDescriptorsPointer = _memory.FindPattern("8B 4D FC 33 C0 40 C7 81", "xxxxxxxx");
                 * if (baseObjectDescriptorsPointer <= 0)
                 * {
                 *  _memory.Close();
                 *  return "Base_CGObjectData not found.";
                 * }*/

                // Get base adresse of all Field.
                uint s_objectDescriptors, s_unitDescriptors, s_itemDescriptors, s_playerDescriptors, s_containerDescriptors, s_gameobjectDescriptors, s_dynamicObjectDescriptors, s_corpseDescriptors, s_areaTriggerDescriptors, s_sceneObjectDescriptors, s_itemDynamicData, s_unitDynamicData, s_playerDynamicData, s_conversationData, s_conversationDynamicData;
                s_objectDescriptors        = _memory.ReadUInt(dwStartFunc + 0x53 + 1); //s_objectDescriptors = _memory.ReadUInt(dwStartFunc + 0x1 + 0x55);
                s_itemDescriptors          = _memory.ReadUInt(dwStartFunc + 0x1 + 0x6B);
                s_containerDescriptors     = _memory.ReadUInt(dwStartFunc + 0x1 + 0x81);
                s_unitDescriptors          = _memory.ReadUInt(dwStartFunc + 0x1 + 0x99);
                s_playerDescriptors        = _memory.ReadUInt(dwStartFunc + 0x1 + 0xB1);
                s_gameobjectDescriptors    = _memory.ReadUInt(dwStartFunc + 0x1 + 0xCB);
                s_dynamicObjectDescriptors = _memory.ReadUInt(dwStartFunc + 0x1 + 0xE3);
                s_corpseDescriptors        = _memory.ReadUInt(dwStartFunc + 0x1 + 0xF8);
                s_areaTriggerDescriptors   = _memory.ReadUInt(dwStartFunc + 0x1 + 0x10D);
                s_sceneObjectDescriptors   = _memory.ReadUInt(dwStartFunc + 0x1 + 0x122);
                s_itemDynamicData          = _memory.ReadUInt(dwStartFunc + 0x1 + 0x162);
                s_unitDynamicData          = _memory.ReadUInt(dwStartFunc + 0x1 + 0x17B);
                s_playerDynamicData        = _memory.ReadUInt(dwStartFunc + 0x1 + 0x194);
                // WoD new:
                s_conversationData        = _memory.ReadUInt(dwStartFunc + 0x1 + 0x137);
                s_conversationDynamicData = _memory.ReadUInt(dwStartFunc + 0x1 + 0x1CE);


                const int g_baseObjDescriptors = 0xEBEFF0; // CGObjectData
                s_objectDescriptors = g_baseObjDescriptors;

                const int g_baseItemDescriptors = 0xEBF080; // CGItemData
                s_itemDescriptors = g_baseItemDescriptors;

                const int g_baseContainerDescriptors = 0xEBFAD8; // CGContainerData
                s_containerDescriptors = g_baseContainerDescriptors;

                const int g_baseUnitDescriptors = 0xEBFAE8; // CGUnitData
                s_unitDescriptors = g_baseUnitDescriptors;

                const int g_basePlayerDescriptors = 0xEC0460; // CGPlayerData
                s_playerDescriptors = g_basePlayerDescriptors;

                const int g_baseGameObjectDescriptors = 0xECCF18; // CGGameObjectData
                s_gameobjectDescriptors = g_baseGameObjectDescriptors;

                const int g_baseDynamicObjectDescriptors = 0xECD020; // CGDynamicObjectData
                s_dynamicObjectDescriptors = g_baseDynamicObjectDescriptors;

                const int g_baseCorpseDescriptors = 0xECD090; // CGCorpseData
                s_corpseDescriptors = g_baseCorpseDescriptors;

                const int g_baseAreaTriggerDescriptors = 0xECD2D0; // CGAreaTriggerData
                s_areaTriggerDescriptors = g_baseAreaTriggerDescriptors;

                const int g_baseSceneObjectDescriptors = 0xECD3A0; // CGSceneObjectData
                s_sceneObjectDescriptors = g_baseSceneObjectDescriptors;

                const int g_baseConversationDescriptors = 0xEBF40C; // CGConversationData
                s_itemDynamicData = g_baseConversationDescriptors;

                const int g_baseItemDynamicDescriptors = 0xEBF3EC; // CGItemDynamicData
                s_unitDynamicData = g_baseItemDynamicDescriptors;

                const int g_baseUnitDynamicDescriptors = 0xEC0448; // CGUnitDynamicData
                s_playerDynamicData = g_baseUnitDynamicDescriptors;

                const int g_basePlayerDynamicDescriptors = 0xECCEB0; // CGPlayerDynamicData
                s_conversationData = g_basePlayerDynamicDescriptors;

                const int g_baseGameObjectDynamicDescriptors = 0xECD014; // CGGameObjectDynamicData
                s_conversationDynamicData = g_baseGameObjectDynamicDescriptors;


                const int g_baseConversationDynamicDescriptors = 0xECD3F4; // CGConversationDynamicData
                if (s_objectDescriptors <= 0 || s_itemDescriptors <= 0 || s_containerDescriptors <= 0 || s_unitDescriptors <= 0 || s_playerDescriptors <= 0 || s_gameobjectDescriptors <= 0 || s_dynamicObjectDescriptors <= 0 || s_corpseDescriptors <= 0 || s_areaTriggerDescriptors <= 0 || s_sceneObjectDescriptors <= 0 || s_itemDynamicData <= 0 || s_unitDynamicData <= 0 || s_playerDynamicData <= 0 || s_conversationData <= 0 || s_conversationDynamicData <= 0)
                {
                    _memory.Close();
                    return("Field not found.");
                }

                // Get Field
                string retVal = "";
                uint   objectEndObjectFields;
                uint   objectEndItemFields;
                uint   objectEndContainerFields;
                uint   objectEndUnitFields;
                uint   objectEndPlayerFields;
                uint   objectEndGameObjectFields;
                uint   objectEndDynamicObjectFields;
                uint   objectEndCorpseFields;
                uint   objectEndAreaTriggerFields;
                uint   objectEndSceneObjecFields, objectEndConversationData, objectEndItemDynamicFields, objectEndUnitDynamicFields, objectEndPlayerDynamicFields, objectEndConversationDynamicData;

                retVal = retVal + DumpField("ObjectFields", "CGObjectData::m_", s_objectDescriptors, 0, out objectEndObjectFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("ItemFields", "CGItemData::m_", s_itemDescriptors, objectEndObjectFields, out objectEndItemFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("ContainerFields", "CGContainerData::m_", s_containerDescriptors, objectEndItemFields, out objectEndContainerFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("UnitFields", "CGUnitData::", s_unitDescriptors, objectEndObjectFields, out objectEndUnitFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("PlayerFields", "CGPlayerData::", s_playerDescriptors, objectEndUnitFields, out objectEndPlayerFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("GameObjectFields", "CGGameObjectData::m_", s_gameobjectDescriptors, objectEndObjectFields, out objectEndGameObjectFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("DynamicObjectFields", "CGDynamicObjectData::m_", s_dynamicObjectDescriptors, objectEndObjectFields, out objectEndDynamicObjectFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("CorpseFields", "CGCorpseData::m_", s_corpseDescriptors, objectEndObjectFields, out objectEndCorpseFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("AreaTriggerFields", "CGAreaTriggerData::m_", s_areaTriggerDescriptors, objectEndObjectFields, out objectEndAreaTriggerFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("SceneObjectFields", "CGSceneObjectData::m_", s_sceneObjectDescriptors, objectEndObjectFields, out objectEndSceneObjecFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("ConversationData", "CGConversationData::", s_conversationData, objectEndObjectFields, out objectEndConversationData, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("ItemDynamicFields", "CGItemDynamicData::m_", s_itemDynamicData, objectEndObjectFields, out objectEndItemDynamicFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("UnitDynamicFields", "CGUnitDynamicData::m_", s_unitDynamicData, objectEndObjectFields, out objectEndUnitDynamicFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("PlayerDynamicFields", "CGPlayerDynamicData::m_", s_playerDynamicData, objectEndObjectFields, out objectEndPlayerDynamicFields, prefixEnum, multiply, upper, remLocal);
                retVal = retVal + DumpField("ConversationDynamicData", "CGConversationDynamicData::m_", s_conversationDynamicData, objectEndObjectFields, out objectEndConversationDynamicData, prefixEnum, multiply, upper, remLocal);

                // Dispose
                _memory.Close();
                // Return value
                return(retVal);
            }
            catch (Exception e)
            {
                return(e + Environment.NewLine + Environment.NewLine + " Exception caught.");
            }
        }
コード例 #5
0
ファイル: LUA.cs プロジェクト: iwaitu/babbot
 public Lua(Magic.BlackMagic magic)
 {
     _magic = magic;
     State = GetState();
     LastArg = GetTop();
 }