コード例 #1
0
        public static List <bean.Goods> itBag(int hwnd)
        {
            List <bean.Goods> goods = new List <bean.Goods>();
            int addr = readBag(hwnd)[0];

            for (int i = 0; i < 20; i++)
            {
                int addrFlag = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr + (i + 1) * 12);
                addrFlag = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x40);
                addrFlag = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x8);
                addrFlag = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x8);
                addrFlag = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x14);
                addrFlag = ReadOffset(hwnd, addrFlag);
                addrFlag = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0xC);

                int addrType = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x24);
                int addrNum  = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x30);
                int addrID   = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrFlag + 0x3C);


                int id    = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrID + 0x8);
                int type  = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrType + 0x8);
                int count = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addrNum + 0x8);

                if (id > 0)
                {
                    goods.Add(new bean.Goods(id, type, count, i));
                }
            }
            return(goods);
        }
コード例 #2
0
        /// <summary>
        /// 隐藏验证窗口
        /// </summary>
        /// <param name="hwnd"></param>
        public static void HideCheckWin(int hwnd)
        {
            int tmpPtr = LoadDll.ReadHwndMemoryOffsetValue((IntPtr)hwnd, Global.addr.win, 0x68, 0x04, 0x68);

            tmpPtr = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, tmpPtr) + 0x28;

            LoadDll.WriteMemoryHwndValue((IntPtr)hwnd, tmpPtr, BitConverter.GetBytes(1));
        }
コード例 #3
0
        /// <summary>
        /// 获取屏幕大小
        /// </summary>
        /// <param name="hwnd"></param>
        /// <returns></returns>
        public int[] GetMhxyScreen(int hwnd)
        {
            int[] ret = new int[2];

            ret[0] = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, Screen);
            ret[1] = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, Screen + 4);
            return(ret);
        }
コード例 #4
0
        public static int ReadOffset(int hwnd, int addr)
        {
            int offset = 1364;

            for (int i = 0; i < 2; i++)
            {
                if (i == 1)
                {
                    offset = 92;
                }
                int addr1 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr + offset);
                int addr2 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr1 + 12);
                addr2 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr2 + 60);
                addr2 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr2 + 8);
                if (addr2 > 1000000000 && addr2 < 1200000000)
                {
                    return(addr1);
                }
            }
            return(0);
        }
コード例 #5
0
        public static int[] readBag(int hwnd)
        {
            int[] xy = new int[2];
            //临时地址
            int tmpPtr = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, Global.addr.win);

            tmpPtr = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, tmpPtr + 0x68);
            tmpPtr = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, tmpPtr + 0x8);
            tmpPtr = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, tmpPtr + 0x68);

            for (int i = 0; i < 20; i++)
            {
                int addr = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, tmpPtr + (i * 4));
                int x    = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr + 0xF4);
                int y    = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr + 0xF8);
                int z    = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, tmpPtr + 40);
                if (x == 544 && y == 333)
                {
                    int addr2 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr + 0x68);
                    for (int k = 0; k < 20; k++)
                    {
                        int addr3 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, (addr2 + (k * 4)));
                        x = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr3 + 0x08);
                        y = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr3 + 0x0C);
                        if (x == 261 && y == 54)
                        {
                            //===================================
                            for (int j = 0; j < 2; j++)
                            {
                                if (j == 1)
                                {
                                    k = k + 1;
                                }
                                int addr4 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr2 + k * 4);
                                addr4 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr4 + 0x68);
                                if (j == 1)
                                {
                                    addr4 = addr4 + 8;
                                }
                                addr4 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr4);
                                addr4 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr4 + 0x68);
                                addr4 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr4);
                                addr4 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr4 + 0x68);
                                for (int p = 0; p < 100; p++)
                                {
                                    int addr5 = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr4 + (p * 4) + 144);
                                    x = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr5 + 0x8);
                                    y = LoadDll.ReadHwndMemoryValue((IntPtr)hwnd, addr5 + 0xC);
                                    if (x == 1 && y == 1)
                                    {
                                        xy[j] = addr4 + p * 4 + 144 - 12;

                                        break;
                                    }
                                }
                            }
                            break;

                            //=============================================
                        }
                    }
                }
            }
            return(xy);
        }