havok_mk

mw3 chaos

Jan 9th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 8.09 KB | None | 0 0
  1. // BlackOpsIntervention_Loader.Form1
  2. private unsafe void auth()
  3. {
  4.     if (this.txtUsername.TextLength == 0 || this.txtPassword.TextLength == 0)
  5.     {
  6.         MessageBox.Show("You need to enter a valid username and password!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
  7.     }
  8.     else
  9.     {
  10.         sbyte* ptr = Form1.toString(this.txtUsername.Text);
  11.         sbyte* ptr2 = Form1.toString(this.txtPassword.Text);
  12.         <Module>.WritePrivateProfileStringA((sbyte*)(&<Module>.??_C@_09FLFAIIOG@MW3_Chaos?$AA@), (sbyte*)(&<Module>.??_C@_08GBJFCIEI@Username?$AA@), (sbyte*)ptr, (sbyte*)(&<Module>.??_C@_0BA@FFEIGMEO@?4?2MW3_Chaos?4ini?$AA@));
  13.         <Module>.WritePrivateProfileStringA((sbyte*)(&<Module>.??_C@_09FLFAIIOG@MW3_Chaos?$AA@), (sbyte*)(&<Module>.??_C@_08FJIAHGMM@Password?$AA@), (sbyte*)ptr2, (sbyte*)(&<Module>.??_C@_0BA@FFEIGMEO@?4?2MW3_Chaos?4ini?$AA@));
  14.         this.lblStatus.Text = "Preparing for authentication...";
  15.         sbyte* ptr3 = <Module>.@new(512000u);
  16.         $ArrayType$$$BY0CAA@D $ArrayType$$$BY0CAA@D;
  17.         <Module>.memset((void*)(&$ArrayType$$$BY0CAA@D), 0, 512u);
  18.         $ArrayType$$$BY0CAA@D $ArrayType$$$BY0CAA@D2;
  19.         <Module>.memset((void*)(&$ArrayType$$$BY0CAA@D2), 0, 512u);
  20.         <Module>.memset((void*)ptr3, 0, 512000u);
  21.         <Module>.wsprintfA((sbyte*)(&$ArrayType$$$BY0CAA@D), (sbyte*)(&<Module>.??_C@_0FL@NCGCCAHO@GET?5?1MW3_ChaosSubCheck?1subcheck?4@), ptr, ptr2, (sbyte*)(&<Module>.??_C@_0BG@HPLOCOFL@www?4xgamingstudio?4com?$AA@), (sbyte*)(&<Module>.??_C@_0O@LMKDPLPM@MW3_Chaos?11?40?$AA@));
  22.         hostent* ptr4 = <Module>.gethostbyname((sbyte*)(&<Module>.??_C@_0BG@HPLOCOFL@www?4xgamingstudio?4com?$AA@));
  23.         if (ptr4 == null || *(*(int*)(ptr4 + 12 / sizeof(hostent))) == 0)
  24.         {
  25.             MessageBox.Show("DNS Lookup of authentication server error. Your connection\nmay be problematic or your DNS server is currently offline.\nPlease try again later.\n", "Lookup error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
  26.             <Module>.delete((void*)ptr3);
  27.         }
  28.         else
  29.         {
  30.             uint num = <Module>.socket(2, 1, 6);
  31.             sockaddr_in sockaddr_in = 0;
  32.             initblk(ref sockaddr_in + 2, 0, 14);
  33.             sockaddr_in = 2;
  34.             cpblk(ref sockaddr_in + 4, *(*(int*)(ptr4 + 12 / sizeof(hostent))), 4);
  35.             *(ref sockaddr_in + 2) = <Module>.htons(80);
  36.             this.lblStatus.Text = "Connecting to server...";
  37.             if (<Module>.connect(num, (sockaddr*)(&sockaddr_in), 16) == -1)
  38.             {
  39.                 this.lblStatus.Text = "Unable to connect to authentication server.";
  40.                 <Module>.delete((void*)ptr3);
  41.             }
  42.             else
  43.             {
  44.                 this.lblStatus.Text = "Sending credential information...";
  45.                 if (<Module>.send(num, (sbyte*)(&$ArrayType$$$BY0CAA@D), <Module>.strlen((sbyte*)(&$ArrayType$$$BY0CAA@D)), 0) == -1)
  46.                 {
  47.                     this.lblStatus.Text = "Unable to send request to authentication server.";
  48.                     <Module>.delete((void*)ptr3);
  49.                 }
  50.                 else
  51.                 {
  52.                     int num2 = <Module>.recv(num, (sbyte*)(&$ArrayType$$$BY0CAA@D2), 512, 0);
  53.                     int num3 = 0;
  54.                     while (num3 < 291551 && num2 != -1)
  55.                     {
  56.                         <Module>.memcpy((void*)(ptr3 + (IntPtr)num3 / sizeof(sbyte)), (void*)(&$ArrayType$$$BY0CAA@D2), (uint)num2);
  57.                         if (<Module>.strstr(ptr3, (sbyte*)(&<Module>.??_C@_04CCHLMOGN@fail?$AA@)) != null)
  58.                         {
  59.                             this.lblStatus.Text = "Invalid username or subscription expired.";
  60.                             <Module>.delete((void*)ptr3);
  61.                             Process.Start("http://www.xgamingstudio.com/forum/payments.php");
  62.                             return;
  63.                         }
  64.                         num3 += num2;
  65.                         num2 = <Module>.recv(num, (sbyte*)(&$ArrayType$$$BY0CAA@D2), 512, 0);
  66.                         if (num2 < 512 && num3 + num2 >= 291551 && num2 != -1)
  67.                         {
  68.                             <Module>.memcpy((void*)(ptr3 + (IntPtr)num3 / sizeof(sbyte)), (void*)(&$ArrayType$$$BY0CAA@D2), (uint)num2);
  69.                             num3 += num2;
  70.                             break;
  71.                         }
  72.                     }
  73.                     <Module>.closesocket(num);
  74.                     sbyte* ptr5 = <Module>.strstr(ptr3, (sbyte*)(&<Module>.??_C@_04FMMHFHOO@?$AN?6?$AN?6?$AA@));
  75.                     if (ptr5 == null)
  76.                     {
  77.                         this.lblStatus.Text = "Server response unknown. Try again.";
  78.                     }
  79.                     else
  80.                     {
  81.                         ptr5 += 4 / sizeof(sbyte);
  82.                         $ArrayType$$$BY04D $ArrayType$$$BY04D;
  83.                         <Module>.memset((void*)(&$ArrayType$$$BY04D), 0, 5u);
  84.                         <Module>.memcpy((void*)(&$ArrayType$$$BY04D), (void*)ptr5, 4u);
  85.                         ptr5 += 4 / sizeof(sbyte);
  86.                         CCRC32 cCRC;
  87.                         <Module>.CCRC32.{ctor}(ref cCRC);
  88.                         try
  89.                         {
  90.                             if (<Module>.CCRC32.FullCRC(ref cCRC, (byte*)ptr5, 291551) != -1712404301)
  91.                             {
  92.                                 goto IL_3B8;
  93.                             }
  94.                             this.lblStatus.Text = "Authentication successful!";
  95.                             if (<Module>.strncmp((sbyte*)(&<Module>.??_C@_04FJPMOIGK@2?400?$AA@), (sbyte*)(&$ArrayType$$$BY04D), 4u) >= 0)
  96.                             {
  97.                                 goto IL_3A5;
  98.                             }
  99.                             this.lblStatus.Text = "You have: v" + "2.00" + " Server has: v" + new string((sbyte*)(&$ArrayType$$$BY04D));
  100.                             Enum @enum = MessageBox.Show("Your version of MW3 Chaos is outdated. The current\nversion is " + new string((sbyte*)(&$ArrayType$$$BY04D)) + ". Would you like to download the latest version?", "Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  101.                             if (@enum.Equals(DialogResult.Yes))
  102.                             {
  103.                                 Process.Start("http://www.xgamingstudio.com/MW3_ChaosDownload/download_client.php");
  104.                             }
  105.                             <Module>.delete((void*)ptr3);
  106.                             Application.Exit();
  107.                         }
  108.                         catch
  109.                         {
  110.                             <Module>.___CxxCallUnwindDtor(ldftn(CCRC32.{dtor}), (void*)(&cCRC));
  111.                             throw;
  112.                         }
  113.                         <Module>.CCRC32.{dtor}(ref cCRC);
  114.                         return;
  115.                         IL_3A5:
  116.                         try
  117.                         {
  118.                             goto IL_3F6;
  119.                         }
  120.                         catch
  121.                         {
  122.                             <Module>.___CxxCallUnwindDtor(ldftn(CCRC32.{dtor}), (void*)(&cCRC));
  123.                             throw;
  124.                         }
  125.                         goto IL_3B8;
  126.                         IL_3F6:
  127.                         try
  128.                         {
  129.                             if (!<Module>.?A0xa8a89f8b.authenticated)
  130.                             {
  131.                                 <Module>.GetTempFileName((sbyte*)(&<Module>.??_C@_01LFCBOECM@?4?$AA@), (sbyte*)(&<Module>.??_C@_03EGBCILHG@?$HOZX?$AA@), 0u, (sbyte*)(&<Module>.?A0xa8a89f8b.decryptModPath));
  132.                                 byte* ptr6 = (byte*)ptr5;
  133.                                 _iobuf* ptr7 = <Module>.fopen((sbyte*)(&<Module>.??_C@_0O@JCMDGNCA@MW3_Chaos?4dat?$AA@), (sbyte*)(&<Module>.??_C@_02JDPG@rb?$AA@));
  134.                                 _iobuf* ptr8 = <Module>.fopen((sbyte*)(&<Module>.?A0xa8a89f8b.decryptModPath), (sbyte*)(&<Module>.??_C@_02GMLFBBN@wb?$AA@));
  135.                                 int num4 = 0;
  136.                                 $ArrayType$$$BY0CAA@E $ArrayType$$$BY0CAA@E;
  137.                                 int num5 = <Module>.fread((void*)(&$ArrayType$$$BY0CAA@E), 1u, 512u, ptr7);
  138.                                 while (<Module>.feof(ptr7) == null)
  139.                                 {
  140.                                     for (int i = 0; i < num5; i++)
  141.                                     {
  142.                                         if (num4 >= 2)
  143.                                         {
  144.                                             *(ref $ArrayType$$$BY0CAA@E + i) = (*(ref $ArrayType$$$BY0CAA@E + i) ^ ptr6[(IntPtr)num4 / 1] + *(ptr6 + (IntPtr)(num4 - 1) / 1) + ptr6[(IntPtr)(num4 - 2) / 1]);
  145.                                             num4++;
  146.                                         }
  147.                                         else
  148.                                         {
  149.                                             *(ref $ArrayType$$$BY0CAA@E + i) = (*(ref $ArrayType$$$BY0CAA@E + i) ^ ptr6[(IntPtr)num4 / 1]);
  150.                                             num4++;
  151.                                         }
  152.                                         if (num4 == 291551)
  153.                                         {
  154.                                             num4 = 0;
  155.                                         }
  156.                                     }
  157.                                     <Module>.fwrite((void*)(&$ArrayType$$$BY0CAA@E), 1u, (uint)num5, ptr8);
  158.                                     num5 = <Module>.fread((void*)(&$ArrayType$$$BY0CAA@E), 1u, 512u, ptr7);
  159.                                     if (<Module>.feof(ptr7) != null)
  160.                                     {
  161.                                         break;
  162.                                     }
  163.                                 }
  164.                                 <Module>.fclose(ptr7);
  165.                                 <Module>.fclose(ptr8);
  166.                                 File.SetAttributes(new string((sbyte*)(&<Module>.?A0xa8a89f8b.decryptModPath)), FileAttributes.Hidden | FileAttributes.System);
  167.                             }
  168.                             this.button1.Enabled = false;
  169.                             this.tmrInject.Enabled = true;
  170.                             <Module>.?A0xa8a89f8b.authenticated = true;
  171.                             <Module>.delete((void*)ptr3);
  172.                         }
  173.                         catch
  174.                         {
  175.                             <Module>.___CxxCallUnwindDtor(ldftn(CCRC32.{dtor}), (void*)(&cCRC));
  176.                             throw;
  177.                         }
  178.                         <Module>.CCRC32.{dtor}(ref cCRC);
  179.                         return;
  180.                         IL_3B8:
  181.                         try
  182.                         {
  183.                             this.lblStatus.Text = "Invalid username or subscription expired.";
  184.                             <Module>.delete((void*)ptr3);
  185.                             Process.Start("http://www.xgamingstudio.com/forum/payments.php");
  186.                         }
  187.                         catch
  188.                         {
  189.                             <Module>.___CxxCallUnwindDtor(ldftn(CCRC32.{dtor}), (void*)(&cCRC));
  190.                             throw;
  191.                         }
  192.                         <Module>.CCRC32.{dtor}(ref cCRC);
  193.                     }
  194.                 }
  195.             }
  196.         }
  197.     }
  198. }
Advertisement
Add Comment
Please, Sign In to add comment