예제 #1
0
        // Token: 0x060005D1 RID: 1489 RVA: 0x000347AC File Offset: 0x000329AC
        public bool vip72login(string username, string password, int mainPort)
        {
            Thread.Sleep(1000);
            Process[] processByName = this.GetProcessByName("vip72socks");
            if (processByName.Count <Process>() > 0)
            {
                if (!processByName[0].Responding)
                {
                    try
                    {
                        if (!processByName[0].HasExited)
                        {
                            processByName[0].Kill();
                        }
                    }
                    catch (Exception)
                    {
                    }
                    return(this.vip72login(username, password, mainPort));
                }
            }

            IntPtr parentHandle = IntPtr.Zero;

            if (processByName.Count <Process>() > 0)
            {
                parentHandle = Vip72Chung.FindWindowInProcess(processByName[0], (string s) => s.StartsWith("VIP72 Socks Client"));
            }
            IntPtr intPtr = Vip72Chung.ControlGetHandle(parentHandle, "Button", 119);
            bool   result;

            if (intPtr != IntPtr.Zero)
            {
                if (!Vip72Chung.ControlGetState(intPtr, 134217728))
                {
                    IntPtr hwnd = Vip72Chung.ControlGetHandle(parentHandle, "Edit", 303);
                    Vip72Chung.ControlSetText(hwnd, username);
                    IntPtr hwnd2 = Vip72Chung.ControlGetHandle(parentHandle, "Edit", 301);
                    Vip72Chung.ControlSetText(hwnd2, password);
                    Vip72Chung.ControlClick(intPtr);
                    IntPtr   hwnd3 = Vip72Chung.ControlGetHandle(parentHandle, "Edit", 131);
                    DateTime now   = DateTime.Now;
                    while (Vip72Chung.ControlGetText(hwnd3) != "System ready")
                    {
                        if (processByName.Count <Process>() > 0)
                        {
                            processByName = this.GetProcessByName("vip72socks");
                            if (!processByName[0].Responding)
                            {
                                try
                                {
                                    if (!processByName[0].HasExited)
                                    {
                                        processByName[0].Kill();
                                    }
                                }
                                catch (Exception)
                                {
                                }
                                return(this.vip72login(username, password, mainPort));
                            }
                        }

                        bool flag10 = processByName.Count <Process>() == 0;
                        if (flag10)
                        {
                            return(false);
                        }
                        bool flag11 = Vip72Chung.ControlGetText(hwnd3) == "ERROR!Login and Password is incorrect";
                        if (flag11)
                        {
                            return(false);
                        }
                        bool flag12 = !Vip72Chung.ControlGetState(intPtr, 134217728);
                        if (flag12)
                        {
                            return(false);
                        }
                        Thread.Sleep(100);
                        bool flag13 = (DateTime.Now - now).Seconds > 20;
                        if (flag13)
                        {
                            return(false);
                        }
                    }
                    Thread.Sleep(3000);
                }
                result = true;
            }
            else
            {
                processByName = this.GetProcessByName("vip72socks");
                bool flag14 = processByName.Count <Process>() != 0;
                if (flag14)
                {
                    try
                    {
                        bool flag15 = !processByName[0].HasExited;
                        if (flag15)
                        {
                            processByName[0].Kill();
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
                Process.Start(new ProcessStartInfo
                {
                    FileName         = "vip72socks.exe",
                    WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory + "vip72"
                });
                Thread.Sleep(500);
                bool flag16 = this.vip72login(username, password, mainPort);
                result = flag16;
            }
            return(result);
        }
예제 #2
0
        public bool vip72login(string username, string password, int mainPort)
        {
            bool flag;

            Thread.Sleep(1000);
            Process[] processByName = this.GetProcessByName("vip72socks");
            if (processByName.Count <Process>() > 0)
            {
                if (!processByName[0].Responding)
                {
                    try
                    {
                        if (!processByName[0].HasExited)
                        {
                            processByName[0].Kill();
                        }
                    }
                    catch (Exception exception)
                    {
                    }
                    flag = this.vip72login(username, password, mainPort);
                    return(flag);
                }
            }
            IntPtr zero = IntPtr.Zero;

            if (processByName.Count <Process>() > 0)
            {
                zero = Vip72Chung.FindWindowInProcess(processByName[0], (string s) => s.StartsWith("VIP72 Socks Client"));
            }
            IntPtr intPtr = Vip72Chung.ControlGetHandle(zero, "Button", 119);

            if (intPtr == IntPtr.Zero)
            {
                processByName = this.GetProcessByName("vip72socks");
                if (processByName.Count <Process>() != 0)
                {
                    try
                    {
                        if (!processByName[0].HasExited)
                        {
                            processByName[0].Kill();
                        }
                    }
                    catch (Exception exception1)
                    {
                    }
                }
                ProcessStartInfo processStartInfo = new ProcessStartInfo()
                {
                    FileName         = "vip72socks.exe",
                    WorkingDirectory = string.Concat(AppDomain.CurrentDomain.BaseDirectory, "vip72")
                };
                Process.Start(processStartInfo);
                Thread.Sleep(500);
                flag = (!this.vip72login(username, password, mainPort) ? false : true);
            }
            else
            {
                if (!Vip72Chung.ControlGetState(intPtr, 134217728))
                {
                    IntPtr intPtr1 = Vip72Chung.ControlGetHandle(zero, "Edit", 303);
                    Vip72Chung.ControlSetText(intPtr1, username);
                    IntPtr intPtr2 = Vip72Chung.ControlGetHandle(zero, "Edit", 301);
                    Vip72Chung.ControlSetText(intPtr2, password);
                    Vip72Chung.ControlClick(intPtr);
                    IntPtr   intPtr3 = Vip72Chung.ControlGetHandle(zero, "Edit", 131);
                    DateTime now     = DateTime.Now;
                    while (Vip72Chung.ControlGetText(intPtr3) != "System ready")
                    {
                        if (processByName.Count <Process>() > 0)
                        {
                            processByName = this.GetProcessByName("vip72socks");
                            if (!processByName[0].Responding)
                            {
                                try
                                {
                                    if (!processByName[0].HasExited)
                                    {
                                        processByName[0].Kill();
                                    }
                                }
                                catch (Exception exception2)
                                {
                                }
                                if (!this.vip72login(username, password, mainPort))
                                {
                                    flag = false;
                                    return(flag);
                                }
                                else
                                {
                                    flag = true;
                                    return(flag);
                                }
                            }
                        }
                        if (processByName.Count <Process>() == 0)
                        {
                            flag = false;
                            return(flag);
                        }
                        else if (Vip72Chung.ControlGetText(intPtr3) == "ERROR!Login and Password is incorrect")
                        {
                            flag = false;
                            return(flag);
                        }
                        else if (Vip72Chung.ControlGetState(intPtr, 134217728))
                        {
                            Thread.Sleep(100);
                            if ((DateTime.Now - now).Seconds > 20)
                            {
                                flag = false;
                                return(flag);
                            }
                        }
                        else
                        {
                            flag = false;
                            return(flag);
                        }
                    }
                    Thread.Sleep(3000);
                }
                flag = true;
            }
            return(flag);
        }
예제 #3
0
        // Token: 0x06000477 RID: 1143 RVA: 0x00029840 File Offset: 0x00027A40
        public bool vip72login(string username, string password, int mainPort)
        {
            Thread.Sleep(1000);
            Process[] processByName = this.GetProcessByName("vip72socks");
            bool      flag          = processByName.Count <Process>() > 0;
            bool      result;

            if (flag)
            {
                bool flag2 = !processByName[0].Responding;
                if (flag2)
                {
                    try
                    {
                        bool flag3 = !processByName[0].HasExited;
                        if (flag3)
                        {
                            processByName[0].Kill();
                        }
                    }
                    catch (Exception)
                    {
                    }
                    result = this.vip72login(username, password, mainPort);
                    return(result);
                }
            }
            IntPtr parentHandle = IntPtr.Zero;
            bool   flag4        = processByName.Count <Process>() > 0;

            if (flag4)
            {
                Process             arg_A3_0 = processByName[0];
                Func <string, bool> arg_A3_1;
                if ((arg_A3_1 = Vip72Chung.< > c.< > 9__32_0) == null)
                {
                    arg_A3_1 = (Vip72Chung.< > c.< > 9__32_0 = new Func <string, bool>(Vip72Chung.< > c.< > 9. < vip72login > b__32_0));
                }
                parentHandle = Vip72Chung.FindWindowInProcess(arg_A3_0, arg_A3_1);
            }
            IntPtr intPtr = Vip72Chung.ControlGetHandle(parentHandle, "Button", 119);
            bool   flag5  = intPtr != IntPtr.Zero;

            if (flag5)
            {
                bool flag6 = !Vip72Chung.ControlGetState(intPtr, 134217728);
                if (flag6)
                {
                    IntPtr hwnd = Vip72Chung.ControlGetHandle(parentHandle, "Edit", 303);
                    Vip72Chung.ControlSetText(hwnd, username);
                    IntPtr hwnd2 = Vip72Chung.ControlGetHandle(parentHandle, "Edit", 301);
                    Vip72Chung.ControlSetText(hwnd2, password);
                    Vip72Chung.ControlClick(intPtr);
                    IntPtr   hwnd3 = Vip72Chung.ControlGetHandle(parentHandle, "Edit", 131);
                    DateTime now   = DateTime.Now;
                    while (Vip72Chung.ControlGetText(hwnd3) != "System ready")
                    {
                        bool flag7 = processByName.Count <Process>() > 0;
                        if (flag7)
                        {
                            processByName = this.GetProcessByName("vip72socks");
                            bool flag8 = !processByName[0].Responding;
                            if (flag8)
                            {
                                try
                                {
                                    bool flag9 = !processByName[0].HasExited;
                                    if (flag9)
                                    {
                                        processByName[0].Kill();
                                    }
                                }
                                catch (Exception)
                                {
                                }
                                bool flag10 = this.vip72login(username, password, mainPort);
                                result = flag10;
                                return(result);
                            }
                        }
                        bool flag11 = processByName.Count <Process>() == 0;
                        if (flag11)
                        {
                            result = false;
                            return(result);
                        }
                        bool flag12 = Vip72Chung.ControlGetText(hwnd3) == "ERROR!Login and Password is incorrect";
                        if (flag12)
                        {
                            result = false;
                            return(result);
                        }
                        bool flag13 = !Vip72Chung.ControlGetState(intPtr, 134217728);
                        if (flag13)
                        {
                            result = false;
                            return(result);
                        }
                        Thread.Sleep(100);
                        bool flag14 = (DateTime.Now - now).Seconds > 20;
                        if (flag14)
                        {
                            result = false;
                            return(result);
                        }
                    }
                    Thread.Sleep(3000);
                }
                result = true;
            }
            else
            {
                processByName = this.GetProcessByName("vip72socks");
                bool flag15 = processByName.Count <Process>() != 0;
                if (flag15)
                {
                    try
                    {
                        bool flag16 = !processByName[0].HasExited;
                        if (flag16)
                        {
                            processByName[0].Kill();
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
                Process.Start(new ProcessStartInfo
                {
                    FileName         = "vip72socks.exe",
                    WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory + "vip72"
                });
                Thread.Sleep(500);
                bool flag17 = this.vip72login(username, password, mainPort);
                result = flag17;
            }
            return(result);
        }