コード例 #1
0
        public bool Click()
        {
            String CtrlName = CN.Trim().Length > 0 ? CN : (name.Trim().Length > 0 ? name : null);

            if (CtrlName == null)
            {
                return(false);
            }
            byte[] WP =
            {
                0x60,                         // PUSHAH
                0xBE, 0x00, 0x00, 0x00, 0x00, // mov esi, WinPtr
                0x8B, 0x16,                   // mov edx,[esi]
                0x8B, 0x42, 0x00,             // mov eax,[edx + FUNC_OFSET]
                0xBD, 0x00, 0x00, 0x00, 0x00, // mov ebp, ControlStringPtr
                0x55,                         // push ebp
                0x8B, 0xCE,                   // mov ecx, esi
                0xFF, 0xD0,                   // call eax
                0x61, 0xC3                    // POPAD, RET
            };
            Packet P = new Packet(WND.HNDL, WP);

            P.Copy(WND.ptr, 2, 4);
            P.Copy(OFS.GetByte("Gui_Function"), 10, 1);
            byte[] R = P.Execute(Encoding.ASCII.GetBytes(CtrlName), 12);
            return(R.Length > 0);
        }
コード例 #2
0
ファイル: Environment.cs プロジェクト: AvelDilon/MailPwBot
        private 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"));

            if (COUNT == 0)
            {
                return;
            }
            for (int i = 0; i < COUNT; i++)
            {
                int PTR  = Memory.RD(CHR.HNDL, MA + i * 0x4);
                int TYPE = Memory.RD(CHR.HNDL, PTR + OFS.GetInt("Mob_Type"));
                switch (TYPE)
                {
                case 7:
                    EL.Add(new PwNpc(CHR, PTR).Load());
                    break;

                case 6:
                    EL.Add(new PwMob(CHR, PTR).Load());
                    break;

                case 9:
                    EL.Add(new PwPet(CHR, PTR).Load());
                    break;

                default:
                    EL.Add(new PwNpc(CHR, PTR).Load());
                    break;
                }
            }
        }
コード例 #3
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);
 }
コード例 #4
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));
        }
コード例 #5
0
ファイル: Environment.cs プロジェクト: AvelDilon/MailPwBot
        private 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"));

            if (COUNT == 0)
            {
                return;
            }
            for (int i = 0; i < 0x300; i++)
            {
                int PTR = Memory.RD(CHR.HNDL, Memory.RD(CHR.HNDL, LA + i * 0x4) + 0x4);
                if (PTR == 0)
                {
                    continue;
                }
                int TYPE = Memory.RD(CHR.HNDL, PTR + OFS.GetInt("Loot_Type"));
                if (TYPE == 2)
                {
                    EL.Add(new PwMine(CHR, PTR).Load());
                }
                else
                {
                    EL.Add(new ItemLoot(CHR, PTR).Load());
                }
            }
        }
コード例 #6
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);
                }
            }
        }
コード例 #7
0
ファイル: Character.cs プロジェクト: AvelDilon/MailPwBot
        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, [eax]
                0x8B,              0x40, 0x1C,                   //mov eax, [eax + 1C]
                0x8B,              0x70, 0x34,                   //mov esi, [eax + 0x34]
                0x8B,              0x8E, 0x00, 0x00, 0x00, 0x00, //mov ecx, [esi + ACTION]
                0x6A,              0x01,                         //push 1
                0xB8,              /*23*/ 0x00,0x00, 0x00, 0x00, //mov eax, action_1
                0xFF,              0xD0,                         //call eax
                0x8D,              0x54, 0x24, 0x38,             //lea edx, [esp + 0x38]
                0x8B,              0xD8,                         //mov ebx, eax
                0x52,                                            //push edx
                0x6A,              /*37*/ 0x00,                  //push walk_mode
                0x8B,              0xCB,                         //mov ecx, ebx
                0xB8,              /*41*/ 0x00,0x00, 0x00, 0x00, //mov eax, action_2
                0xFF,              0xD0,                         //call eax
                0x8B,              0x8E, 0x00, 0x00, 0x00, 0x00, //mov ecx, [esi + ACTION]
                0xB8,              /*54*/ 0x00,0x00, 0x00, 0x00, //mov eax, x
                0x89,              0x43, 0x20,                   //mov [ebx + 0x20], eax
                0xB8,              /*62*/ 0x00,0x00, 0x00, 0x00, //mov eax, z
                0x89,              0x43, 0x24,                   //mov [ebx + 0x24], eax
                0xB8,              /*70*/ 0x00,0x00, 0x00, 0x00, //mov eax, y
                0x89,              0x43, 0x28,                   //mov [ebx + 0x28], eax
                0x6A,              0x00,                         //push 0
                0x53,                                            //push ebx
                0x6A,              0x01,                         //push 1
                0xB8,              /*83*/ 0x00,0x00, 0x00, 0x00, //mov eax, action_3
                0xFF,              0xD0,                         //call eax
                0x61, 0xC3                                       //popad, 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"), 49, 4);
            P.Copy(OFS.GetUInt("action_1"), 23, 4);
            P.Copy(OFS.GetUInt("action_2"), 41, 4);
            P.Copy(OFS.GetUInt("action_3"), 83, 4);
            P.Copy(loc.x, 54, 4);
            P.Copy(loc.y, 70, 4);
            P.Copy(loc.z, 62, 4);
            if (GetVar("WalkMode") == 2)
            {
                P.Copy(GetVar("WalkMode"), 37, 1);
            }
            P.Execute();
            if (wait)
            {
                while (LOC.GetDistance(loc) > accuracy)
                {
                    LoadLocation();
                    System.Threading.Thread.Sleep(200);
                }
            }
        }
コード例 #8
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;
 }
コード例 #9
0
 public new PwPlayer Load()
 {
     id   = Memory.RD(HNDL, ptr + OFS.GetInt("Player_ID"));
     cls  = new PwClass(Memory.RD(HNDL, ptr + OFS.GetInt("Player_ClassId")));
     name = Memory.RS(HNDL, Memory.RD(HNDL, ptr + OFS.GetInt("PlayerName")));
     loc  = new Location(Memory.RF(HNDL, ptr + OFS.GetInt("Player_LocX")), Memory.RF(HNDL, ptr + OFS.GetInt("Player_LocY")), Memory.RF(HNDL, ptr + OFS.GetInt("Player_LocZ")));
     CalculateDistance();
     return(this);
 }
コード例 #10
0
ファイル: PwMine.cs プロジェクト: AvelDilon/MailPwBot
 public new PwMine Load()
 {
     type = 2;
     id   = Memory.RD(CHR.HNDL, ptr + OFS.GetInt("Loot_ID"));
     wid  = Memory.RUD(CHR.HNDL, ptr + OFS.GetInt("Loot_WID"));
     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")));
     CalculateDistance();
     return(this);
 }
コード例 #11
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;
 }
コード例 #12
0
ファイル: Character.cs プロジェクト: AvelDilon/MailPwBot
        public void Fly()
        {
            int FlyId = Memory.RD(HNDL, CSP + OFS.GetInt("Player_FlyId"));

            if (FlyId > 0)
            {
                new Packet(HNDL, "28-00-01-01-0C-00-FF-FF-FF-FF").Copy(FlyId, 6, 4).Send();
            }
        }
コード例 #13
0
 public new PwNpc 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);
 }
コード例 #14
0
 public new ItemLoot Load()
 {
     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")));
     CalculateDistance();
     IsCoin = (type == 3);
     return(this);
 }
コード例 #15
0
ファイル: Character.cs プロジェクト: AvelDilon/MailPwBot
 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"));
     LoadVars();
     LoadLocation();
     LoadUserClasses();
 }
コード例 #16
0
ファイル: Memory.cs プロジェクト: Wolf85/MailPwBot
        public static int RD(int HNDL, string PTRL)
        {
            string[] ss   = OFS.COFS(PTRL).Split('+');
            int      LPTR = RD(HNDL, (int)Convert.ToUInt32(ss[0].Trim(), 16));

            for (int i = 1; i < ss.Length; i++)
            {
                LPTR = RD(HNDL, LPTR + Convert.ToInt32(ss[i].Trim(), 16));
            }
            return(LPTR);
        }
コード例 #17
0
ファイル: BeastFactory.cs プロジェクト: AvelDilon/MailPwBot
        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)]);
        }
コード例 #18
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);
        }
コード例 #19
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));
        }
コード例 #20
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);
 }
コード例 #21
0
ファイル: Environment.cs プロジェクト: AvelDilon/MailPwBot
        private void ScanPlayers()
        {
            int PP    = Memory.RD(CHR.HNDL, "BA+GA_OFS+MS_OFS+Players_Struct");
            int PA    = Memory.RD(CHR.HNDL, PP + OFS.GetInt("Players_Array"));
            int COUNT = Memory.RD(CHR.HNDL, PP + OFS.GetInt("Players_Count"));

            if (COUNT == 0)
            {
                return;
            }
            for (int i = 0; i < COUNT; i++)
            {
                EL.Add(new PwPlayer(CHR, Memory.RD(CHR.HNDL, PA + i * 0x4)).Load());
            }
        }
コード例 #22
0
ファイル: BeastFactory.cs プロジェクト: AvelDilon/MailPwBot
 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())
     {
         ;
     }
 }
コード例 #23
0
ファイル: Environment.cs プロジェクト: Wolf85/MailPwBot
        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());
            }
        }
コード例 #24
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");
            }
        }
コード例 #25
0
ファイル: Beast.cs プロジェクト: Wolf85/MailPwBot
        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);
        }
コード例 #26
0
ファイル: BeastFactory.cs プロジェクト: AvelDilon/MailPwBot
        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");
            }
        }
コード例 #27
0
ファイル: Environment.cs プロジェクト: Wolf85/MailPwBot
        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);
            }
        }
コード例 #28
0
ファイル: BeastFactory.cs プロジェクト: AvelDilon/MailPwBot
        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;
            }
        }
コード例 #29
0
ファイル: BeastFactory.cs プロジェクト: AvelDilon/MailPwBot
        public void LoadInventory()
        {
            CHR.GetClass <GUI>().Click("Win_HomePetMain", "Btn_Storage");
            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);
                ItemBeast NBI = new ItemBeast(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");
            }
            CHR.GetClass <GUI>().Click("Win_HomePetMain", "Btn_Storage");
        }
コード例 #30
0
        public ItemInventory Load(byte place)
        {
            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"));
            this.place = place;
            if (id == 0)
            {
                return(this);
            }
            desc = ReadDescription();
            String[] sa = new Regex("\\^[0-9a-f]{6}").Split(desc);
            if (sa.Length < 2)
            {
                return(this);
            }
            String ps = sa[1].Trim();

            name = (ps.IndexOf('(') > 0 ? ps.Substring(0, ps.IndexOf('(')) : ps.Substring(0, ps.IndexOf('\\'))).Trim();
            return(this);
        }