Beispiel #1
0
        public bool getip(byte countryindex, string country, string region, string coderegion, string city, string codecity)
        {
            byte[] lpBuffer1 = new byte[1];
            int[]  lpBuffer2 = new int[1];
            lpBuffer1[0] = countryindex;
            int  lpBaseAddress = 4482683;
            bool flag;

            if ((Vip72Rieng.Vip72RiengProcess == null ? 0U : (!Vip72Rieng.Vip72RiengProcess.HasExited ? 1U : 0U)) > 0U)
            {
                IntPtr windowInProcess        = Vip72Rieng.FindWindowInProcess(Vip72Rieng.Vip72RiengProcess, (Func <string, bool>)(s => s.StartsWith("VIP72 Socks Client")));
                IntPtr num                    = Vip72Rieng.OpenProcess(2035711, false, Vip72Rieng.Vip72RiengProcess.Id);
                int    lpNumberOfBytesWritten = 0;
                Vip72Rieng.WriteProcessMemory((int)num, lpBaseAddress, lpBuffer1, 1, ref lpNumberOfBytesWritten);
                lpBuffer2[0] = 0;
                if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "citycode\\" + country.ToString() + ".dat"))
                {
                    int int32_1 = Convert.ToInt32(coderegion);
                    if (int32_1 != (int)ushort.MaxValue)
                    {
                        lpBuffer2[0] = int32_1;
                        Vip72Rieng.WriteProcessMemory((int)num, lpBaseAddress + 1, lpBuffer2, 4, ref lpNumberOfBytesWritten);
                        if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "citycode\\Cities\\" + region.ToString() + ".dat"))
                        {
                            int int32_2 = Convert.ToInt32(codecity);
                            if (int32_2 != (int)ushort.MaxValue)
                            {
                                lpBuffer2[0] = int32_2;
                                Vip72Rieng.WriteProcessMemory((int)num, 4482686, lpBuffer2, 4, ref lpNumberOfBytesWritten);
                            }
                        }
                    }
                }
                IntPtr handle = Vip72Rieng.ControlGetHandle(windowInProcess, "Button", (int)sbyte.MaxValue);
                Vip72Rieng.ControlClick(handle);
                Vip72Rieng.ControlGetHandle(windowInProcess, "Edit", 131);
                DateTime now = DateTime.Now;
                while (Vip72Rieng.ControlGetState(handle, 134217728))
                {
                    Thread.Sleep(100);
                    if (!Vip72Rieng.Vip72RiengProcess.HasExited)
                    {
                        if ((!Vip72Rieng.Vip72RiengProcess.Responding ? 1U : ((DateTime.Now - now).TotalSeconds > 30.0 ? 1U : 0U)) > 0U)
                        {
                            try
                            {
                                if (!Vip72Rieng.Vip72RiengProcess.HasExited)
                                {
                                    Vip72Rieng.Vip72RiengProcess.Kill();
                                }
                            }
                            catch (Exception ex)
                            {
                            }
                            flag = false;
                            goto label_19;
                        }
                    }
                    else
                    {
                        flag = false;
                        goto label_19;
                    }
                }
            }
            flag = true;
label_19:
            return(flag);
        }
Beispiel #2
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);
        }