Example #1
0
        public Boolean CheckCurrentWindow(String[] names)
        {
            int    P   = Memory.RD(CHR.HNDL, GO + OFS.GetInt("Gui_Win_Current"));
            String cwn = Memory.RS(CHR.HNDL, Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Name")), 64, false);

            return(names.Contains(cwn));
        }
Example #2
0
 public void Load()
 {
     IL.Clear();
     PTR       = Memory.RD(CHR.HNDL, "BA+GA_OFS+PlayerStruct+Player_Inventory_Struct");
     MAX_ITEMS = Memory.RD(CHR.HNDL, PTR + OFS.GetInt("Inventory_MaxSize"));
     IL        = LoadStruct(CHR, Memory.RD(CHR.HNDL, PTR + OFS.GetInt("Inventory_Array")), MAX_ITEMS);
 }
Example #3
0
        public void Move(Location loc, Boolean wait = false, double accuracy = 0.5)
        {
            byte[] WP =
            {
                0x60,                                            //pushad
                0xB8,              /*2*/ 0x00,0x00, 0x00, 0x00, //mov eax, BA
                0x8B,              0x00,                         //mox eax, dword ptr [eax]
                0x8B,              0x40, 0x1C,                   //mov eax, dword ptr[eax + 1C]
                0x8B,              0x78, 0x34,                   //mov edi, dword ptr[eax + 0x34]
                0x8B,              0x8F, 0xC4, 0x15, 0x00, 0x00, //mov ecx, dword ptr[edi + 0x154C]
                0x6A,              0x01,                         //push 1
                0xB8,              /*23*/ 0x00,0x00, 0x00, 0x00, //mov eax, action_1
                0xFF,              0xD0,                         //call eax
                0x8D,              0x54, 0x24, 0x1C,             //lea edx, dword ptr[esp + 0x1C]
                0x8B,              0xD8,                         //mov ebx, eax
                0x52,                                            //push edx
                0x68,              /*37*/ 0x00,0x00, 0x00, 0x00, //push walk_mode
                0x8B,              0xCB,                         //mov ecx, ebx
                0xB8,              /*44*/ 0x00,0x00, 0x00, 0x00, //mov eax, action_2
                0xFF,              0xD0,                         //call eax
                0x8B,              0x8F, 0xC4, 0x15, 0x00, 0x00, //mov ecx, dword ptr [edi + 0x154C]
                0xB8,              /*57*/ 0x00,0x00, 0x00, 0x00, //mov eax, x
                0x89,              0x43, 0x20,                   //mov dword ptr[ebx + 0x20], eax
                0xB8,              /*65*/ 0x00,0x00, 0x00, 0x00, //mov eax, z
                0x89,              0x43, 0x24,                   //mov dword ptr[ebx + 0x24], eax
                0xB8,              /*73*/ 0x00,0x00, 0x00, 0x00, //mov eax, y
                0x89,              0x43, 0x28,                   //mov dword ptr[ebx + 0x28], eax
                0x6A,              0x00,                         //push 0
                0x53,                                            //push ebx
                0x6A,              0x01,                         //push 1
                0xB8,              /*86*/ 0x00,0x00, 0x00, 0x00, //mov eax, action_3
                0xFF,              0xD0,                         //call eax
                0x61,                                            //popad
                0xC3                                             //ret
            };
            Packet P = new Packet(HNDL, WP);

            P.Copy(OFS.BA, 2, 4);
            P.Copy(OFS.GetUInt("Player_Action_Struct"), 16, 4);
            P.Copy(OFS.GetUInt("Player_Action_Struct"), 52, 4);
            P.Copy(OFS.GetUInt("action_1"), 23, 4);
            P.Copy(OFS.GetUInt("action_2"), 44, 4);
            P.Copy(OFS.GetUInt("action_3"), 86, 4);
            P.Copy(loc.x, 57, 4);
            P.Copy(loc.y, 73, 4);
            P.Copy(loc.z, 65, 4);
            int WalkMode = Memory.RD(HNDL, CSP + OFS.GetInt("Player_WalkMode"));

            P.Copy(WalkMode > 0 ? 1 : 0, 37, 4);
            P.Execute();
            if (wait)
            {
                while (LOC.GetDistance(loc) > accuracy)
                {
                    LoadLocation();
                    System.Threading.Thread.Sleep(200);
                }
            }
        }
Example #4
0
 public void LoadLootItem()
 {
     id   = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Loot_ID"));
     wid  = Memory.RUD(CHR.HNDL, ptr + OFS.GetInt("Loot_WID"));
     type = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Loot_Type"));
     loc  = new Location(Memory.RF(CHR.HNDL, ptr + OFS.GetInt("Loot_LocX")), Memory.RF(CHR.HNDL, ptr + OFS.GetInt("Loot_LocY")), Memory.RF(CHR.HNDL, ptr + OFS.GetInt("Loot_LocZ")));
     IT   = ItemType.Loot;
 }
Example #5
0
 public void LoadInventoryItem()
 {
     id        = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Inventory_Item_ID"));
     type      = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Inventory_Item_Type"));
     count     = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Inventory_Item_Count"));
     max_count = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Inventory_Item_MaxCount"));
     price     = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Inventory_Item_Price"));
     IT        = ItemType.Inventory;
 }
Example #6
0
 public NPC Load()
 {
     id = Memory.RD(HNDL, ptr + OFS.GetInt("Mob_Id"));
     wid = Memory.RUD(HNDL, ptr + OFS.GetInt("Mob_WId"));
     type = Memory.RD(HNDL, ptr + OFS.GetInt("Mob_Type"));
     name = Memory.RS(HNDL, Memory.RD(HNDL, ptr + OFS.GetInt("Mob_Name")));
     distance = Memory.RF(HNDL, ptr + OFS.GetInt("Mob_Distance"));
     LOC = new Location(Memory.RF(HNDL, ptr + OFS.GetInt("Mob_LocX")), Memory.RF(HNDL, ptr + OFS.GetInt("Mob_LocY")), Memory.RF(HNDL, ptr + OFS.GetInt("Mob_LocZ")));
     return this;
 }
Example #7
0
        public static FairyItem LoadInventoryFairy(Item i)
        {
            int       FIA = Memory.RD(i.CHR.HNDL, i.ptr + OFS.GetInt("Inventory_Item_Fairy_INF"));
            FairyItem NFI = new FairyItem(i.CHR);

            NFI.id    = i.id;
            NFI.place = i.place;
            NFI.lvl   = FIA & 0xFF;
            NFI.fsc   = (FIA >> 16) & 0xFF;
            NFI.P1    = NFI.lvl < 10 ? 0 : NFI.fsc - NFI.lvl + 1;
            NFI.P2    = NFI.lvl < 10 ? 0 : (NFI.lvl / 10) * 10;
            return(NFI);
        }
Example #8
0
        public int GetRandomEnemyCommander()
        {
            List <int> ECL = new List <int>();
            int        ECB = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_EnemyCommanderBegin"));
            int        ECE = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_EnemyCommanderEnd"));

            while (ECB < ECE)
            {
                ECL.Add(Memory.RD(CHR.HNDL, ECB));
                ECB += 0x04;
            }
            return(ECL[new Random().Next(0, ECL.Count - 1)]);
        }
Example #9
0
        public GameWindow GetCurrentWindow()
        {
            LoadAllWindows();
            int    P    = Memory.RD(CHR.HNDL, GO + OFS.GetInt("Gui_Win_Current"));
            String name = Memory.RS(CHR.HNDL, Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Name")), 64, false);

            foreach (GameWindow w in WL)
            {
                if (w.ptr == P && w.name.Equals(name))
                {
                    return(w);
                }
            }
            return(new GameWindow(CHR.HNDL));
        }
Example #10
0
 public void Load()
 {
     CSP    = Memory.RD(HNDL, "BA+GA_OFS+PlayerStruct");
     Name   = Memory.RS(HNDL, Memory.RD(HNDL, CSP + OFS.GetInt("PlayerName")));
     INGAME = Name.Trim().Length > 0;
     Name   = INGAME ? Name : "N/A";
     ID     = Memory.RD(HNDL, CSP + OFS.GetInt("Player_ID"));
     LVL    = Memory.RD(HNDL, CSP + OFS.GetInt("Player_Lvl"));
     LoadLocation();
     INV   = new Inventory(this);
     FAIRY = new Fairy(this);
     ENV   = new Environment(this);
     WND   = new GUI(this);
     MBF   = new BeastFactory(this);
 }
Example #11
0
        public void ScanNPC()
        {
            int MP    = Memory.RD(CHR.HNDL, "BA+GA_OFS+MS_OFS+Mob_Struct");
            int COUNT = Memory.RD(CHR.HNDL, MP + OFS.GetInt("Mob_Count"));
            int MA    = Memory.RD(CHR.HNDL, MP + OFS.GetInt("Mob_Array"));

            NPC_LIST.Clear();
            if (COUNT == 0)
            {
                return;
            }
            for (int i = 0; i < COUNT; i++)
            {
                NPC_LIST.Add(new NPC(CHR.HNDL, Memory.RD(CHR.HNDL, MA + i * 0x4)).Load());
            }
        }
Example #12
0
 public void LoadMine()
 {
     Points      = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_Points"));
     Reward      = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_GetRewards"));
     GamesRemain = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_GamesRemain"));
     GetReward();
     OpenAllBags();
     MoveAllBeastsToStore();
     LoadInventory();
     LoadMyBeastStruct();
     LoadMyDynamic();
     while (Improve())
     {
         ;
     }
 }
Example #13
0
        public void LoadInventory()
        {
            BIL.Clear();
            int rr  = -1;
            int BIB = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_InventoryBegin"));
            int BIE = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_InventoryEnd"));

            while (BIB < BIE)
            {
                byte[] buffer = new byte[OFS.GetInt("BS_InventoryItemSize")];
                EF.ReadProcessMemory(CHR.HNDL, BIB, buffer, buffer.Length, ref rr);
                int[] oa = new int[buffer.Length / 4];
                Buffer.BlockCopy(buffer, 0, oa, 0, buffer.Length);
                BeastItem NBI = new BeastItem(CHR);
                NBI.id    = oa[OFS.GetInt("BS_BI_ID") / 4];
                NBI.count = oa[OFS.GetInt("BS_BI_Count") / 4];
                BIL.Add(NBI.id, NBI);
                BIB += OFS.GetInt("BS_InventoryItemSize");
            }
        }
Example #14
0
        public static Beast Parse(uint[] BS, Character CHR)
        {
            int id = (int)BS[OFS.GetInt("BS_BL_ID") / 4];

            if (!INF.ContainsKey(id))
            {
                return(null);
            }
            Beast RB = new Beast(id);

            RB.BS      = BS;
            RB.Level   = (int)BS[OFS.GetInt("BS_BL_Level") / 4];
            RB.Enemies = BS[OFS.GetInt("BS_BL_Enemies") / 4];
            RB.Element = (BS[OFS.GetInt("BS_BL_Elements") / 4] & 0xFF);
            RB.Power   = INF[id].LVL[RB.Level - 1];
            RB.Name    = INF[id].Name;
            RB.ItemId  = INF[id].ItemId;
            RB.Class   = INF[id].Class;
            RB.CHR     = CHR;
            return(RB);
        }
Example #15
0
        public void LoadEnemy()
        {
            ENEMY.Clear();
            int rr  = -1;
            int EAB = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_EnemyArrayBegin"));
            int EAE = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_EnemyArrayEnd"));

            while (EAB < EAE)
            {
                byte[] buffer = new byte[OFS.GetInt("BS_ArrayItemSize")];
                EF.ReadProcessMemory(CHR.HNDL, EAB, buffer, buffer.Length, ref rr);
                uint[] oa = new uint[buffer.Length / 4];
                Buffer.BlockCopy(buffer, 0, oa, 0, buffer.Length);
                Beast NB = Beast.Parse(oa, CHR);
                if (NB != null && !ENEMY.ContainsKey(NB.ID))
                {
                    ENEMY.Add(NB.ID, NB);
                }
                EAB += OFS.GetInt("BS_ArrayItemSize");
            }
        }
Example #16
0
        public void LoadMyDynamic()
        {
            int rr  = -1;
            int DSB = Memory.RD(CHR.HNDL, CHR.CSP, "PL_BS_Struct+PL_BS_P1+PL_BS_P2+PL_BS_Begin");
            int DSE = Memory.RD(CHR.HNDL, CHR.CSP, "PL_BS_Struct+PL_BS_P1+PL_BS_P2+PL_BS_End");
            int DSL = OFS.GetInt("PL_BS_Length");

            while (DSB < DSE)
            {
                byte[] buffer = new byte[DSL];
                EF.ReadProcessMemory(CHR.HNDL, DSB, buffer, buffer.Length, ref rr);
                uint[] oa = new uint[buffer.Length / 4];
                Buffer.BlockCopy(buffer, 0, oa, 0, buffer.Length);
                int ID1 = (int)oa[OFS.GetInt("PL_BS_Item_ID1") / 4];
                int ID2 = (int)oa[OFS.GetInt("PL_BS_Item_ID2") / 4];
                if (MY.ContainsKey(ID1))
                {
                    MY[ID1].ID2 = ID2;
                }
                DSB += DSL;
            }
        }
Example #17
0
        public void ScanLoot()
        {
            int LP    = Memory.RD(CHR.HNDL, "BA+GA_OFS+MS_OFS+Loot_Struct");
            int LA    = Memory.RD(CHR.HNDL, LP + OFS.GetInt("Loot_Array"));
            int COUNT = Memory.RD(CHR.HNDL, LP + OFS.GetInt("Loot_Count"));

            LOOT_LIST.Clear();
            if (COUNT == 0)
            {
                return;
            }
            for (int i = 0; i < 0x300; i++)
            {
                Item it = new Item(CHR, Memory.RD(CHR.HNDL, Memory.RD(CHR.HNDL, LA + i * 0x4) + 0x4));
                if (it.ptr == 0)
                {
                    continue;
                }
                it.LoadLootItem();
                LOOT_LIST.Add(it);
            }
        }
Example #18
0
 public void LoadLocation()
 {
     LOC      = new Location(Memory.RF(HNDL, CSP + OFS.GetInt("Player_LocX")), Memory.RF(HNDL, CSP + OFS.GetInt("Player_LocY")), Memory.RF(HNDL, CSP + OFS.GetInt("Player_LocZ")));
     LOC_ID   = Memory.RD(HNDL, "BA+GA_OFS+MS_OFS+LOCATION_ID");
     LOC_NAME = Memory.RS(HNDL, "BA+GA_OFS+MS_OFS+LOCATION_NAME+LOCATION_NAME_OFS");
 }
Example #19
0
        public void LoadAllWindows()
        {
            GO = Memory.RD(CHR.HNDL, "BA+GA_OFS+Gui_O1+Gui_O2");
            if (GO == 0)
            {
                return;
            }
            WL.Clear();
            int P = Memory.RD(CHR.HNDL, GO + OFS.GetInt("Gui_LowW_Struct"));

            while (true)
            {
                if (P == 0)
                {
                    break;
                }
                try
                {
                    GameWindow w = new GameWindow(CHR.HNDL);
                    w.ptr        = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ptr"));
                    w.GF         = Memory.RD(CHR.HNDL, Memory.RD(CHR.HNDL, w.ptr) + 0x30);
                    w.name_ptr   = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Name"));
                    w.name       = Memory.RS(CHR.HNDL, w.name_ptr, 64, false);
                    w.visibility = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Visibility"));
                    w.CL         = new List <WindowControl>();
                    WL.Add(w);
                    P = Memory.RD(CHR.HNDL, P);
                }
                catch (Exception e)
                {
                    Debug.LOG(e.ToString());
                    break;
                }
            }
            P = Memory.RD(CHR.HNDL, GO + OFS.GetInt("Gui_TopW_Struct"));
            while (true)
            {
                if (P == 0)
                {
                    break;
                }
                try
                {
                    GameWindow w = new GameWindow(CHR.HNDL);
                    w.ptr        = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ptr"));
                    w.name_ptr   = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Name"));
                    w.name       = Memory.RS(CHR.HNDL, w.name_ptr, 64, false);
                    w.visibility = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Visibility"));
                    w.CL         = new List <WindowControl>();
                    WL.Add(w);
                    P = Memory.RD(CHR.HNDL, P);
                }
                catch (Exception e)
                {
                    Debug.LOG(e.ToString());
                    break;
                }
            }
            foreach (GameWindow w in WL)
            {
                P = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Ctrl_Array"));
                while (true)
                {
                    if (P == 0)
                    {
                        break;
                    }
                    try
                    {
                        WindowControl c = new WindowControl(w);
                        c.ptr      = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ctrl_Ptr"));
                        c.name_ptr = Memory.RD(CHR.HNDL, c.ptr + OFS.GetInt("Gui_Win_Ctrl_Name"));
                        c.name     = Memory.RS(CHR.HNDL, c.name_ptr, 64, false);
                        c.CP       = Memory.RD(CHR.HNDL, c.ptr + OFS.GetInt("Gui_Win_Ctrl_Function"));
                        c.CN       = Memory.RS(CHR.HNDL, c.CP, 64, false);
                        w.CL.Add(c);
                        P = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ctrl_Next"));
                    }
                    catch (Exception e)
                    {
                        Debug.LOG(e.ToString());
                        break;
                    }
                }
            }
        }
Example #20
0
        public void Fly()
        {
            int FlyId = Memory.RD(HNDL, CSP + OFS.GetInt("Player_FlyId"));

            new Packet(HNDL, "28-00-01-01-0C-00-FF-FF-FF-FF").Copy(FlyId, 6, 4).Send();
        }