Exemple #1
0
        public void clearIpWithPort(int port)
        {
            Process[] kq   = this.GetProcessByName("vip72socks");
            bool      flag = kq.Count <Process>() > 0;

            if (flag)
            {
                foreach (Process process in kq)
                {
                    bool flag2 = Vip72Rieng.ControlGetText(Vip72Rieng.ControlGetHandle(Vip72Rieng.FindWindowInProcess(Vip72Rieng.Vip72RiengProcess, (string s) => s.StartsWith("VIP72 Socks Client")), "Static", 7955)).EndsWith(":" + port.ToString());
                    if (flag2)
                    {
                        process.Kill();
                    }
                }
            }
        }
Exemple #2
0
        public void testssh()
        {
            Thread.Sleep(1000);
            Process[] processByName = this.GetProcessByName("BvSsh");
            int       index         = 0;

            if (index < processByName.Length)
            {
                Vip72Rieng.Vip72RiengProcess = processByName[index];
            }
            Vip72Rieng.ControlGetHandle((IntPtr)61454, "CLogCtrl", 1002);
            DateTime now = DateTime.Now;

            Vip72Rieng.ControlGetText((IntPtr)398388);
            IntPtr        hWnd  = (IntPtr)398388;
            StringBuilder text1 = new StringBuilder();
            StringBuilder text2 = new StringBuilder(Vip72Rieng.SendMessage(hWnd, 14, (int)IntPtr.Zero, text1) + 1);

            Vip72Rieng.SendMessage(hWnd, 13, text2.Capacity, text2);
            text2.ToString();
        }
Exemple #3
0
        public string clickip(int port)
        {
            string str;

            if (Vip72Rieng.Vip72RiengProcess.HasExited)
            {
                str = "not running";
            }
            else
            {
                IntPtr windowInProcess = Vip72Rieng.FindWindowInProcess(Vip72Rieng.Vip72RiengProcess, (Func <string, bool>)(s => s.StartsWith("VIP72 Socks Client")));
                int    num1            = 4328465;
                int    lpBaseAddress   = 4324304;
                IntPtr handle1         = Vip72Rieng.ControlGetHandle(windowInProcess, "Button", 7817);
                if (Vip72Rieng.ControlGetCheck(handle1))
                {
                    Vip72Rieng.ControlClick(handle1);
                }
                IntPtr hProcess            = Vip72Rieng.OpenProcess(2035711, false, Vip72Rieng.Vip72RiengProcess.Id);
                int    lpNumberOfBytesRead = 0;
                IntPtr zero      = IntPtr.Zero;
                IntPtr lpBuffer1 = Marshal.AllocHGlobal(4);
                Vip72Rieng.ReadProcessMemory(hProcess, (IntPtr)num1, lpBuffer1, 4, out lpNumberOfBytesRead);
                Random random  = new Random();
                uint   id      = (uint)Vip72Rieng.Vip72RiengProcess.Id;
                IntPtr handle2 = Vip72Rieng.ControlGetHandle(windowInProcess, "SysListView32", 117);
                int    num2    = 0;
                while (ListViewItem1.GetListViewItem(handle2, id, num2, 4) != "")
                {
                    string listViewItem = ListViewItem1.GetListViewItem(handle2, id, num2, 4);
                    if ((listViewItem.Contains(port.ToString()) ? 1U : (listViewItem.Contains("main stream") ? 1U : 0U)) > 0U)
                    {
                        ListViewItem1.SelectListViewItem(handle2, id, num2);
                        int lpdwResult = 0;
                        Vip72Rieng.SendMessageTimeout(handle2, 256, (IntPtr)46, IntPtr.Zero, 2, 5000, out lpdwResult);
                    }
                    else
                    {
                        ++num2;
                    }
                }
                int    num3    = 0;
                IntPtr handle3 = Vip72Rieng.ControlGetHandle(windowInProcess, "SysListView32", 116);
                while (ListViewItem1.GetListViewItem(handle3, id, num3, 0) != "")
                {
                    ++num3;
                }
                int maxValue = num3;
                if (maxValue == 0)
                {
                    str = "no IP";
                }
                else
                {
                    int num4 = 0;
                    int num5 = -1;
                    for (; ListViewItem1.GetListViewItem(handle3, id, num4, 0) != ""; ++num4)
                    {
                        if (ListViewItem1.GetListViewItem(handle3, id, num4, 0).Contains(".**"))
                        {
                            num5 = random.Next(0, maxValue);
                            while (!ListViewItem1.GetListViewItem(handle3, id, num5, 0).Contains(".**"))
                            {
                                num5 = random.Next(0, maxValue);
                            }
                            break;
                        }
                    }
                    if (num5 == -1)
                    {
                        str = "no IP";
                    }
                    else
                    {
                        int[] lpBuffer2 = new int[1] {
                            num5
                        };
                        int lpNumberOfBytesWritten = 0;
                        Vip72Rieng.WriteProcessMemory((int)hProcess, lpBaseAddress, lpBuffer2, 4, ref lpNumberOfBytesWritten);
                        ListViewItem1.SelectListViewItem(handle3, id, num5);
                        Vip72Rieng.ControlDoubleClick(handle3);
                        Thread.Sleep(500);
                        IntPtr   handle4 = Vip72Rieng.ControlGetHandle(windowInProcess, "Button", 7303);
                        IntPtr   handle5 = Vip72Rieng.ControlGetHandle(windowInProcess, "Edit", 131);
                        DateTime now     = DateTime.Now;
                        while (!Vip72Rieng.ControlGetCheck(handle4))
                        {
                            if (!Vip72Rieng.ControlGetText(handle5).Contains("ffline"))
                            {
                                if (!Vip72Rieng.ControlGetText(handle5).Contains("limit"))
                                {
                                    if (!Vip72Rieng.ControlGetText(handle5).Contains("can't"))
                                    {
                                        if (!Vip72Rieng.ControlGetText(handle5).Contains("disconnect"))
                                        {
                                            if (!Vip72Rieng.ControlGetText(handle5).Contains("aximum"))
                                            {
                                                if ((DateTime.Now - now).TotalSeconds > 15.0)
                                                {
                                                    str = "timeout";
                                                    goto label_49;
                                                }
                                            }
                                            else
                                            {
                                                str = "maximum";
                                                goto label_49;
                                            }
                                        }
                                        else
                                        {
                                            str = "dead";
                                            goto label_49;
                                        }
                                    }
                                    else
                                    {
                                        str = "dead";
                                        goto label_49;
                                    }
                                }
                                else
                                {
                                    try
                                    {
                                        if (!Vip72Rieng.Vip72RiengProcess.HasExited)
                                        {
                                            Vip72Rieng.Vip72RiengProcess.Kill();
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                    str = "limited";
                                    goto label_49;
                                }
                            }
                            else
                            {
                                str = "dead";
                                goto label_49;
                            }
                        }
                        Thread.Sleep(500);
                        IntPtr handle6 = Vip72Rieng.ControlGetHandle(windowInProcess, "SysListView32", 117);
                        for (int index = 0; ListViewItem1.GetListViewItem(handle6, id, index, 4) != ""; ++index)
                        {
                            if (ListViewItem1.GetListViewItem(handle6, id, index, 4).Contains("main stream"))
                            {
                                str = ListViewItem1.GetListViewItem(handle6, id, index, 0);
                                goto label_49;
                            }
                        }
                        str = "limited";
                    }
                }
            }
label_49:
            return(str);
        }
Exemple #4
0
        public bool vip72login(string username, string password, int mainPort)
        {
            Thread.Sleep(1000);
            foreach (Process process in this.GetProcessByName("vip72socks"))
            {
                bool flag = Vip72Rieng.ControlGetText(Vip72Rieng.ControlGetHandle(Vip72Rieng.FindWindowInProcess(process, (string s) => s.StartsWith("VIP72 Socks Client")), "Static", 7955)).EndsWith(":" + mainPort.ToString());
                if (flag)
                {
                    Vip72Rieng.Vip72RiengProcess = process;
                    break;
                }
            }
            bool flag2 = Vip72Rieng.Vip72RiengProcess != null && !Vip72Rieng.Vip72RiengProcess.HasExited && Vip72Rieng.Vip72RiengProcess.Responding;

            if (flag2)
            {
                bool flag3 = !Vip72Rieng.ControlGetText(Vip72Rieng.ControlGetHandle(Vip72Rieng.FindWindowInProcess(Vip72Rieng.Vip72RiengProcess, (string s) => s.StartsWith("VIP72 Socks Client")), "Static", 7955)).EndsWith(":" + mainPort.ToString());
                if (flag3)
                {
                    bool flag4 = !Vip72Rieng.Vip72RiengProcess.HasExited;
                    if (flag4)
                    {
                        Vip72Rieng.Vip72RiengProcess.Kill();
                    }
                    Vip72Rieng.Vip72RiengProcess = null;
                }
            }
            else
            {
                bool flag5 = Vip72Rieng.Vip72RiengProcess != null && !Vip72Rieng.Vip72RiengProcess.Responding;
                if (flag5)
                {
                    bool flag6 = !Vip72Rieng.Vip72RiengProcess.HasExited;
                    if (flag6)
                    {
                        Vip72Rieng.Vip72RiengProcess.Kill();
                    }
                    Vip72Rieng.Vip72RiengProcess = null;
                }
            }
            bool flag7 = Vip72Rieng.Vip72RiengProcess == null || Vip72Rieng.Vip72RiengProcess.HasExited;

            if (flag7)
            {
                ProcessStartInfo startInfo = new ProcessStartInfo
                {
                    FileName         = "vip72socks.exe",
                    WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory + "vip72",
                    Arguments        = "-mp:" + mainPort.ToString()
                };
                Vip72Rieng.Vip72RiengProcess = Process.Start(startInfo);
                IntPtr value    = Vip72Rieng.OpenProcess(2035711, false, Vip72Rieng.Vip72RiengProcess.Id);
                byte[] lpBuffer = new byte[]
                {
                    235
                };
                int num = 0;
                Vip72Rieng.WriteProcessMemory((int)value, 4234074, lpBuffer, 1, ref num);
            }
            Thread.Sleep(500);
            IntPtr parentHandle = Vip72Rieng.FindWindowInProcess(Vip72Rieng.Vip72RiengProcess, (string s) => s.StartsWith("VIP72 Socks Client"));
            IntPtr intPtr       = Vip72Rieng.ControlGetHandle(parentHandle, "Button", 119);
            IntPtr hwnd         = Vip72Rieng.ControlGetHandle(parentHandle, "Static", 7955);
            bool   flag8        = intPtr != IntPtr.Zero;
            bool   result;

            if (flag8)
            {
                Vip72Rieng.ControlSetText(hwnd, "Port:" + mainPort.ToString());
                bool flag9 = !Vip72Rieng.ControlGetState(intPtr, 134217728);
                if (flag9)
                {
                    Vip72Rieng.ControlSetText(Vip72Rieng.ControlGetHandle(parentHandle, "Edit", 303), username);
                    Vip72Rieng.ControlSetText(Vip72Rieng.ControlGetHandle(parentHandle, "Edit", 301), password);
                    Vip72Rieng.ControlClick(intPtr);
                    Vip72.ControlSetText(Vip72.ControlGetHandle("", "#32770", "Edit", 111), frmMain.tokenvip);
                    IntPtr hwnd2 = Vip72.ControlGetHandle("", "#32770", "Button", 88);
                    Vip72.ControlClick(hwnd2);
                    IntPtr   hwnd3 = Vip72Rieng.ControlGetHandle(parentHandle, "Edit", 131);
                    DateTime now   = DateTime.Now;
                    while (Vip72Rieng.ControlGetText(hwnd3) != "System ready")
                    {
                        bool flag10 = Vip72Rieng.ControlGetText(hwnd3) == "ERROR!Login and Password is incorrect";
                        if (flag10)
                        {
                            return(false);
                        }
                        bool flag11 = !Vip72Rieng.ControlGetState(intPtr, 134217728);
                        if (flag11)
                        {
                            return(false);
                        }
                        Thread.Sleep(100);
                        bool flag12 = (DateTime.Now - now).Seconds > 20;
                        if (flag12)
                        {
                            return(false);
                        }
                    }
                    Thread.Sleep(3000);
                }
                result = true;
            }
            else
            {
                result = this.vip72login(username, password, mainPort);
            }
            return(result);
        }