Advertisement
Guest User

Windower v4 Launcher

a guest
Mar 10th, 2013
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 7.23 KB | None | 0 0
  1. using Microsoft.Win32;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Net;
  8. using System.Runtime.InteropServices;
  9. using System.Security.Cryptography;
  10. using System.Text;
  11. internal sealed class Class26
  12. {
  13.     private static readonly System.Version version_0 = typeof(Class26).Assembly.GetName().Version;
  14.     private static readonly string string_0 = Class26.smethod_0();
  15.     private static readonly string string_1 = Class26.smethod_1();
  16.     private readonly System.Collections.Generic.Dictionary<string, object> dictionary_0 = new System.Collections.Generic.Dictionary<string, object>();
  17.     private static Func<byte, System.Collections.Generic.IEnumerable<char>> func_0;
  18.     public Class26(string string_2)
  19.     {
  20.         this.method_0("tid", "UA-36204578-2");
  21.         this.method_0("aid", null);
  22.         this.method_0("cid", Class26.string_0);
  23.         this.method_0("t", string_2);
  24.         this.method_0("an", "Launcher");
  25.         this.method_0("av", Class26.version_0);
  26.     }
  27.     public void method_0(string string_2, object object_0)
  28.     {
  29.         bool? flag = object_0 as bool?;
  30.         this.dictionary_0.Add(string_2, (!flag.HasValue) ? object_0 : (flag.GetValueOrDefault() ? 1 : 0));
  31.     }
  32.     public void method_1()
  33.     {
  34.         HttpWebRequest httpWebRequest = WebRequest.Create("https://ssl.google-analytics.com/collect") as HttpWebRequest;
  35.         if (httpWebRequest != null)
  36.         {
  37.             httpWebRequest.Proxy = null;
  38.             httpWebRequest.UserAgent = Class26.string_1;
  39.             httpWebRequest.Method = "POST";
  40.             System.IO.Stream stream = null;
  41.             try
  42.             {
  43.                 stream = httpWebRequest.GetRequestStream();
  44.                 System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(stream);
  45.                 try
  46.                 {
  47.                     stream = null;
  48.                     streamWriter.Write("v=1");
  49.                     foreach (System.Collections.Generic.KeyValuePair<string, object> current in this.dictionary_0)
  50.                     {
  51.                         string key = current.Key;
  52.                         string stringToEscape = (current.Value ?? string.Empty).ToString();
  53.                         streamWriter.Write('&');
  54.                         streamWriter.Write(Uri.EscapeDataString(key));
  55.                         streamWriter.Write('=');
  56.                         streamWriter.Write(Uri.EscapeDataString(stringToEscape));
  57.                     }
  58.                 }
  59.                 finally
  60.                 {
  61.                     ((System.IDisposable)streamWriter).Dispose();
  62.                 }
  63.             }
  64.             finally
  65.             {
  66.                 if (stream != null)
  67.                 {
  68.                     stream.Dispose();
  69.                 }
  70.             }
  71.             httpWebRequest.GetResponse().GetResponseStream().Dispose();
  72.         }
  73.     }
  74.     private static string smethod_0()
  75.     {
  76.         System.Guid guid;
  77.         using (Microsoft.Win32.RegistryKey registryKey = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64))
  78.         {
  79.             using (Microsoft.Win32.RegistryKey registryKey2 = registryKey.OpenSubKey("SOFTWARE\\Microsoft\\Cryptography"))
  80.             {
  81.                 if (registryKey2 == null || !System.Guid.TryParse((registryKey2.GetValue("MachineGuid") as string) ?? string.Empty, out guid))
  82.                 {
  83.                     guid = System.Guid.NewGuid();
  84.                 }
  85.             }
  86.         }
  87.         System.Security.Cryptography.HMAC hMAC = new System.Security.Cryptography.HMACSHA256(guid.ToByteArray());
  88.         string result;
  89.         try
  90.         {
  91.             byte[] array = hMAC.ComputeHash(new byte[]
  92.             {
  93.                 36,
  94.                 63,
  95.                 106,
  96.                 136,
  97.                 133,
  98.                 163,
  99.                 8,
  100.                 211,
  101.                 19,
  102.                 25,
  103.                 138,
  104.                 46,
  105.                 3,
  106.                 112,
  107.                 115,
  108.                 68,
  109.                 164,
  110.                 9,
  111.                 56,
  112.                 34,
  113.                 41,
  114.                 159,
  115.                 49,
  116.                 208,
  117.                 8,
  118.                 46,
  119.                 250,
  120.                 152,
  121.                 236,
  122.                 78,
  123.                 108,
  124.                 137,
  125.                 69,
  126.                 40,
  127.                 33,
  128.                 230,
  129.                 56,
  130.                 208,
  131.                 19,
  132.                 119,
  133.                 190,
  134.                 84,
  135.                 102,
  136.                 207,
  137.                 52,
  138.                 233,
  139.                 12,
  140.                 108,
  141.                 192,
  142.                 172,
  143.                 41,
  144.                 183,
  145.                 201,
  146.                 124,
  147.                 80,
  148.                 221,
  149.                 63,
  150.                 132,
  151.                 213,
  152.                 181,
  153.                 181,
  154.                 71,
  155.                 9,
  156.                 23,
  157.                 146,
  158.                 22,
  159.                 213,
  160.                 217,
  161.                 137,
  162.                 121,
  163.                 251,
  164.                 27,
  165.                 209,
  166.                 49,
  167.                 11,
  168.                 166,
  169.                 152,
  170.                 223,
  171.                 181,
  172.                 172,
  173.                 47,
  174.                 253,
  175.                 114,
  176.                 219,
  177.                 208,
  178.                 26,
  179.                 223,
  180.                 183,
  181.                 184,
  182.                 225,
  183.                 175,
  184.                 237,
  185.                 106,
  186.                 38,
  187.                 126,
  188.                 150,
  189.                 186,
  190.                 124,
  191.                 144,
  192.                 69,
  193.                 241,
  194.                 44,
  195.                 127,
  196.                 153,
  197.                 36,
  198.                 161,
  199.                 153,
  200.                 71,
  201.                 179,
  202.                 145,
  203.                 108,
  204.                 247,
  205.                 8,
  206.                 1,
  207.                 242,
  208.                 226,
  209.                 133,
  210.                 142,
  211.                 252,
  212.                 22,
  213.                 99,
  214.                 105,
  215.                 32,
  216.                 216,
  217.                 113,
  218.                 87,
  219.                 78,
  220.                 105
  221.             });
  222.             System.Collections.Generic.IEnumerable<byte> arg_A8_0 = array;
  223.             if (Class26.func_0 == null)
  224.             {
  225.                 Class26.func_0 = new Func<byte, System.Collections.Generic.IEnumerable<char>>(Class26.smethod_3);
  226.             }
  227.             result = new string(arg_A8_0.SelectMany(Class26.func_0).ToArray<char>());
  228.         }
  229.         finally
  230.         {
  231.             ((System.IDisposable)hMAC).Dispose();
  232.         }
  233.         return result;
  234.     }
  235.     private static string smethod_1()
  236.     {
  237.         System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("Windower/");
  238.         stringBuilder.Append(Class26.version_0.Major).Append('.').Append(Class26.version_0.Minor);
  239.         stringBuilder.Append(" (");
  240.         System.OperatingSystem oSVersion = System.Environment.OSVersion;
  241.         System.PlatformID platform = oSVersion.Platform;
  242.         switch (platform)
  243.         {
  244.         case System.PlatformID.Win32Windows:
  245.         {
  246.             int minor = oSVersion.Version.Minor;
  247.             if (minor == 0)
  248.             {
  249.                 stringBuilder.Append("Windows 95");
  250.                 goto IL_1CB;
  251.             }
  252.             if (minor == 10)
  253.             {
  254.                 stringBuilder.Append("Windows 98");
  255.                 goto IL_1CB;
  256.             }
  257.             if (minor != 90)
  258.             {
  259.                 stringBuilder.Append("Win 9x ");
  260.                 stringBuilder.Append(oSVersion.Version.Major).Append('.').Append(oSVersion.Version.Minor);
  261.                 goto IL_1CB;
  262.             }
  263.             stringBuilder.Append("Windows 98; Win 9x 4.90");
  264.             goto IL_1CB;
  265.         }
  266.         case System.PlatformID.Win32NT:
  267.             stringBuilder.Append("Windows NT ");
  268.             stringBuilder.Append(oSVersion.Version.Major).Append('.').Append(oSVersion.Version.Minor);
  269.             if (System.Environment.Is64BitOperatingSystem)
  270.             {
  271.                 stringBuilder.Append(System.Environment.Is64BitProcess ? "; Win64; x64" : "; WOW64");
  272.                 goto IL_1CB;
  273.             }
  274.             goto IL_1CB;
  275.         case System.PlatformID.WinCE:
  276.         case System.PlatformID.Xbox:
  277.             goto IL_1CB;
  278.         case System.PlatformID.Unix:
  279.         case System.PlatformID.MacOSX:
  280.             break;
  281.         default:
  282.             if (platform != (System.PlatformID)128)
  283.             {
  284.                 goto IL_1CB;
  285.             }
  286.             break;
  287.         }
  288.         string text = Class26.smethod_2();
  289.         if (text == "Darwin")
  290.         {
  291.             stringBuilder.Append("Macintosh; Intel Mac OS X ");
  292.             stringBuilder.Append(oSVersion.Version.Major).Append('.').Append(oSVersion.Version.Minor);
  293.         }
  294.         else
  295.         {
  296.             stringBuilder.Append(text).Append(System.Environment.Is64BitOperatingSystem ? "; x86_64" : "; i686");
  297.         }
  298.         IL_1CB:
  299.         stringBuilder.Append(')');
  300.         return stringBuilder.ToString();
  301.     }
  302.     private static string smethod_2()
  303.     {
  304.         System.IntPtr intPtr = System.IntPtr.Zero;
  305.         try
  306.         {
  307.             intPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(8192);
  308.             if (Class27.uname(intPtr) == 0)
  309.             {
  310.                 return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intPtr);
  311.             }
  312.         }
  313.         finally
  314.         {
  315.             if (intPtr != System.IntPtr.Zero)
  316.             {
  317.                 System.Runtime.InteropServices.Marshal.FreeHGlobal(intPtr);
  318.             }
  319.         }
  320.         return null;
  321.     }
  322.     private static System.Collections.Generic.IEnumerable<char> smethod_3(byte byte_0)
  323.     {
  324.         return byte_0.ToString("X2", System.Globalization.CultureInfo.InvariantCulture).ToCharArray();
  325.     }
  326. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement