Esempio n. 1
0
 public void SendLeftClick(int x, int y)
 {
     Console.WriteLine("x :" + (object)x + " y: " + (object)y);
     Vip72Handle.MoveTo(x, y);
     Vip72Handle.mouse_event(2, x, y, 0, 0);
     Vip72Handle.mouse_event(4, x, y, 0, 0);
 }
Esempio n. 2
0
 public bool startEventListener()
 {
     this.statusHandle         = this.GetWindowHandle(Vip72Handle.Vip72Window.Status);
     this.SetTextHookProcedure = new Vip72Handle.HookProc(this.SetTextHookProc);
     Vip72Handle.hHook         = Vip72Handle.SetWindowsHookEx(3, this.SetTextHookProcedure, IntPtr.Zero, Vip72Handle.GetCurrentThreadId());
     return((uint)Vip72Handle.hHook > 0U);
 }
Esempio n. 3
0
 public void SendRightClickToWindow(Vip72Handle.Vip72Window window, Point point)
 {
     this.setVip72TopMost();
     Vip72Handle.SetForegroundWindow(this._MainHandle);
     Vip72Handle.GetChildWindowInfo(this.GetWindowHandle(window));
     ClickOnPointTool.RightClickOnPoint(this.GetWindowHandle(window), point);
 }
Esempio n. 4
0
 public static void closeAll()
 {
     if (ProxyCore.__process != null)
     {
         try
         {
             ProxyCore.kill(ProxyCore.__process);
         }
         catch
         {
         }
         ProxyCore.__process = (Process)null;
     }
     ProxyCore.__currentVip72Handle = (Vip72Handle)null;
     ProxyCore.__selectedVip72IP.Clear();
     ProxyCore.__selectedVip72Index = -1;
     if (ProxyCore.proSSH != null)
     {
         try
         {
             ProxyCore.kill(ProxyCore.proSSH);
         }
         catch
         {
         }
         ProxyCore.proSSH = (Process)null;
     }
     LocalConfig.getCurrentConfig().refreshLiveSSHs();
 }
Esempio n. 5
0
        public List <Vip72Handle.ChildWindowItem> GetAllChildWindowItems()
        {
            List <Vip72Handle.ChildWindowItem> childWindowItemList = new List <Vip72Handle.ChildWindowItem>();
            List <IntPtr> allChildHandles = this.GetAllChildHandles();

            Vip72Handle.WINDOWINFO childWindowInfo1 = Vip72Handle.GetChildWindowInfo(this._MainHandle);
            for (int index = 0; index < allChildHandles.Count; ++index)
            {
                IntPtr num         = allChildHandles[index];
                string controlText = Vip72Handle.GetControlText(num);
                Vip72Handle.WINDOWINFO      childWindowInfo2 = Vip72Handle.GetChildWindowInfo(num);
                Vip72Handle.ChildWindowItem childWindowItem;
                childWindowItem.rect.y    = childWindowInfo2.rcWindow.top - childWindowInfo1.rcWindow.top;
                childWindowItem.rect.x    = childWindowInfo2.rcWindow.left - childWindowInfo1.rcWindow.left;
                childWindowItem.rect.h    = childWindowInfo2.rcWindow.bottom - childWindowInfo2.rcWindow.top;
                childWindowItem.rect.w    = childWindowInfo2.rcWindow.right - childWindowInfo2.rcWindow.left;
                childWindowItem.className = Vip72Handle.GetWindowClassName(num);
                childWindowItem.text      = controlText;
                childWindowItem.handle    = num;
                childWindowItem.info      = childWindowInfo2;
                childWindowItemList.Add(childWindowItem);
            }
            childWindowItemList.Sort((Comparison <Vip72Handle.ChildWindowItem>)((p1, p2) =>
            {
                if (p1.rect.x == p2.rect.x || p1.rect.y != p2.rect.y)
                {
                    return(p1.rect.y.CompareTo(p2.rect.y));
                }
                return(p1.rect.x.CompareTo(p2.rect.x));
            }));
            return(childWindowItemList);
        }
Esempio n. 6
0
        public static Point GetListViewItemPoint(IntPtr handle, int index)
        {
            uint   dwProcessId;
            int    windowThreadProcessId = (int)Vip72Handle.GetWindowThreadProcessId(handle, out dwProcessId);
            IntPtr num1 = Vip72Handle.OpenProcess(56U, false, dwProcessId);
            IntPtr num2 = Vip72Handle.VirtualAllocEx(num1, IntPtr.Zero, 4096U, 12288U, 4U);

            try
            {
                Point[] arr = new Point[1];
                uint    vNumberOfBytesRead = 0;
                Vip72Handle.WriteProcessMemory(num1, num2, Marshal.UnsafeAddrOfPinnedArrayElement <Point>(arr, 0), Marshal.SizeOf(typeof(Vip72Handle.LVITEM)), ref vNumberOfBytesRead);
                Vip72Handle.SendMessage(handle, 4112U, index, num2.ToInt32());
                Vip72Handle.ReadProcessMemory(num1, num2, Marshal.UnsafeAddrOfPinnedArrayElement <Point>(arr, 0), Marshal.SizeOf(typeof(Point)), ref vNumberOfBytesRead);
                return(arr[0]);
            }
            catch (Exception ex)
            {
                Console.WriteLine((object)ex);
            }
            finally
            {
                Vip72Handle.VirtualFreeEx(num1, num2, 0U, 32768U);
                Vip72Handle.CloseHandle(num1);
            }
            return(Vip72Handle.InvalidPoint);
        }
Esempio n. 7
0
        public bool showWindow()
        {
            bool flag = Vip72Handle.ShowWindow(this._MainHandle, Vip72Handle.ShowWindowCommands.Show);

            this.setVip72TopMost();
            return(flag);
        }
Esempio n. 8
0
 public void stopEventListener()
 {
     if ((uint)Vip72Handle.hHook <= 0U)
     {
         return;
     }
     Vip72Handle.UnhookWindowsHookEx(Vip72Handle.hHook);
 }
Esempio n. 9
0
        public void SendLeftClickToWindow(Vip72Handle.Vip72Window window)
        {
            this.setVip72TopMost();
            Vip72Handle.SetForegroundWindow(this._MainHandle);
            Vip72Handle.GetChildWindowInfo(this.GetWindowHandle(window));
            Point clientPoint = new Point(5, 5);

            ClickOnPointTool.ClickOnPoint(this.GetWindowHandle(window), clientPoint);
        }
Esempio n. 10
0
        public static string GetWindowClassName(IntPtr handle)
        {
            StringBuilder lpClassName = new StringBuilder(256);

            if ((uint)Vip72Handle.GetClassName(handle, lpClassName, lpClassName.Capacity) > 0U)
            {
                return(lpClassName.ToString());
            }
            return("");
        }
Esempio n. 11
0
        public static string GetControlText(IntPtr hWnd)
        {
            StringBuilder lParam = new StringBuilder();
            int           int32  = Vip72Handle.SendMessage((int)hWnd, 14, 0, 0).ToInt32();

            if (int32 > 0)
            {
                lParam = new StringBuilder(int32 + 1);
                Vip72Handle.SendMessage(hWnd, 13U, lParam.Capacity, lParam);
            }
            return(lParam.ToString());
        }
Esempio n. 12
0
        public static List <List <string> > GetListViewItems(IntPtr handle)
        {
            int itemCount = Vip72Handle.ListView_GetItemCount(handle);
            int num1      = Vip72Handle.ListViewColumnCount(handle);
            List <List <string> > stringListList = new List <List <string> >();
            uint   dwProcessId;
            int    windowThreadProcessId = (int)Vip72Handle.GetWindowThreadProcessId(handle, out dwProcessId);
            IntPtr num2 = Vip72Handle.OpenProcess(56U, false, dwProcessId);
            IntPtr num3 = Vip72Handle.VirtualAllocEx(num2, IntPtr.Zero, 16384U, 12288U, 4U);

            try
            {
                for (int index1 = 0; index1 < itemCount; ++index1)
                {
                    List <string> stringList = new List <string>();
                    for (int index2 = 0; index2 < num1; ++index2)
                    {
                        try
                        {
                            byte[] arr1 = new byte[256];
                            Vip72Handle.LVITEM[] arr2 = new Vip72Handle.LVITEM[1];
                            arr2[0].mask       = 1;
                            arr2[0].iItem      = index1;
                            arr2[0].iSubItem   = index2;
                            arr2[0].cchTextMax = arr1.Length;
                            arr2[0].pszText    = (IntPtr)((int)num3 + Marshal.SizeOf(typeof(Vip72Handle.LVITEM)));
                            uint vNumberOfBytesRead = 0;
                            Vip72Handle.WriteProcessMemory(num2, num3, Marshal.UnsafeAddrOfPinnedArrayElement <Vip72Handle.LVITEM>(arr2, 0), Marshal.SizeOf(typeof(Vip72Handle.LVITEM)), ref vNumberOfBytesRead);
                            Vip72Handle.SendMessage(handle, 4171U, 0, num3.ToInt32());
                            Vip72Handle.ReadProcessMemory(num2, (IntPtr)((int)num3 + Marshal.SizeOf(typeof(Vip72Handle.LVITEM))), Marshal.UnsafeAddrOfPinnedArrayElement <byte>(arr1, 0), arr1.Length, ref vNumberOfBytesRead);
                            string stringUni = Marshal.PtrToStringUni(Marshal.UnsafeAddrOfPinnedArrayElement <byte>(arr1, 0));
                            stringList.Add(stringUni);
                        }
                        catch (Exception ex)
                        {
                            stringList.Add("");
                            Console.WriteLine((object)ex);
                        }
                    }
                    stringListList.Add(stringList);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine((object)ex);
            }
            finally
            {
                Vip72Handle.VirtualFreeEx(num2, num3, 0U, 32768U);
                Vip72Handle.CloseHandle(num2);
            }
            return(stringListList);
        }
Esempio n. 13
0
        public static void deleteListViewItem(IntPtr handle, int index)
        {
            Point index1 = Vip72Handle.scrollListViewToIndex(handle, index);

            if (index1 == Vip72Handle.InvalidPoint)
            {
                return;
            }
            index1.X += 5;
            index1.Y += 5;
            Thread.Sleep(200);
            ClickOnPointTool.ClickOnPoint(handle, index1);
            ClickOnPointTool.SendDeleteKey(handle);
        }
Esempio n. 14
0
        public static Point scrollListViewToIndex(IntPtr handle, int index)
        {
            if (Vip72Handle.ListView_GetItemCount(handle) <= index)
            {
                return(Vip72Handle.InvalidPoint);
            }
            Size  windowSize        = Vip72Handle.GetWindowSize(handle);
            Point listViewItemPoint = Vip72Handle.GetListViewItemPoint(handle, index);

            if (listViewItemPoint != Vip72Handle.InvalidPoint)
            {
                int num = 0;
                if (listViewItemPoint.Y > windowSize.Height - 25)
                {
                    num = 1;
                }
                if (listViewItemPoint.Y < 25)
                {
                    num = -1;
                }
                for (int index1 = 30; num != 0 && index1 > 0; --index1)
                {
                    switch (num)
                    {
                    case -1:
                        int wParam1 = 2;
                        Vip72Handle.SendMessage(handle, 277U, wParam1, 0);
                        break;

                    case 1:
                        int wParam2 = 3;
                        Vip72Handle.SendMessage(handle, 277U, wParam2, 0);
                        break;
                    }
                    listViewItemPoint = Vip72Handle.GetListViewItemPoint(handle, index);
                    num = 0;
                    if (listViewItemPoint.Y > windowSize.Height - 25)
                    {
                        num = 1;
                    }
                    if (listViewItemPoint.Y < 25)
                    {
                        num = -1;
                    }
                }
            }
            return(listViewItemPoint);
        }
Esempio n. 15
0
        public List <IntPtr> GetAllChildHandles()
        {
            List <IntPtr> numList  = new List <IntPtr>();
            GCHandle      gcHandle = GCHandle.Alloc((object)numList);
            IntPtr        intPtr   = GCHandle.ToIntPtr(gcHandle);

            try
            {
                Vip72Handle.EnumChildWindows(this._MainHandle, new Vip72Handle.EnumWindowProc(this.EnumWindow), intPtr);
            }
            finally
            {
                gcHandle.Free();
            }
            return(numList);
        }
Esempio n. 16
0
        public static void selectListViewItem(IntPtr handle, int index, bool doubleclick)
        {
            Point index1 = Vip72Handle.scrollListViewToIndex(handle, index);

            if (index1 == Vip72Handle.InvalidPoint)
            {
                return;
            }
            index1.X += 5;
            index1.Y += 5;
            Thread.Sleep(200);
            if (doubleclick)
            {
                ClickOnPointTool.ClickOnPoint(handle, index1);
                ClickOnPointTool.ClickOnPoint(handle, index1);
            }
            else
            {
                ClickOnPointTool.ClickOnPoint(handle, index1);
            }
        }
Esempio n. 17
0
 public static bool IsWindowVisible(IntPtr handle)
 {
     return((Vip72Handle.GetChildWindowInfo(handle).dwStyle & 268435456U) > 0U);
 }
Esempio n. 18
0
 public static int ListView_GetItemCount(IntPtr hwnd)
 {
     return(Vip72Handle.SendMessage(hwnd, 4100U, 0, 0));
 }
Esempio n. 19
0
 public static IntPtr ListView_GetHeader(IntPtr hwnd)
 {
     return((IntPtr)Vip72Handle.SendMessage(hwnd, 4127U, 0, 0));
 }
Esempio n. 20
0
 public static int Header_GetItemCount(IntPtr header)
 {
     return(Vip72Handle.SendMessage(header, 4608U, 0, 0));
 }
Esempio n. 21
0
 public static int ListViewColumnCount(IntPtr listViewHandle)
 {
     return(Vip72Handle.Header_GetItemCount(Vip72Handle.ListView_GetHeader(listViewHandle)));
 }
Esempio n. 22
0
        private static void changeIP(ProxyTool tool, string country, string region, string preferIp, out string ip)
        {
            if (preferIp != null)
            {
                LocalConfig.getCurrentConfig().refreshLiveSSHs(country);
                ProxyCore.__selectedVip72Index = -1;
                ProxyCore.__selectedVip72IP.Clear();
            }
            ip = (string)null;
            ProxyCore.__preferIp = preferIp;
            ProxyCore.__country  = country;
            ProxyCore.__region   = region;
            ProxyCore.__tool     = tool;
            switch (tool)
            {
            case ProxyTool.Vip72:
                GlobalConfig.currentSSH = (Dictionary <string, object>)null;
                Array array = (Array)LocalConfig.getCurrentConfig().allVip72s().ToArray();
                for (int index1 = 0; index1 < array.Length; ++index1)
                {
                    if (index1 > ProxyCore.__selectedVip72Index)
                    {
                        ProxyCore.__selectedVip72Index = index1;
                        bool   flag = false;
                        string str1 = (string)null;
                        if (ProxyCore.__process == null || ProxyCore.__process.HasExited)
                        {
                            Dictionary <string, object> dictionary = (Dictionary <string, object>)array.GetValue(index1);
                            ProxyCore.handle = new IntPtr(-1);
                            if (ProxyCore.__process != null)
                            {
                                try
                                {
                                    ProxyCore.kill(ProxyCore.__process);
                                }
                                catch
                                {
                                }
                                ProxyCore.__process = (Process)null;
                            }
                            string      str2         = dictionary["username"].ToString();
                            string      str3         = dictionary["password"].ToString();
                            RegistryKey registryKey1 = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers", true);
                            if (registryKey1 != null)
                            {
                                registryKey1.SetValue(GlobalConfig.executableDirectory() + "\\Tools\\vip72socks\\vip72socks.exe", (object)"HIGHDPIAWARE", RegistryValueKind.String);
                                registryKey1.Close();
                            }
                            else
                            {
                                Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers");
                                RegistryKey registryKey2 = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers", true);
                                if (registryKey2 != null)
                                {
                                    registryKey2.SetValue(GlobalConfig.executableDirectory() + "\\Tools\\vip72socks\\vip72socks.exe", (object)"HIGHDPIAWARE", RegistryValueKind.String);
                                    registryKey2.Close();
                                }
                            }
                            ProxyCore.__process = Process.Start(new ProcessStartInfo()
                            {
                                WorkingDirectory = GlobalConfig.executableDirectory() + "/Tools/vip72socks",
                                FileName         = GlobalConfig.executableDirectory() + "/Tools/vip72socks/vip72socks.exe",
                                Arguments        = "-login;" + str2 + ":" + str3 + "; -mp:" + (object)LocalConfig.getCurrentConfig().getSSHAndVip72Port()
                            });
                            while (ProxyCore.handle.ToInt32() <= 0)
                            {
                                ProxyCore.handle = ProxyCore.__process.MainWindowHandle;
                                Thread.Sleep(200);
                            }
                            Console.WriteLine((object)ProxyCore.handle);
                            ProxyCore.vip72h = new Vip72Handle(ProxyCore.handle);
                            Thread.Sleep(200);
                            ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.Login);
                            while (!flag)
                            {
                                IntPtr windowHandle = ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status);
                                if (windowHandle.ToInt32() > 0)
                                {
                                    string controlText = Vip72Handle.GetControlText(windowHandle);
                                    if (controlText.Length > 0)
                                    {
                                        if (controlText.Contains("ERROR") || controlText.Contains("DISCONNECT"))
                                        {
                                            ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.Exit);
                                            str1 = (string)null;
                                            break;
                                        }
                                        if (controlText.Contains("ready"))
                                        {
                                            str1 = Vip72Handle.GetControlText(ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Info));
                                            flag = true;
                                        }
                                    }
                                    Thread.Sleep(200);
                                }
                                else
                                {
                                    str1 = (string)null;
                                    flag = true;
                                }
                            }
                            if (str1 != null)
                            {
                                if (flag)
                                {
                                    ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.SelectCountry);
                                    flag = false;
                                }
                                while (!flag)
                                {
                                    IntPtr windowHandle = ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status);
                                    if (windowHandle.ToInt32() > 0)
                                    {
                                        string controlText = Vip72Handle.GetControlText(windowHandle);
                                        if (controlText.Length > 0)
                                        {
                                            if (controlText.Contains("ERROR") || controlText.Contains("DISCONNECT"))
                                            {
                                                ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.Exit);
                                                str1 = (string)null;
                                                break;
                                            }
                                            if (controlText.Contains("Total"))
                                            {
                                                str1 = Vip72Handle.GetControlText(ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status));
                                                flag = true;
                                            }
                                        }
                                        Thread.Sleep(200);
                                    }
                                    else
                                    {
                                        str1 = (string)null;
                                        flag = true;
                                    }
                                }
                                if (str1 == null)
                                {
                                    ProxyCore.__process = (Process)null;
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            flag = false;
                            str1 = "Reuse";
                            ProxyCore.__currentVip72Handle.showWindow();
                            ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.SelectCountry);
                            while (!flag)
                            {
                                IntPtr windowHandle = ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status);
                                if (windowHandle.ToInt32() > 0)
                                {
                                    string controlText = Vip72Handle.GetControlText(windowHandle);
                                    if (controlText.Length > 0)
                                    {
                                        if (controlText.Contains("ERROR") || controlText.Contains("DISCONNECT"))
                                        {
                                            ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.Exit);
                                            str1 = (string)null;
                                            break;
                                        }
                                        if (controlText.Contains("Total"))
                                        {
                                            str1 = Vip72Handle.GetControlText(ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status));
                                            flag = true;
                                        }
                                    }
                                    Thread.Sleep(200);
                                }
                                else
                                {
                                    str1 = (string)null;
                                    flag = true;
                                }
                            }
                            if (str1 == null)
                            {
                                ProxyCore.__process = (Process)null;
                                continue;
                            }
                        }
                        if (flag)
                        {
                            IntPtr windowHandle = ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.SelectCountryListView);
                            Console.WriteLine(Vip72Handle.GetWindowClassName(windowHandle));
                            int index2 = 0;
                            int num    = 0;
                            List <List <string> > listViewItems1 = Vip72Handle.GetListViewItems(windowHandle);
                            for (int index3 = 0; index3 < listViewItems1.Count; ++index3)
                            {
                                List <string> stringList = listViewItems1[index3];
                                if (stringList[0].Equals(country))
                                {
                                    index2 = index3;
                                    num    = Convert.ToInt32(stringList[1]);
                                    break;
                                }
                            }
                            Vip72Handle.selectListViewItem(windowHandle, index2, true);
                            if (region != null && num > 170)
                            {
                                ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.SelectRegion);
                                IntPtr handle = windowHandle;
                                List <List <string> > listViewItems2;
                                for (listViewItems2 = Vip72Handle.GetListViewItems(handle); listViewItems2.Count == listViewItems1.Count || listViewItems2.Count == 0; listViewItems2 = Vip72Handle.GetListViewItems(handle))
                                {
                                    Thread.Sleep(1000);
                                }
                                for (int index3 = 0; index3 < listViewItems2.Count; ++index3)
                                {
                                    List <string> stringList = listViewItems2[index3];
                                    if (stringList.Count > 0 && stringList[0].Equals(region))
                                    {
                                        Vip72Handle.selectListViewItem(handle, index3, true);
                                        break;
                                    }
                                }
                            }
                            ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.GetProxyByGEO);
                            flag = false;
                        }
                        while (!flag)
                        {
                            IntPtr windowHandle = ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status);
                            if (windowHandle.ToInt32() > 0)
                            {
                                string controlText = Vip72Handle.GetControlText(windowHandle);
                                if (controlText.Length > 0)
                                {
                                    if (controlText.ToUpper().Contains("ERROR") || controlText.ToUpper().Contains("DISCONNECT"))
                                    {
                                        ProxyCore.vip72h.SendLeftClickToWindow(Vip72Handle.Vip72Window.Exit);
                                        str1 = (string)null;
                                        break;
                                    }
                                    if (controlText.Contains("Ok"))
                                    {
                                        str1 = Vip72Handle.GetControlText(ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status));
                                        flag = true;
                                    }
                                    else if (controlText.Contains("ONLY"))
                                    {
                                        str1 = Vip72Handle.GetControlText(ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.Status));
                                        flag = true;
                                    }
                                }
                                Thread.Sleep(200);
                            }
                            else
                            {
                                str1 = (string)null;
                                flag = true;
                            }
                        }
                        if (str1 != null)
                        {
                            if (!flag)
                            {
                                break;
                            }
                            List <IntPtr>          allChildHandles  = ProxyCore.vip72h.GetAllChildHandles();
                            Vip72Handle.WINDOWINFO childWindowInfo1 = Vip72Handle.GetChildWindowInfo(ProxyCore.handle);
                            for (int index2 = 0; index2 < allChildHandles.Count; ++index2)
                            {
                                IntPtr num1        = allChildHandles[index2];
                                string controlText = Vip72Handle.GetControlText(num1);
                                Vip72Handle.WINDOWINFO childWindowInfo2 = Vip72Handle.GetChildWindowInfo(num1);
                                int num2 = childWindowInfo2.rcWindow.top - childWindowInfo1.rcWindow.top;
                                int num3 = childWindowInfo2.rcWindow.left - childWindowInfo1.rcWindow.left;
                                int num4 = childWindowInfo2.rcWindow.bottom - childWindowInfo2.rcWindow.top;
                                int num5 = childWindowInfo2.rcWindow.right - childWindowInfo2.rcWindow.left;
                                Console.WriteLine("*** [" + Vip72Handle.GetWindowClassName(num1) + "] : " + controlText + " " + (object)num2 + " : " + (object)num3 + " : " + (object)num4 + " : " + (object)num5);
                            }
                            IntPtr windowHandle = ProxyCore.vip72h.GetWindowHandle(Vip72Handle.Vip72Window.AllProxiesListView);
                            Console.WriteLine("All Proxies visible:" + Vip72Handle.IsWindowVisible(windowHandle).ToString());
                            ProxyCore.__vip72ProxiesList = Vip72Handle.GetListViewItems(windowHandle);
                            Thread.Sleep(1000);
                            ProxyCore.__currentVip72Handle = ProxyCore.vip72h;
                            ProxyCore.__allProxiesHandle   = windowHandle;
                            ProxyCore.selectNextIP(preferIp, out ip);
                            AutoLeadClientHelper.reloadNetwork();
                            break;
                        }
                    }
                }
                break;

            case ProxyTool.SSH:
                if (ProxyCore.previousSshInfo != null)
                {
                    Dictionary <string, object> previousSshInfo = ProxyCore.previousSshInfo;
                    LocalConfig.getCurrentConfig().getLiveSSH(ProxyCore.__country, true, GlobalConfig.SSHRefresh);
                    ProxyCore.previousSshInfo = (Dictionary <string, object>)null;
                    if (previousSshInfo == null)
                    {
                        break;
                    }
                    ProxyCore.setupProxy(ProxyCore.__tool, new IndexItem(0, previousSshInfo)
                    {
                        hostKeyFp = previousSshInfo["fp"].ToString()
                    }, out ip);
                    GlobalConfig.currentSSH = previousSshInfo;
                    break;
                }
                Dictionary <string, object> liveSsh = LocalConfig.getCurrentConfig().getLiveSSH(ProxyCore.__country, true, GlobalConfig.SSHRefresh);
                if (liveSsh != null)
                {
                    ProxyCore.setupProxy(ProxyCore.__tool, new IndexItem(0, liveSsh)
                    {
                        hostKeyFp = liveSsh["fp"].ToString()
                    }, out ip);
                    GlobalConfig.currentSSH = liveSsh;
                }
                break;
            }
        }
Esempio n. 23
0
 public void SetWindowText(Vip72Handle.Vip72Window window, string text)
 {
     Vip72Handle.SetWindowText(this.GetWindowHandle(window), text);
 }
Esempio n. 24
0
 public bool hideWindow()
 {
     return(Vip72Handle.ShowWindow(this._MainHandle, Vip72Handle.ShowWindowCommands.Hide));
 }
Esempio n. 25
0
 public static Size GetWindowSize(IntPtr handle)
 {
     Vip72Handle.WINDOWINFO pwi = new Vip72Handle.WINDOWINFO(new bool?(false));
     Vip72Handle.GetWindowInfo(handle, ref pwi);
     return(new Size(pwi.rcWindow.right - pwi.rcWindow.left, pwi.rcWindow.bottom - pwi.rcWindow.top));
 }
Esempio n. 26
0
 public int SetTextHookProc(int nCode, IntPtr wParam, IntPtr lParam)
 {
     Console.WriteLine("*** SetText");
     return(Vip72Handle.CallNextHookEx(Vip72Handle.hHook, nCode, wParam, lParam));
 }
Esempio n. 27
0
 public static bool IsButtonChecked(IntPtr handle)
 {
     return((Vip72Handle.GetChildWindowInfo(handle).dwStyle & 65536U) > 0U);
 }
Esempio n. 28
0
 public static void Move(int xDelta, int yDelta)
 {
     Vip72Handle.mouse_event(1, xDelta, yDelta, 0, 0);
 }
Esempio n. 29
0
        public static bool selectNextIP(string referIP, out string nextIP)
        {
            if (ProxyCore.__tool == ProxyTool.Vip72)
            {
                nextIP = (string)null;
                GlobalConfig.currentSSH = (Dictionary <string, object>)null;
                if (ProxyCore.__allProxiesHandle != IntPtr.Zero && ProxyCore.__currentVip72Handle != null)
                {
                    ProxyCore.__currentVip72Handle.showWindow();
                    ProxyCore.__allProxiesHandle = ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.AllProxiesListView);
                    int itemCount = Vip72Handle.ListView_GetItemCount(ProxyCore.__allProxiesHandle);
                    int index1;
                    if (referIP != null)
                    {
                        ProxyCore.__currentVip72Handle.SendLeftClickToWindow(Vip72Handle.Vip72Window.MyProxies);
                        IntPtr windowHandle = ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.MyProxiesListView);
                        for (int count = Vip72Handle.GetListViewItems(windowHandle).Count; count > 0; --count)
                        {
                            Vip72Handle.deleteListViewItem(windowHandle, 0);
                        }
                        ProxyCore.__currentVip72Handle.SendLeftClickToWindow(Vip72Handle.Vip72Window.AllProxies);
                        ProxyCore.__vip72ProxiesList = Vip72Handle.GetListViewItems(ProxyCore.__allProxiesHandle);
                        int    num  = -1;
                        string text = (string)null;
                        for (int index2 = 0; index2 < ProxyCore.__vip72ProxiesList.Count; ++index2)
                        {
                            List <string> vip72Proxies = ProxyCore.__vip72ProxiesList[index2];
                            if (ProxyCore.compare_vip72ip(vip72Proxies[0], referIP))
                            {
                                num  = index2;
                                text = vip72Proxies[0];
                                break;
                            }
                        }
                        if (num == -1)
                        {
                            num = GlobalConfig.random.Next(ProxyCore.__vip72ProxiesList.Count);
                        }
                        string[] strArray = GlobalConfig.stringSplit(GlobalConfig.stringSplit(text, ",")[0].Trim(), ".");
                        ProxyCore.__selectedVip72IP.Remove(strArray[0] + "." + strArray[1] + "." + strArray[2] + ".***");
                        ProxyCore.__selectedVip72IP.Add(strArray[0] + "." + strArray[1] + "." + strArray[2] + ".***");
                        index1 = num;
                    }
                    else
                    {
                        ProxyCore.__currentVip72Handle.SendLeftClickToWindow(Vip72Handle.Vip72Window.MyProxies);
                        IntPtr windowHandle = ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.MyProxiesListView);
                        for (int count = Vip72Handle.GetListViewItems(windowHandle).Count; count > 0; --count)
                        {
                            Vip72Handle.deleteListViewItem(windowHandle, 0);
                        }
                        ProxyCore.__currentVip72Handle.SendLeftClickToWindow(Vip72Handle.Vip72Window.AllProxies);
                        ProxyCore.__vip72ProxiesList = Vip72Handle.GetListViewItems(ProxyCore.__allProxiesHandle);
                        string     text1   = (string)null;
                        List <int> intList = new List <int>();
                        for (int index2 = 0; index2 < ProxyCore.__vip72ProxiesList.Count; ++index2)
                        {
                            string[] strArray = GlobalConfig.stringSplit(ProxyCore.__vip72ProxiesList[index2][0], ".");
                            string   str      = strArray[0] + "." + strArray[1] + "." + strArray[2] + ".***";
                            if (!ProxyCore.__selectedVip72IP.Contains(str))
                            {
                                intList.Add(index2);
                            }
                        }
                        int index3;
                        if (intList.Count == 0)
                        {
                            index3 = -1;
                        }
                        else
                        {
                            index3 = intList[GlobalConfig.random.Next(intList.Count)];
                            string[] strArray = GlobalConfig.stringSplit(ProxyCore.__vip72ProxiesList[index3][0], ".");
                            text1 = strArray[0] + "." + strArray[1] + "." + strArray[2] + ".***";
                        }
                        if (index3 == -1)
                        {
                            ProxyCore.__selectedVip72IP.Clear();
                            index3 = GlobalConfig.random.Next(ProxyCore.__vip72ProxiesList.Count);
                            string[] strArray = GlobalConfig.stringSplit(ProxyCore.__vip72ProxiesList[index3][0], ".");
                            text1 = strArray[0] + "." + strArray[1] + "." + strArray[2] + ".***";
                        }
                        string   text2     = GlobalConfig.stringSplit(text1, ",")[0].Trim();
                        string[] strArray1 = GlobalConfig.stringSplit(text2, ".");
                        ProxyCore.__selectedVip72IP.Remove(strArray1[0] + "." + strArray1[1] + "." + strArray1[2] + ".***");
                        ProxyCore.__selectedVip72IP.Add(strArray1[0] + "." + strArray1[1] + "." + strArray1[2] + ".***");
                        index1 = index3;
                        ProxyCore.writeLog("\r\nWill select ip: " + text2 + " index: " + (object)index3);
                    }
                    if (itemCount <= index1)
                    {
                        return(false);
                    }
                    ProxyCore.__currentVip72Handle.SendLeftClickToWindow(Vip72Handle.Vip72Window.MyProxies);
                    IntPtr windowHandle1 = ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.MyProxiesListView);
                    for (int count = Vip72Handle.GetListViewItems(windowHandle1).Count; count > 0; --count)
                    {
                        Vip72Handle.deleteListViewItem(windowHandle1, 0);
                    }
                    ProxyCore.__currentVip72Handle.SendLeftClickToWindow(Vip72Handle.Vip72Window.AllProxies);
                    bool   flag          = false;
                    IntPtr windowHandle2 = ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.CurrentSock);
                    string b             = Vip72Handle.GetControlText(windowHandle2);
                    List <List <string> > listViewItems = Vip72Handle.GetListViewItems(ProxyCore.__allProxiesHandle);
                    ProxyCore.writeLog("\r\n*** IP1: " + listViewItems[index1][0]);
                    ProxyCore.writeLog("\r\n*** Begin select ***");
                    Vip72Handle.selectListViewItem(ProxyCore.__allProxiesHandle, index1, true);
                    ProxyCore.writeLog("\r\n*** End select ***");
                    string a = listViewItems[index1][0];
                    ProxyCore.writeLog("\r\n*** IP2: " + a);
                    while (!flag)
                    {
                        if (ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.CurrentSock).ToInt32() > 0)
                        {
                            string controlText = Vip72Handle.GetControlText(ProxyCore.__currentVip72Handle.GetWindowHandle(Vip72Handle.Vip72Window.Status));
                            b = Vip72Handle.GetControlText(windowHandle2);
                            if (controlText != null)
                            {
                                if (controlText.Contains("checked") && ProxyCore.compare_vip72ip(a, b))
                                {
                                    flag = true;
                                    b    = Vip72Handle.GetControlText(windowHandle2);
                                }
                                else if (controlText.Contains("ERROR") || controlText.Contains("DISCONNECT"))
                                {
                                    flag = true;
                                    b    = (string)null;
                                }
                                else
                                {
                                    Thread.Sleep(200);
                                }
                            }
                            else
                            {
                                flag = true;
                                b    = (string)null;
                            }
                        }
                        else
                        {
                            flag = true;
                            b    = (string)null;
                        }
                    }
                    ProxyCore.__currentVip72Handle.hideWindow();
                    if (b != null)
                    {
                        nextIP = b;
                        return(true);
                    }
                }
                return(false);
            }
            nextIP = (string)null;

            if (ProxyCore.previousSshInfo != null)
            {
                Dictionary <string, object> previousSshInfo = ProxyCore.previousSshInfo;
                LocalConfig.getCurrentConfig().getLiveSSH(ProxyCore.__country, false, GlobalConfig.SSHRefresh);
                ProxyCore.previousSshInfo = (Dictionary <string, object>)null;
                if (previousSshInfo == null)
                {
                    return(false);
                }
                ProxyCore.setupProxy(ProxyCore.__tool, new IndexItem(0, previousSshInfo)
                {
                    hostKeyFp = previousSshInfo["fp"].ToString()
                }, out nextIP);
                GlobalConfig.currentSSH = previousSshInfo;
                return(true);
            }
            Dictionary <string, object> liveSsh = LocalConfig.getCurrentConfig().getLiveSSH(ProxyCore.__country, true, GlobalConfig.SSHRefresh);

            if (liveSsh == null)
            {
                return(false);
            }
            ProxyCore.setupProxy(ProxyCore.__tool, new IndexItem(0, liveSsh)
            {
                hostKeyFp = liveSsh["fp"].ToString()
            }, out nextIP);
            GlobalConfig.currentSSH = liveSsh;
            return(true);
        }
Esempio n. 30
0
 public static void MoveTo(int x, int y)
 {
     Vip72Handle.mouse_event(32769, x, y, 0, 0);
 }