Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Win32;
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Runtime.InteropServices;
- using System.Security.Cryptography;
- using System.Text;
- internal sealed class Class26
- {
- private static readonly System.Version version_0 = typeof(Class26).Assembly.GetName().Version;
- private static readonly string string_0 = Class26.smethod_0();
- private static readonly string string_1 = Class26.smethod_1();
- private readonly System.Collections.Generic.Dictionary<string, object> dictionary_0 = new System.Collections.Generic.Dictionary<string, object>();
- private static Func<byte, System.Collections.Generic.IEnumerable<char>> func_0;
- public Class26(string string_2)
- {
- this.method_0("tid", "UA-36204578-2");
- this.method_0("aid", null);
- this.method_0("cid", Class26.string_0);
- this.method_0("t", string_2);
- this.method_0("an", "Launcher");
- this.method_0("av", Class26.version_0);
- }
- public void method_0(string string_2, object object_0)
- {
- bool? flag = object_0 as bool?;
- this.dictionary_0.Add(string_2, (!flag.HasValue) ? object_0 : (flag.GetValueOrDefault() ? 1 : 0));
- }
- public void method_1()
- {
- HttpWebRequest httpWebRequest = WebRequest.Create("https://ssl.google-analytics.com/collect") as HttpWebRequest;
- if (httpWebRequest != null)
- {
- httpWebRequest.Proxy = null;
- httpWebRequest.UserAgent = Class26.string_1;
- httpWebRequest.Method = "POST";
- System.IO.Stream stream = null;
- try
- {
- stream = httpWebRequest.GetRequestStream();
- System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(stream);
- try
- {
- stream = null;
- streamWriter.Write("v=1");
- foreach (System.Collections.Generic.KeyValuePair<string, object> current in this.dictionary_0)
- {
- string key = current.Key;
- string stringToEscape = (current.Value ?? string.Empty).ToString();
- streamWriter.Write('&');
- streamWriter.Write(Uri.EscapeDataString(key));
- streamWriter.Write('=');
- streamWriter.Write(Uri.EscapeDataString(stringToEscape));
- }
- }
- finally
- {
- ((System.IDisposable)streamWriter).Dispose();
- }
- }
- finally
- {
- if (stream != null)
- {
- stream.Dispose();
- }
- }
- httpWebRequest.GetResponse().GetResponseStream().Dispose();
- }
- }
- private static string smethod_0()
- {
- System.Guid guid;
- using (Microsoft.Win32.RegistryKey registryKey = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64))
- {
- using (Microsoft.Win32.RegistryKey registryKey2 = registryKey.OpenSubKey("SOFTWARE\\Microsoft\\Cryptography"))
- {
- if (registryKey2 == null || !System.Guid.TryParse((registryKey2.GetValue("MachineGuid") as string) ?? string.Empty, out guid))
- {
- guid = System.Guid.NewGuid();
- }
- }
- }
- System.Security.Cryptography.HMAC hMAC = new System.Security.Cryptography.HMACSHA256(guid.ToByteArray());
- string result;
- try
- {
- byte[] array = hMAC.ComputeHash(new byte[]
- {
- 36,
- 63,
- 106,
- 136,
- 133,
- 163,
- 8,
- 211,
- 19,
- 25,
- 138,
- 46,
- 3,
- 112,
- 115,
- 68,
- 164,
- 9,
- 56,
- 34,
- 41,
- 159,
- 49,
- 208,
- 8,
- 46,
- 250,
- 152,
- 236,
- 78,
- 108,
- 137,
- 69,
- 40,
- 33,
- 230,
- 56,
- 208,
- 19,
- 119,
- 190,
- 84,
- 102,
- 207,
- 52,
- 233,
- 12,
- 108,
- 192,
- 172,
- 41,
- 183,
- 201,
- 124,
- 80,
- 221,
- 63,
- 132,
- 213,
- 181,
- 181,
- 71,
- 9,
- 23,
- 146,
- 22,
- 213,
- 217,
- 137,
- 121,
- 251,
- 27,
- 209,
- 49,
- 11,
- 166,
- 152,
- 223,
- 181,
- 172,
- 47,
- 253,
- 114,
- 219,
- 208,
- 26,
- 223,
- 183,
- 184,
- 225,
- 175,
- 237,
- 106,
- 38,
- 126,
- 150,
- 186,
- 124,
- 144,
- 69,
- 241,
- 44,
- 127,
- 153,
- 36,
- 161,
- 153,
- 71,
- 179,
- 145,
- 108,
- 247,
- 8,
- 1,
- 242,
- 226,
- 133,
- 142,
- 252,
- 22,
- 99,
- 105,
- 32,
- 216,
- 113,
- 87,
- 78,
- 105
- });
- System.Collections.Generic.IEnumerable<byte> arg_A8_0 = array;
- if (Class26.func_0 == null)
- {
- Class26.func_0 = new Func<byte, System.Collections.Generic.IEnumerable<char>>(Class26.smethod_3);
- }
- result = new string(arg_A8_0.SelectMany(Class26.func_0).ToArray<char>());
- }
- finally
- {
- ((System.IDisposable)hMAC).Dispose();
- }
- return result;
- }
- private static string smethod_1()
- {
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("Windower/");
- stringBuilder.Append(Class26.version_0.Major).Append('.').Append(Class26.version_0.Minor);
- stringBuilder.Append(" (");
- System.OperatingSystem oSVersion = System.Environment.OSVersion;
- System.PlatformID platform = oSVersion.Platform;
- switch (platform)
- {
- case System.PlatformID.Win32Windows:
- {
- int minor = oSVersion.Version.Minor;
- if (minor == 0)
- {
- stringBuilder.Append("Windows 95");
- goto IL_1CB;
- }
- if (minor == 10)
- {
- stringBuilder.Append("Windows 98");
- goto IL_1CB;
- }
- if (minor != 90)
- {
- stringBuilder.Append("Win 9x ");
- stringBuilder.Append(oSVersion.Version.Major).Append('.').Append(oSVersion.Version.Minor);
- goto IL_1CB;
- }
- stringBuilder.Append("Windows 98; Win 9x 4.90");
- goto IL_1CB;
- }
- case System.PlatformID.Win32NT:
- stringBuilder.Append("Windows NT ");
- stringBuilder.Append(oSVersion.Version.Major).Append('.').Append(oSVersion.Version.Minor);
- if (System.Environment.Is64BitOperatingSystem)
- {
- stringBuilder.Append(System.Environment.Is64BitProcess ? "; Win64; x64" : "; WOW64");
- goto IL_1CB;
- }
- goto IL_1CB;
- case System.PlatformID.WinCE:
- case System.PlatformID.Xbox:
- goto IL_1CB;
- case System.PlatformID.Unix:
- case System.PlatformID.MacOSX:
- break;
- default:
- if (platform != (System.PlatformID)128)
- {
- goto IL_1CB;
- }
- break;
- }
- string text = Class26.smethod_2();
- if (text == "Darwin")
- {
- stringBuilder.Append("Macintosh; Intel Mac OS X ");
- stringBuilder.Append(oSVersion.Version.Major).Append('.').Append(oSVersion.Version.Minor);
- }
- else
- {
- stringBuilder.Append(text).Append(System.Environment.Is64BitOperatingSystem ? "; x86_64" : "; i686");
- }
- IL_1CB:
- stringBuilder.Append(')');
- return stringBuilder.ToString();
- }
- private static string smethod_2()
- {
- System.IntPtr intPtr = System.IntPtr.Zero;
- try
- {
- intPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(8192);
- if (Class27.uname(intPtr) == 0)
- {
- return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intPtr);
- }
- }
- finally
- {
- if (intPtr != System.IntPtr.Zero)
- {
- System.Runtime.InteropServices.Marshal.FreeHGlobal(intPtr);
- }
- }
- return null;
- }
- private static System.Collections.Generic.IEnumerable<char> smethod_3(byte byte_0)
- {
- return byte_0.ToString("X2", System.Globalization.CultureInfo.InvariantCulture).ToCharArray();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement